Request processing method and device

By determining the primary data center in the target area to process data requests in cross-regional order processing, the problem of inconsistent order status is solved, and the uniformity and success rate of data processing are achieved.

CN114549137BActive Publication Date: 2025-10-03BEIJING YOUZHUJU NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210190744.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-28
Publication Date
2025-10-03
Estimated Expiration
2042-02-28

AI Technical Summary

Technical Problem

In cross-regional order processing, the status of the same order may be inconsistent due to processing by primary data centers in different regions.

Method used

By receiving data processing requests, the target area of ​​the order purchaser is determined, and the main data center corresponding to the target area is selected as the processing center from the preset configuration information to ensure that all data processing requests are processed by the main data center to avoid data inconsistency in different data centers.

Benefits of technology

It achieves the uniformity of the same order status, avoids data inconsistency problems in different data centers, and improves the success rate and consistency of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114549137B_ABST
    Figure CN114549137B_ABST
Patent Text Reader

Abstract

The present disclosure provides a request processing method and device, which relate to the field of computer processing technology. The method includes: receiving a data processing request, the data processing request is used to process an order; determining the target area corresponding to the purchaser of the order; selecting the main data center corresponding to the target area from the preset configuration information as the first data center for processing the data processing request, the preset configuration information includes at least one main data center corresponding to each area; sending the data processing request to the first data center for processing. The present disclosure is that when the purchaser and the seller initiate a data processing request for an order, the data processing request is processed by the main data center of the target area corresponding to the purchaser. In this way, for the same order, the purchaser and the seller both process the data of the same data processing center, thereby avoiding the buyer and the seller modifying the data of different data centers, which leads to inconsistent data in the two data centers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer processing technology, and more particularly, to a request processing method and device. Background Art

[0002] In today's globalized economy, goods can be purchased across regions. A country can be a region, or one or more countries can constitute a region. For example, a user in country A1 can purchase goods from a seller in country A2. These purchases generate a large number of orders, which can be stored and managed by the data center. For example, when a data processing request is for adding an order, the data center can store the newly added order; when a data processing request is for modifying an order, the data center can modify the specified order; when a data processing request is for deleting an order, the data center can delete the specified order; and when a data processing request is for reading order data, the data center can return the specified order data.

[0003] In existing technology, multiple data centers are typically deployed, with each region corresponding to a dedicated data center. Data processing requests from users in that region are processed by the corresponding data center, which then synchronizes the data to the remaining data centers. Upon receiving a data processing request for an order, the corresponding data center can modify the order data.

[0004] However, the above process may result in inconsistent status of the same order. Summary of the Invention

[0005] The embodiments of the present disclosure provide a request processing method and device, which can ensure the consistency of order status.

[0006] In a first aspect, an embodiment of the present disclosure provides a request processing method, applied to a first gateway, the method comprising:

[0007] receiving a data processing request for processing an order;

[0008] Determining the target area corresponding to the purchaser of the order;

[0009] Selecting a primary data center corresponding to the target area from preset configuration information as a first data center for processing the data processing request, the preset configuration information including at least one primary data center corresponding to each area;

[0010] The data processing request is sent to the first data center for processing.

[0011] In a second aspect, an embodiment of the present disclosure provides a request processing device, applied to a first gateway, the device comprising:

[0012] A data processing request receiving module, configured to receive a data processing request for processing an order;

[0013] A target area determination module, used to determine the target area corresponding to the purchaser of the order;

[0014] a data center determining module, configured to select a primary data center corresponding to the target area from preset configuration information as a first data center for processing the data processing request, the preset configuration information including a primary data center corresponding to at least one area;

[0015] The data processing module is used to send the data processing request to the first data center for processing.

[0016] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory;

[0017] The memory stores computer-executable instructions;

[0018] The at least one processor executes the computer-executable instructions stored in the memory, so that the electronic device implements the method according to the first aspect.

[0019] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the computing device implements the method described in the first aspect.

[0020] In a fifth aspect, an embodiment of the present disclosure provides a computer program, which is used to implement the method described in the first aspect.

[0021] The disclosed embodiment provides a request processing method and device, the method comprising: receiving a data processing request, the data processing request being used to process an order; determining the target area corresponding to the purchaser of the order; selecting the main data center corresponding to the target area from preset configuration information as the first data center for processing the data processing request, the preset configuration information including at least one main data center corresponding to each area; and sending the data processing request to the first data center for processing. In the disclosed embodiment, when the purchaser and the seller initiate data processing requests for an order, the main data center of the target area corresponding to the purchaser processes the data processing request. In this way, for the same order, the purchaser and the seller both process data from the same data processing center, thereby avoiding the buyer and the seller modifying data in different data centers, which may cause inconsistent data in the two data centers. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0023] Figure 1 is a schematic diagram of a data processing scenario applicable to embodiments of the present disclosure;

[0024] Figure 2 This is a flowchart of a request processing method provided by an embodiment of the present disclosure;

[0025] Figure 3 and Figure 4 Schematic diagrams of two processing flows of data processing requests provided by embodiments of the present disclosure;

[0026] Figure 5 and Figure 6 1 is a schematic diagram of two layouts of a gateway of a data center provided by an embodiment of the present disclosure;

[0027] Figure 7 is a structural block diagram of a request processing device provided by an embodiment of the present disclosure;

[0028] Figure 8 This is a structural block diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.

[0030] The embodiments of the present disclosure can be applied to order data processing scenarios. Figure 1 It is a schematic diagram of a data processing scenario to which the embodiments of the present disclosure are applicable. Figure 1 The figure shows three data centers D1 to D3, which are interconnected to synchronize data from the master data center to the slave data centers. A data center is a computer room used for processing and storing data.

[0031] Reference Figure 1As shown, D1 is used to process data processing requests from m1 regions, A1_1 through A1_m1. That is, D1 is the master data center for regions A1_1 through A1_m1, and D2 and D3 are slave data centers for regions A1_1 through A1_m1. After D1 processes data processing requests from users in regions A1_1 through A1_m1, it can synchronize data with D2 and D3.

[0032] D2 is used to process data processing requests from m2 regions, A2_1 through A2_m2. That is, D2 is the primary data center for A2_1 through A2_m2, while D1 and D3 are secondary data centers for A2_1 through A2_m2. After D2 processes data processing requests from users in A2_1 through A2_m2, it synchronizes the data with D1 and D3.

[0033] D3 is responsible for processing data processing requests from m3 regions, A3_1 through A3_m3. That is, D3 is the primary data center for A3_1 through A3_m3, while D1 and D2 are secondary data centers for A3_1 through A3_m3. After D3 processes data processing requests from users in A3_1 through A3_m3, it synchronizes the data with D1 and D2.

[0034] from Figure 1 As can be seen, a region corresponds to only one primary data center and multiple secondary data centers, but a primary data center can correspond to one or more regions, and a secondary data center can correspond to one or more regions.

[0035] In the prior art, when a user initiates a data processing request, the request is processed by the primary data center in the region corresponding to the user. The primary data center then synchronizes the request to the secondary data center. The user can be a buyer or a seller. For example, if buyer U1 is in region A1_1, the data processing request initiated by buyer U1 for the order is processed by primary data center D1 in region A1_1. For another example, if seller U2 is in region A2_1, the data processing request initiated by seller U2 for the order is processed by primary data center D2 in region A2_1.

[0036] As can be seen in the above process, when the buyer and seller correspond to different regions, and different regions correspond to different primary data centers, the buyer and seller's data processing requests for the same order will be handled by different primary data centers. This may lead to inconsistent status of the same order.

[0037] For example, if buyer U1 in region A1_1 purchases a product and then cancels the order, the primary data center D1 in region A1_1 changes the order status to Cancelled. Meanwhile, seller U2 in region A2_1 ships the order. At this point, the primary data center D2 in region A2_1 changes the order status to Shipped. This means that the same order status in D1 and D2 is inconsistent.

[0038] To address the aforementioned technical issues, the disclosed embodiments consider that whether a data processing request is initiated by the buyer or the seller for an order, the request is processed by the primary data center in the target region corresponding to the buyer. This allows both the buyer and the seller to modify data in the same data processing center for the same order, thus avoiding data inconsistencies between the two data centers caused by the buyer and the seller modifying data in different data centers.

[0039] For example, if buyer U1 in region A1_1 purchases a product and then cancels the order, D1 will change the order's status to Canceled. In this disclosed embodiment, all order data processing requests are handled by the primary data center in the buyer's region. Therefore, when seller U2 ships the order, the primary data center D1 corresponding to region A1_1 changes the order's status to Shipped. This way, the same order can only have one status, eliminating inconsistent statuses.

[0040] The following detailed description of the technical solutions of the embodiments of the present disclosure and how the technical solutions of the present disclosure solve the above-mentioned technical problems is provided with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. The embodiments of the present disclosure will be described below in conjunction with the accompanying drawings.

[0041] Figure 2 This is a flowchart of the steps of a request processing method provided by an embodiment of the present disclosure. Figure 2 The method shown can be applied in a first gateway, which is used to schedule and forward data processing requests. The first gateway can be an independent device or a virtual module integrated in other devices. Figure 2 As shown, the request processing method includes:

[0042] S101: Receive a data processing request, where the data processing request is used to process an order.

[0043] The data processing request may be initiated by the purchaser, the seller, or any other third party, and the embodiments of the present disclosure do not impose any restrictions thereon.

[0044] Furthermore, data processing requests can be divided into two categories: data write requests and data read requests. Data write requests are used to add, delete, or modify data. Data read requests are used to read data from the data center and do not modify, delete, or add data in the data center.

[0045] For example, when a buyer needs to place an order, the data processing request may be a data writing request for writing the data of the newly generated order into the data center.

[0046] For another example, when a buyer needs to cancel an order or a seller needs to ship the goods, the data processing request may be a data write request for modifying the status of the order in the data center.

[0047] For another example, when order data needs to be cleared, the data processing request may be a data write request for deleting data of a specified order in the data center.

[0048] When a buyer or seller needs to query an order, the data processing request may be a data read request for obtaining order-related data from the data center.

[0049] It should be noted that the buyer or seller can initiate the above data processing request through the electronic device used by each party. Specifically, the above data processing request can be initiated in an application or web page running on the electronic device.

[0050] S102: Determine the target area corresponding to the buyer of the order.

[0051] The target area can be any of the following: the purchaser's current area or the purchaser's registered area. In practical applications, the target area can be set to the purchaser's current area or the purchaser's registered area based on specific requirements. The area here refers to a geographically defined area.

[0052] The target region can be determined based on the information included in the data processing request. The data processing request may include at least one of the following information: the target region, the domain name of the device submitting the data processing request, and the purchaser's identification information. In the disclosed embodiment, all order data is divided into multiple sub-datasets based on the region of the purchaser. Each sub-dataset in a region corresponds to a primary data center, which has sole write permission to that region. At any given time, a region corresponds to only one primary data center.

[0053] However, a primary data center can correspond to one or more regional sub-datasets, and these regional sub-datasets of the primary data center constitute the data set of the primary data center. It is understood that the data sets of the remaining data centers are the same as the data set of the primary data center and are all full data for all orders.

[0054] In one example embodiment of the present disclosure, when a device needs to send a data processing request, the device may determine a target region and add the target region to the transmitted data processing request. The device may determine the target region based on the following information: SIM (Subscriber Identity Module) information on the device, the IP (Internet Protocol) address of the device, and the system region of the device.

[0055] Specifically, when determining the target area based on the SIM information, the area to which the SIM card belongs can be determined as the target area. For example, if the area is a country, the MCC (mobile country code) of the SIM card can be used as the target area.

[0056] When the target area is determined according to the IP address, the area to which the IP address belongs may be determined as the target area.

[0057] When the target area is determined based on the system area of ​​the device, the system area of ​​the device may be determined as the target area. The system area of ​​the device may be the area set by the user when the user first uses the device.

[0058] In actual applications, the three methods for determining the target area may be assigned a priority, and one of the methods may be selected based on the priority. For example, the target area may be determined based on the following priorities, from highest to lowest: determining the target area based on SIM information, determining the target area based on the IP address, and determining the target area based on the device's system area.

[0059] Of course, the above priorities can be flexibly adjusted according to actual application scenarios, and the embodiments of the present disclosure do not limit them.

[0060] In another example of the disclosed embodiment, the device initiating the data processing request has not yet specified a target region. In other words, the data processing request does not include a target region. Therefore, upon receiving the data processing request, the first gateway needs to determine the target region. In this case, the first gateway can determine the target region based on the domain name information. Specifically, the domain name information is parsed to obtain the target region corresponding to the purchaser of the order.

[0061] In actual applications, domain name information corresponds to a region, and different regions have different corresponding domain name information. When a purchaser initiates a data processing request, the domain name information of the purchaser's device represents the purchaser's current region, which can be the target region. Because the relationship between domain name information and region is fixed, the target region determined based on domain name information is highly accurate.

[0062] It's important to note that the region corresponding to the domain name information is the current region of the user initiating the data processing request. This region can be the current region of either the buyer or the seller. If the data processing request is processed by a data center in the seller's region, then, as with existing technology, the seller's and buyer's data processing requests will be handled by two different data centers, resulting in inconsistent order status.

[0063] To further avoid the aforementioned issues, before resolving the domain name information, it's necessary to determine whether the data processing request originated from the buyer. If so, the region obtained from the domain name resolution can be used as the target region. If it originated from the seller, the target region is determined using the following methods. This avoids using the seller's current region as the target region, improving the accuracy of the target region and avoiding having to process the data processing request in a data center in the seller's region, further ensuring order status consistency.

[0064] In another example of an embodiment of the present disclosure, the device that initiates the data processing request does not determine the target area, that is, the data processing request does not carry the target area, so when the first gateway receives the data processing request, it needs to determine the target area. At this time, the first gateway can also determine the target area based on the identity information, wherein the identity information is a unique identifier for representing the purchaser. Since the purchaser usually registers the corresponding attribution area of ​​the purchaser when registering information, wherein the identity information here can be a string, which corresponds one-to-one with the purchaser. Therefore, after the data center generates unique identity information for the purchaser, the correspondence between the identity information and the attribution area can be recorded as registration information. Therefore, the embodiment of the present disclosure can also determine the target area through the identity information and registration information of the purchaser in the data processing request.

[0065] Specifically, the area corresponding to the identity information in the above-mentioned data processing request is obtained from the registration information as the target area corresponding to the purchaser of the order, and the above-mentioned registration information includes the attribution area where the identity information of at least one purchaser is registered. For example, the attribution area registered by a purchaser when registering is area A1_1, then the target area of ​​the data processing request for the purchaser's order is A1_1, so that the data processing request can be processed by the main data center D1 of A1_1. Similarly, the area determined according to the identity information of the purchaser must be the attribution area of ​​the purchaser and cannot be the area of ​​the seller, so there is no need to determine who the initiator of the data processing request is, and the accuracy of the target area can be guaranteed, thereby ensuring the consistency of the order status. S103: Select the main data center corresponding to the above-mentioned target area from the preset configuration information as the first data center for processing the data processing request, and the preset configuration information includes the main data center corresponding to at least one area.

[0066] The preset configuration information is pre-configured, and the format of the preset configuration information can be flexibly set as long as it can represent the corresponding relationship between the region and the main data center.

[0067] For example, for Figure 1 For the three data centers shown, the first format of the preset configuration information may be: {D1: A1_1, ..., A1_m1}, {D2: A2_1, ..., A2_m2}, and {D3: A3_1, ..., A3_m3}.

[0068] For another example, the second format of the preset configuration information may be: {A1, D1}, ..., {A1_m1, D2}, {A2_1, D2}, ..., {A2_m2, D2}, {A3_1, D3}, ..., {A3_m3, D3}. The embodiment of the present disclosure does not limit the format of the configuration information.

[0069] It can be seen that the regions and primary data centers in the second format have a one-to-one correspondence, so the regions can be used as indexes and the primary data center can be determined based on the regions, which helps to improve retrieval efficiency and further increase the speed of determining the first data center.

[0070] Based on the above configuration information, when the target area determined in S102 is A3_1, the first data center determined from the configuration information is D3.

[0071] Of course, this configuration information can be modified. For example, if data center D1 is abnormal, the primary data center corresponding to areas A1_1 to A1_m1 needs to be changed to data center D2 or D3, and D1 needs to be changed to a secondary data center. This modification can be achieved by modifying the above configuration information. The following uses the configuration information in the first format as an example. When the primary data center corresponding to areas A1_1 to A1_m1 is changed to D2, the modified configuration information can be: {D2: A1_1, ..., A1_m1, A2_1, ..., A2_m2} and {D3: A3_1, ..., A3_m3}.

[0072] In addition to the above configuration modification scenarios, there are other scenarios that require configuration modification. During the configuration modification process, if data is written to the primary data center before the modification based on data processing requests, this data may be lost or conflict with the data in the new primary data center after the modification.

[0073] To avoid these problems, the embodiment of the present disclosure can stop processing data processing requests for the area corresponding to the primary data center being modified in the preset configuration information during the modification of the preset configuration information, and resume processing data processing requests for the area after the configuration information is modified.

[0074] Specifically, when the first gateway receives a data processing request, it first determines the target area of ​​the data processing request, and then determines the first data center of the target area. If the first data center is the main data center being modified in the preset configuration information, the first gateway will not send the data processing request to the first data center for processing.

[0075] Of course, in order to improve the interaction friendliness, the first gateway may also reply an indication message to the initiator of the data processing request to prompt that the data processing request cannot be processed temporarily.

[0076] As can be seen from the description of S101 above, the data processing request can be divided into data writing request and data reading request. The embodiment of the present disclosure determines the data center to process the data writing request and the data reading request according to different strategies.

[0077] When the data processing request is a data write request, the primary data center must process it and synchronize it with the secondary data center to ensure data consistency across all data centers. In other words, the first gateway can select the primary data center corresponding to the target region from the preset configuration information as the primary data center for processing the data write request, and the data write request is then processed by the primary data center.

[0078] It is understandable that if the data write request is not processed by the above-mentioned master data center provided in accordance with the embodiment of the present disclosure, but is processed by the slave data center, then the written data cannot be synchronized to the master data center, resulting in data inconsistency between the master data center and the slave data center.

[0079] When the data processing request is a read request, consider processing it in a slave data center. This prevents all requests from being processed by the primary data center, helping to reduce the primary data center's load. This prevents the primary data center from experiencing anomalies due to excessive traffic, ensuring that the primary data center remains operational to process write requests, helping to improve the primary data center's success rate and efficiency.

[0080] Furthermore, a data read request can carry a real-time flag, indicating the real-time requirement of the data read request. Thus, the first gateway can determine the data center that should process the data read request based on the real-time flag. Since the primary data center processes data write requests, the data in the primary data center is the most recent data, i.e., data with higher real-time requirements. Therefore, data read requests with higher real-time requirements can be processed by the primary data center, while data read requests with lower real-time requirements can be processed by the secondary data center.

[0081] Specifically, when the real-time identifier carried by the data read request is the first identifier, it means that the data read request has a high real-time requirement, so that the first gateway can select the main data center corresponding to the target area from the preset configuration information as the first data center for processing the data read request, so as to process the data read request through the first data center. In this way, the high real-time requirement of the data read request for data can be guaranteed. For example, since obtaining the status of an order usually requires obtaining the latest status, the data read request for reading the status of the order has a high real-time requirement, and it can carry the first identifier, so that the data read request for reading the status of the order can be processed by the main data center.

[0082] If the real-time flag carried by a data read request is the second flag, it indicates that the data read request has a lower real-time requirement. Therefore, the first gateway can process the data read request through the second data center, which is a data center other than the first data center in the target area. For example, because the product information of an order changes slightly, the data read request for reading the order product information has a lower real-time requirement. Therefore, the data read request can carry the second flag, allowing the slave data center to process the data read request for reading the order product information.

[0083] It is understandable that since the first data center is the primary data center corresponding to the target area, the second data center is the secondary data center corresponding to the target area. The disclosed embodiment can process data read requests with lower data real-time requirements through the secondary data center, thereby further reducing the load on the primary data center while meeting lower data real-time requirements. This avoids abnormalities in the primary data center due to large loads, ensures that the primary data center is normal, and processes data write requests, helping to improve the success rate and efficiency of the primary data center's processing of data write requests.

[0084] S104: Send the data processing request to the first data center for processing.

[0085] In the embodiment of the present disclosure, steps S101 to S104 can be performed by a first gateway. The first gateway can be a gateway corresponding to any data center. The gateway of each data center in the embodiment of the present disclosure can implement the reception and forwarding of data processing requests in the embodiment of the present disclosure, that is, any gateway can perform the process of S101 to S104.

[0086] Compared to scenarios where only one gateway performs reception and forwarding, the disclosed embodiments allow data processing requests to be received and forwarded by the remaining gateways even if one gateway experiences an anomaly. This helps improve the success rate of data processing requests and prevents the entire data center from being unavailable due to a single gateway anomaly. Furthermore, each data center has a gateway, which balances the processing load across each gateway, preventing gateway anomalies caused by excessive processing load, further improving the success rate of data processing requests.

[0087] The first data center in the embodiment of the present disclosure may be a data center corresponding to the first gateway, or may be a data center corresponding to other gateways.

[0088] When the first data center is the data center corresponding to the first gateway, the first gateway may send the data processing request to the first server for processing. The first server is the server of the first data center.

[0089] When the first data center is not the data center corresponding to the first gateway, the first gateway can send the data processing request to the second server for processing through the second gateway. The second gateway is the server of the first data center, and the second server is the server of the first data center.

[0090] Figure 3 and Figure 4 Schematic diagram of two processing flows of data processing requests provided by the embodiment of the present disclosure. Figure 3As shown, data center D1 corresponds to server S1 and gateway G1, data center D2 corresponds to server S2 and gateway G2, and data center D3 corresponds to server S3 and gateway G3.

[0091] Reference Figure 3 As shown, when gateway G1 receives data processing request R1, G1 is the first gateway. If G1 determines that R1's first data center is D1, then D1's server S1 is the first server. Therefore, G1 can send R1 to S1 for processing.

[0092] Reference Figure 4 As shown, when gateway G1 receives data processing request R2, G1 becomes the primary gateway. If G1 determines that R2's primary data center is D2, then D2's server S2 becomes the secondary server. Therefore, G1 can send R2 to G2, which in turn sends R2 to S2 for processing.

[0093] Similarly, when data center D2 or D3 receives a data processing request, D2 or D3 is the first gateway, and determines the first data center according to the above process to forward the data processing request based on whether the first data center is the data center corresponding to the first gateway. The forwarding process is the same as the above process. Figure 3 and Figure 4 The process shown is similar and will not be described again in detail in the embodiment of the present disclosure.

[0094] Figure 5 and Figure 6 Schematic diagrams of two layouts of a gateway of a data center provided by the embodiment of the present disclosure. Figure 5 As shown, a data center is configured with: an application programming interface (API) layer, a server, and a data system.

[0095] Among them, the application interface layer is used to receive data processing requests and forward them to the server. The server is used to process the data in the data system according to the data processing request. The data system can be understood as a database.

[0096] Reference Figure 5 As shown, the above gateway can be an API in the API layer in the data center, refer to Figure 6 As shown, the above-mentioned gateway can also be a service mounted on the server.

[0097] When a gateway is a service mounted on a server, and if the first data center is the data center corresponding to the first gateway, then the first gateway is a service mounted on the server of the first data center, referred to as the first service. Thus, the process of the first gateway sending a data processing request to the first server for processing can be described as the first service sending the data processing request to the first server corresponding to the first service. Both the first gateway and the first server belong to the first data center.

[0098] When a gateway is a service mounted on a server, if the first data center is not the data center corresponding to the first gateway, then the first gateway is a service mounted on the server of the second data center and can be called the first service. The second gateway is a service mounted on the server of the first data center and can be called the second service. The second data center is a data center other than the first data center. Therefore, the first gateway can send a data processing request to the second server for processing through the second gateway. This can be the process of the first service sending the data processing request to the second service, and the second service sending the data processing request to the second server corresponding to the second service for processing. The second gateway and the second server both belong to the first data center.

[0099] When a gateway is an API in the API layer of a data center, and if the first data center is the data center corresponding to the first gateway, then the first gateway is an API in the API layer of the first data center, referred to as the first API. Thus, the process of the first gateway sending a data processing request to the first server for processing can be described as the first API sending a data processing request to the first server corresponding to the first API for processing. Both the first gateway and the first server belong to the first data center.

[0100] When a gateway is an API in the API layer of a data center, and if the first data center is not the data center corresponding to the first gateway, then the first gateway is an API in the API layer of the second data center, and the second gateway is an API in the API layer of the first data center, and the second data center is a data center other than the first data center. Thus, the first gateway can send a data processing request to the second server for processing via the second gateway. This can mean that the first API sends the data processing request to the second API, and the second API sends the data processing request to the second server corresponding to the second API for processing. Both the second gateway and the second server belong to the first data center.

[0101] It is understandable that gateways can be set up at the API layer and the server at the same time, so that when the API layer can determine the target area, since the first data center can be determined, the data processing request can be sent to the first data center through the API. If the API layer cannot determine the target area, since the first data center cannot be determined, the API needs to first send the data processing request to its corresponding server, so that the server can determine the target area and the first data center, and send the data processing request to the second gateway of the second server, and the second gateway sends the data processing request to the first data center. In this way, the embodiment of the present disclosure can realize the forwarding of data processing requests in a variety of ways, which helps to improve the forwarding success rate of data processing requests, and thereby improve the processing success rate of data processing requests.

[0102] Corresponding to the request processing method of the above embodiment, Figure 7 This is a structural block diagram of a request processing device provided by an embodiment of the present disclosure, which is applied to a first gateway. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 7 The request processing device 200 includes: a data processing request receiving module 201, a target area determination module 202, a data center determination module 203 and a data processing module 204.

[0103] The data processing request receiving module 201 is used to receive a data processing request, and the data processing request is used to process an order.

[0104] The target area determination module 202 is used to determine the target area corresponding to the purchaser of the order.

[0105] The data center determination module 203 is used to select the primary data center corresponding to the target area from the preset configuration information as the first data center for processing the data processing request. The preset configuration information includes the primary data center corresponding to at least one area.

[0106] The data processing module 204 is configured to send the data processing request to the first data center for processing.

[0107] Optionally, the data processing module 204 is further configured to:

[0108] When the data processing request is sent to the first data center for processing, if the first data center is the data center corresponding to the first gateway, the data processing request is sent to the first server for processing, and the first server is the server of the first data center.

[0109] If the first data center is not the data center corresponding to the first gateway, the data processing request is sent to the second server for processing through the second gateway. The second gateway is the server of the first data center, and the second server is the server of the first data center.

[0110] Optionally, when the first data center is the data center corresponding to the first gateway, the first gateway is a service mounted on a server side of the first data center.

[0111] When the first data center is not the data center corresponding to the first gateway, the first gateway is a service mounted on the server side of the second data center, the second gateway is a service mounted on the server side of the first data center, and the second data center is a data center outside the first data center.

[0112] Optionally, when the first data center is the data center corresponding to the first gateway, the first gateway is an API in an application program interface API layer of the first data center.

[0113] When the first data center is not the data center corresponding to the first gateway, the first gateway is an API in the API layer of the second data center, the second gateway is an API in the API layer of the first data center, and the second data center is a data center outside the first data center.

[0114] Optionally, the data processing module 204 is further configured to:

[0115] If the data processing request is a data write request or a data read request carrying a real-time identifier as a first identifier, the data processing request is sent to the first data center for processing. The data write request is used to perform at least one of the following processing on the order: adding data, deleting data, and modifying data.

[0116] Optionally, the device further comprises:

[0117] The second data processing module is used to process the data reading request through a second data center if the data processing request is a data reading request and the real-time identifier carried by the data reading request is a second identifier. The second data center is a data center other than the first data center.

[0118] Optionally, the device further comprises:

[0119] The configuration information modification module is used to modify the preset configuration information.

[0120] The stop processing module is used to stop processing the data processing request of the area corresponding to the primary data center being modified in the preset configuration information during the process of modifying the preset configuration information.

[0121] Optionally, the data processing request includes the target area, and the target area determination module 202 is further configured to:

[0122] The target area is extracted from a target field of the data processing request.

[0123] Optionally, the data processing request includes domain name information of a device that submits the data processing request, and the target area determination module 202 is further configured to:

[0124] The domain name information is parsed to obtain the target area corresponding to the purchaser of the order.

[0125] Optionally, the data processing request includes the identity information of the purchaser, and the target area determination module 202 is further configured to:

[0126] The area corresponding to the identity information is obtained from the registration information as the target area corresponding to the purchaser of the order, and the registration information includes the attribution area where the identity information of at least one purchaser is registered.

[0127] The request processing device provided in this embodiment can be used to execute the above Figure 2 The technical solution of the method embodiment shown has similar implementation principles and technical effects, and will not be repeated here in this embodiment.

[0128] Figure 8 6 is a structural block diagram of an electronic device 600 provided by an embodiment of the present disclosure. The electronic device 600 includes a memory 602 and at least one processor 601.

[0129] The memory 602 stores computer-executable instructions.

[0130] At least one processor 601 executes the computer execution instructions stored in the memory 602, so that the electronic device 601 implements the aforementioned Figure 2 The method in .

[0131] In addition, the electronic device may further include a receiver 603 and a transmitter 604. The receiver 603 is configured to receive information from other devices or equipment and forward it to the processor 601. The transmitter 604 is configured to send the information to the other devices or equipment.

[0132] In a first example of the first aspect, an embodiment of the present disclosure provides a request processing method, applied to a first gateway, the method including:

[0133] receiving a data processing request for processing an order;

[0134] Determining the target area corresponding to the purchaser of the order;

[0135] Selecting a primary data center corresponding to the target area from preset configuration information as a first data center for processing the data processing request, the preset configuration information including at least one primary data center corresponding to each area;

[0136] The data processing request is sent to the first data center for processing.

[0137] Based on the first example of the first aspect, in the second example of the first aspect, sending the data processing request to the first data center for processing includes:

[0138] If the first data center is the data center corresponding to the first gateway, sending the data processing request to a first server for processing, where the first server is a server of the first data center;

[0139] If the first data center is not the data center corresponding to the first gateway, the data processing request is sent to the second server for processing through the second gateway. The second gateway is the server of the first data center, and the second server is the server of the first data center.

[0140] Based on the second example of the first aspect, in the third example of the first aspect, when the first data center is a data center corresponding to the first gateway, the first gateway is a service mounted on a server of the first data center;

[0141] When the first data center is not the data center corresponding to the first gateway, the first gateway is a service mounted on the server side of the second data center, the second gateway is a service mounted on the server side of the first data center, and the second data center is a data center outside the first data center.

[0142] Based on the second example of the first aspect, in the fourth example of the first aspect, when the first data center is a data center corresponding to the first gateway, the first gateway is an API in an application program interface API layer of the first data center;

[0143] When the first data center is not the data center corresponding to the first gateway, the first gateway is an API in the API layer of the second data center, the second gateway is an API in the API layer of the first data center, and the second data center is a data center outside the first data center.

[0144] Based on any one of the first to fourth examples of the first aspect, in a fifth example of the first aspect, sending the data processing request to the first data center for processing includes:

[0145] If the data processing request is a data write request or a data read request carrying a real-time identifier as a first identifier, the data processing request is sent to the first data center for processing. The data write request is used to perform at least one of the following processing on the order: adding data, deleting data, and modifying data.

[0146] Based on the fifth example of the first aspect, in a sixth example of the first aspect, the method further includes:

[0147] If the data processing request is a data read request, and the real-time identifier carried by the data read request is a second identifier, the data read request is processed by a second data center, which is a data center other than the first data center.

[0148] Based on any one of the first to fourth examples of the first aspect, in a seventh example of the first aspect, the further comprising:

[0149] Modifying the preset configuration information;

[0150] During the process of modifying the preset configuration information, processing of data processing requests for the area corresponding to the primary data center being modified in the preset configuration information is stopped.

[0151] Based on any one of the first to fourth examples of the first aspect, in an eighth example of the first aspect, the data processing request includes the target area, and determining the target area corresponding to the purchaser of the order includes:

[0152] The target area is extracted from a target field of the data processing request.

[0153] Based on any one of the first to fourth examples of the first aspect, in a ninth example of the first aspect, the data processing request includes domain name information of a device submitting the data processing request, and determining the target region corresponding to the purchaser of the order includes:

[0154] The domain name information is parsed to obtain the target area corresponding to the purchaser of the order.

[0155] Based on any one of the first to fourth examples of the first aspect, in a tenth example of the first aspect, the data processing request includes identity information of the purchaser, and determining the target area corresponding to the purchaser of the order includes:

[0156] The area corresponding to the identity information is obtained from the registration information as the target area corresponding to the purchaser of the order, and the registration information includes the attribution area where the identity information of at least one purchaser is registered.

[0157] In a first example of the second aspect, a request processing device is provided, applied to a first gateway, the device including:

[0158] A data processing request receiving module, configured to receive a data processing request for processing an order;

[0159] A target area determination module, used to determine the target area corresponding to the purchaser of the order;

[0160] a data center determining module, configured to select a primary data center corresponding to the target area from preset configuration information as a first data center for processing the data processing request, the preset configuration information including a primary data center corresponding to at least one area;

[0161] The data processing module is used to send the data processing request to the first data center for processing.

[0162] Based on the first example of the second aspect, in a second example of the second aspect, the data processing module is further configured to:

[0163] When sending the data processing request to the first data center for processing, if the first data center is the data center corresponding to the first gateway, the data processing request is sent to a first server for processing, and the first server is a server of the first data center;

[0164] If the first data center is not the data center corresponding to the first gateway, the data processing request is sent to the second server for processing through the second gateway. The second gateway is the server of the first data center, and the second server is the server of the first data center.

[0165] Based on the second example of the second aspect, in the third example of the second aspect, when the first data center is the data center corresponding to the first gateway, the first gateway is a service mounted on a server of the first data center;

[0166] When the first data center is not the data center corresponding to the first gateway, the first gateway is a service mounted on the server side of the second data center, the second gateway is a service mounted on the server side of the first data center, and the second data center is a data center outside the first data center.

[0167] Based on the second example of the second aspect, in the fourth example of the second aspect, when the first data center is a data center corresponding to the first gateway, the first gateway is an API in an application program interface API layer of the first data center;

[0168] When the first data center is not the data center corresponding to the first gateway, the first gateway is an API in the API layer of the second data center, the second gateway is an API in the API layer of the first data center, and the second data center is a data center outside the first data center.

[0169] Based on any one of the first to fourth examples of the second aspect, in a fifth example of the second aspect, the data processing module is further configured to:

[0170] If the data processing request is a data write request or a data read request carrying a real-time identifier as a first identifier, the data processing request is sent to the first data center for processing. The data write request is used to perform at least one of the following processing on the order: adding data, deleting data, and modifying data.

[0171] Based on the fifth example of the second aspect, in a sixth example of the second aspect, the apparatus further includes:

[0172] The second data processing module is used to process the data reading request through a second data center if the data processing request is a data reading request and the real-time identifier carried by the data reading request is a second identifier. The second data center is a data center other than the first data center.

[0173] Based on any one of the first to fourth examples of the second aspect, in a seventh example of the second aspect, the apparatus further includes:

[0174] A configuration information modification module, used to modify the preset configuration information;

[0175] The stop processing module is used to stop processing the data processing request of the area corresponding to the primary data center being modified in the preset configuration information during the process of modifying the preset configuration information.

[0176] Based on any one of the first to fourth examples of the second aspect, in an eighth example of the second aspect, the data processing request includes the target area, and the target area determination module is further configured to:

[0177] The target area is extracted from a target field of the data processing request.

[0178] Based on any one of the first to fourth examples of the second aspect, in a ninth example of the second aspect, the data processing request includes domain name information of a device submitting the data processing request, and the target area determination module is further configured to:

[0179] The domain name information is parsed to obtain the target area corresponding to the purchaser of the order.

[0180] Based on any one of the first to fourth examples of the second aspect, in a tenth example of the second aspect, the data processing request includes the identity information of the purchaser, and the target area determination module is further configured to:

[0181] The area corresponding to the identity information is obtained from the registration information as the target area corresponding to the purchaser of the order, and the registration information includes the attribution area where the identity information of at least one purchaser is registered.

[0182] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor and a memory;

[0183] The memory stores computer-executable instructions;

[0184] The at least one processor executes the computer-executable instructions stored in the memory, so that the electronic device implements the method according to any one of the first aspects.

[0185] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, the computing device implements the method described in any one of the first aspects.

[0186] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program is provided, wherein the computer program is used to implement the method described in any one of the first aspects.

[0187] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

[0188] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0189] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. A request processing method, characterized in that: Applied to a first gateway, the method includes: receiving a data processing request, the data processing request being used to process an order, the data processing request being initiated by a buyer or a seller; Determine the target area corresponding to the purchaser of the order, where the target area is the area where the purchaser is currently located or the area where the purchaser is registered; Selecting a primary data center corresponding to the target area from preset configuration information as a first data center for processing the data processing request, the preset configuration information including at least one primary data center corresponding to each area; Sending the data processing request to the first data center for processing, so that the first data center synchronizes the data of the data processing request to the second data center; The sending the data processing request to the first data center for processing includes: If the first data center is the data center corresponding to the first gateway, sending the data processing request to a first server for processing, where the first server is a server of the first data center; If the first data center is not the data center corresponding to the first gateway, the data processing request is sent to the second server for processing through the second gateway. The second gateway is the server of the first data center, and the second server is the server of the first data center.

2. The method according to claim 1, characterized in that When the first data center is the data center corresponding to the first gateway, the first gateway is a service mounted on a server of the first data center; When the first data center is not the data center corresponding to the first gateway, the first gateway is a service mounted on the server side of the second data center, the second gateway is a service mounted on the server side of the first data center, and the second data center is a data center outside the first data center.

3. The method according to claim 1, characterized in that When the first data center is the data center corresponding to the first gateway, the first gateway is an API in the application program interface API layer of the first data center; When the first data center is not the data center corresponding to the first gateway, the first gateway is an API in the API layer of the second data center, the second gateway is an API in the API layer of the first data center, and the second data center is a data center outside the first data center.

4. The method according to any one of claims 1 to 3, characterized in that The sending the data processing request to the first data center for processing includes: If the data processing request is a data write request or a data read request carrying a real-time identifier as a first identifier, the data processing request is sent to the first data center for processing. The data write request is used to perform at least one of the following processing on the order: adding data, deleting data, and modifying data.

5. The method according to claim 4, characterized in that The method further comprises: If the data processing request is a data read request, and the real-time identifier carried by the data read request is a second identifier, the data read request is processed by a second data center, which is a data center other than the first data center.

6. The method according to any one of claims 1 to 3, characterized in that Also includes: Modifying the preset configuration information; During the process of modifying the preset configuration information, processing of data processing requests for the area corresponding to the primary data center being modified in the preset configuration information is stopped.

7. The method according to any one of claims 1 to 3, characterized in that The data processing request includes the target area, and determining the target area corresponding to the purchaser of the order includes: The target area is extracted from a target field of the data processing request.

8. The method according to any one of claims 1 to 3, characterized in that The data processing request includes domain name information of a device that submits the data processing request, and determining the target region corresponding to the purchaser of the order includes: The domain name information is parsed to obtain the target area corresponding to the purchaser of the order.

9. The method according to any one of claims 1 to 3, characterized in that The data processing request includes the identity information of the purchaser, and determining the target area corresponding to the purchaser of the order includes: The area corresponding to the identity information is obtained from the registration information as the target area corresponding to the purchaser of the order, and the registration information includes the attribution area where the identity information of at least one purchaser is registered.

10. A request processing device, characterized in that: Applied to a first gateway, the device includes: a data processing request receiving module, configured to receive a data processing request for processing an order, the data processing request being initiated by the buyer or the seller; A target area determination module, configured to determine a target area corresponding to the purchaser of the order, wherein the target area is the area where the purchaser is currently located or the area where the purchaser is registered; a data center determining module, configured to select a primary data center corresponding to the target area from preset configuration information as a first data center for processing the data processing request, the preset configuration information including a primary data center corresponding to at least one area; A data processing module, configured to send the data processing request to the first data center for processing, so that the first data center synchronizes the data of the data processing request to the second data center; The data processing module is further configured to: If the first data center is the data center corresponding to the first gateway, sending the data processing request to a first server for processing, where the first server is a server of the first data center; If the first data center is not the data center corresponding to the first gateway, the data processing request is sent to the second server for processing through the second gateway. The second gateway is the server of the first data center, and the second server is the server of the first data center.

11. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the electronic device implements the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, the computing device implements the method according to any one of claims 1 to 9.

13. A computer program, characterized in that The computer program is used to implement the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Nationwide city smart-card interconnection and intercommunication system and method utilizing same

    CN102831499A