Service request processing method and device, storage medium and program product

By maintaining the correspondence between the identification information and the unit and adjusting the weights and dynamically adjusting the load balancing, the problem of load imbalance in the prior art is solved, and the regulation efficiency and system stability are improved.

CN119045982APending Publication Date: 2024-11-29PICC LIFE INSURANCE CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410832664.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

Due to the uncertainty of business expansion in the prior art, it is impossible to accurately predict the business scale and required hardware resources associated with each service request, resulting in unbalanced load and low regulation efficiency. It can only be solved through data migration or expansion. limitation.

Method used

By maintaining the correspondence between the identification information and the unit, adjusting the weight according to the preset algorithm and load balancing conditions, dynamically adjusting the load balancing to ensure that the business request is accurately positioned to the target unit for processing, and avoiding load imbalance.

Benefits of technology

It improves the regulation efficiency and convenience of load balancing, avoids serious load imbalance, and enhances the stability of the system and business processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119045982A_ABST
    Figure CN119045982A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a service request processing method and device, a storage medium and a program product, and the method comprises the steps: obtaining a to-be-processed target service request, the target service request comprises uniquely corresponding first identification information, if the first identification information exists in the corresponding relation, determining a first target unit from the corresponding relation, and sending the first target unit to a server; and if the first identification information uniquely corresponding to the target service request does not exist, determining a second target unit from the plurality of units according to a preset algorithm and the weights allocated to the plurality of units, and allocating the target service request to the second target unit for processing, and adding the corresponding relationship between the first identification information and the second target unit into the corresponding relationship, wherein the weight is related to the load balancing condition of the plurality of units. According to the method provided by the embodiment of the invention, the load balance can be dynamically adjusted, the adjustment efficiency and convenience of the load balance are improved, and serious load imbalance is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of distributed technology, and in particular, to a service request processing method, device, storage medium, and program product. Background Art

[0002] The unitized architecture forms standardized processing units by logically binding some computing resources with some data resources. Ensuring load balancing among units is the key to improving the efficiency of business request processing.

[0003] In the related art, the unique identifier (UID) corresponding to the service request is usually bound to the computer room unit to solve the unit routing problem, that is, to determine which unit is to process the service request.

[0004] However, in the process of implementing this application, the inventors found that there are at least the following problems in the prior art: due to the uncertainty of business expansion in the above method, it is impossible to accurately predict the business scale associated with each UID and the required hardware resources, which is prone to serious load imbalance. After the load imbalance occurs, it can only be solved by data migration or capacity expansion, and the adjustment efficiency is low and has certain limitations. Summary of the invention

[0005] The embodiments of the present application provide a service request processing method, device, storage medium and program product to avoid serious load imbalance and improve load regulation efficiency.

[0006] In a first aspect, an embodiment of the present application provides a service request processing method, including:

[0007] Obtaining a target service request to be processed; the target service request includes unique corresponding first identification information;

[0008] If there is first identification information uniquely corresponding to the target service request in the corresponding relationship, determine the first target unit from the corresponding relationship according to the first identification information; dispatch the target service request to the first target unit for processing; the corresponding relationship includes the corresponding relationship between the first identification information and the unit; the unit is a partition unit or a global unit in the unitized architecture;

[0009] If the first identification information uniquely corresponding to the target business request does not exist in the corresponding relationship, the second target unit is determined from the multiple units according to a preset algorithm and weights assigned to the multiple units; the target business request is dispatched to the second target unit for processing; the correspondence between the first identification information and the second target unit is added to the corresponding relationship; the weight is obtained by adjusting according to the load balancing situation of the multiple units.

[0010] In a possible design, before determining the second target unit from the multiple units according to a preset algorithm and weights assigned to the multiple units, the method includes:

[0011] If the weight adjustment conditions are met, the current load balancing status of multiple units is obtained;

[0012] The weights of the multiple units are determined according to the current load balancing situation.

[0013] In a possible design, obtaining the current load balancing status of the multiple units includes:

[0014] Obtaining historical loads of multiple units within a preset period before the current moment;

[0015] Determining the load growth of the plurality of units according to the historical load;

[0016] The current load balancing status of the multiple units is determined according to the load growth status.

[0017] In a possible design, determining the weights of the multiple units according to the current load balancing situation includes:

[0018] Determining the load growth ratio of the plurality of units according to the load growth situation;

[0019] Determining weight ratios of the plurality of units according to the load growth ratio; the weight ratio is inversely correlated with the load growth ratio;

[0020] The weights of the multiple units are determined according to the weight ratios of the multiple units.

[0021] In a possible design, determining the second target unit from the multiple units according to a preset algorithm and weights assigned to the multiple units includes:

[0022] Determine the number of nodes corresponding to each of the multiple units according to the weights assigned to the multiple units; the weights are positively correlated with the number of nodes;

[0023] According to a preset algorithm, taking a modulus of a sum of the numbers of nodes of the plurality of units to obtain a modulus result;

[0024] The unit where the node corresponding to the modulo result is located is determined as the target unit.

[0025] In a possible design, the preset algorithm is a hash algorithm, and taking a modulus of a sum of the numbers of nodes of the multiple units according to the preset algorithm to obtain a modulus result includes:

[0026] Determine a hash value of the first identification information according to a hash function;

[0027] According to the hash value, the total number of nodes of the multiple units is modulo to obtain a modulo result.

[0028] In a possible design, the target service request includes corresponding second identification information; if the first identification information uniquely corresponding to the target service request does not exist in the corresponding relationship, determining the second target unit from the multiple units according to a preset algorithm and weights assigned to the multiple units, includes:

[0029] If the first identification information uniquely corresponding to the target service request does not exist in the corresponding relationship, a gray list is obtained; the gray list includes a corresponding relationship between the second identification information and the gray unit;

[0030] If the second identification information corresponding to the target business request is in the grayscale list, determine the target grayscale unit corresponding to the second identification information corresponding to the target business request from the grayscale list; allocate the target business request to the target grayscale unit for processing; and add the correspondence between the target business request and the target grayscale unit to the correspondence.

[0031] If the second identification information corresponding to the target service request is not in the gray list, a second target unit is determined from the multiple units according to a preset algorithm and weights assigned to the multiple units.

[0032] In a second aspect, an embodiment of the present application provides a service request processing device, including:

[0033] An acquisition module, used to acquire a target service request to be processed; the target service request includes unique corresponding first identification information;

[0034] A first allocation module is used for determining a first target unit from the corresponding relationship according to the first identification information if there is first identification information uniquely corresponding to the target business request in the corresponding relationship; allocating the target business request to the first target unit for processing; the corresponding relationship includes a corresponding relationship between the first identification information and a unit; the unit is a partition unit or a global unit in a unitized architecture;

[0035] A second allocation module is used to determine a second target unit from the multiple units according to a preset algorithm and weights assigned to the multiple units if the first identification information uniquely corresponding to the target business request does not exist in the corresponding relationship; allocate the target business request to the second target unit for processing; add the corresponding relationship between the first identification information and the second target unit to the corresponding relationship; the weight is obtained by adjusting according to the load balancing situation of the multiple units.

[0036] In a third aspect, an embodiment of the present application provides a service request processing device, including: at least one processor and a memory;

[0037] The memory stores computer-executable instructions;

[0038] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the method described in the first aspect and various possible designs of the first aspect.

[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the method described in the first aspect and various possible designs of the first aspect are implemented.

[0040] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the method described in the first aspect and various possible designs of the first aspect.

[0041] The business request processing method, device, storage medium and program product provided in this embodiment include obtaining a target business request to be processed, the target business request includes a unique corresponding first identification information, if there is first identification information uniquely corresponding to the target business request in the corresponding relationship, then according to the first identification information, the first target unit is determined from the corresponding relationship, and the target business request is allocated to the first target unit for processing, the corresponding relationship includes the corresponding relationship between the first identification information and the unit, the unit is a partition unit or a global unit in the unitized architecture, if there is no first identification information uniquely corresponding to the target business request in the corresponding relationship, then according to a preset algorithm and weights assigned to the multiple units, the second target unit is determined from the multiple units, the target business request is allocated to the second target unit for processing, and the corresponding relationship between the first identification information and the second target unit is added to the corresponding relationship, and the weight is related to the load balancing situation of the multiple units. The business request processing method provided in this embodiment, by maintaining the correspondence between identification information and units, can directly and accurately locate the business request whose identification information exists in the correspondence to the target unit for processing the business request by querying the correspondence, and by setting weights according to the load balancing situation and then determining the target unit based on the weights on the basis of a preset algorithm, it can dynamically adjust the load balancing, improve the adjustment efficiency and convenience of the load balancing, and avoid serious load imbalance. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present application 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 application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0043] Figure 1 A schematic diagram of an application scenario of the service request processing method provided in an embodiment of the present application;

[0044] Figure 2 Schematic diagram of the process of processing a service request provided in the embodiment of the present application Figure 1 ;

[0045] Figure 3 A schematic diagram of load balancing based on a dynamic policy deployment mechanism provided in an embodiment of the present application Figure 1 ;

[0046] Figure 4 A schematic diagram of load balancing based on a dynamic policy deployment mechanism provided in an embodiment of the present application Figure 2 ;

[0047] Figure 5Schematic diagram of the process of processing a service request provided in the embodiment of the present application Figure 2 ;

[0048] Figure 6 Schematic diagram of the process of processing a service request provided in the embodiment of the present application Figure 3 ;

[0049] Figure 7 A schematic diagram of the structure of a service request processing device provided in an embodiment of the present application;

[0050] Figure 8 A schematic diagram of the hardware structure of a service request processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0052] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0053] It should be noted that the business request processing method, device, storage medium and program product provided in the present application can be used in the field of distributed technology, and can also be used in any field other than the field of distributed technology. The application field of the business request processing method, device, storage medium and program product provided in the present application is not limited.

[0054] Glossary:

[0055] Region Zone (RZone): A unit is formed by logically binding a part of computing resources and a part of data resources. Each unit has the ability to complete business and a part of the full data.

[0056] Global Zone (GZone): Also known as a replication unit, there is only one copy globally, which is usually deployed redundantly and is usually relied upon by RZone.

[0057] The centralized architecture model is suitable for small application systems, but large business systems, such as insurance core systems, have gradually shown the defects of centralized architecture after years of evolution, such as limited expansion, difficult maintenance, poor business continuity, etc. In order to solve the architectural defects of large and complex systems in the financial industry, various explorations of flexible architectures have emerged, and the unitized architecture is one of them. Under the unitized architecture, ensuring the load balancing of each unit is a key factor in improving business processing efficiency.

[0058] In the related art, the UID corresponding to the service request is usually bound to the computer room unit to solve the unit routing problem, that is, to determine which unit will handle the service request. However, the above method requires accurate prediction of the business scale and hardware resources as the basis for division. However, due to the uncertainty of business expansion, it is impossible to accurately predict the business scale and required hardware resources associated with each UID, and the load imbalance cannot be effectively avoided. When load imbalance occurs, it can only be solved by data migration or capacity expansion, which has certain limitations, poor load balancing adjustment convenience, and low efficiency.

[0059] In order to solve the above technical problems, the inventors of the present application have found that a dynamic adjustment strategy can be adopted to unbind the hard connection between the UID and the computer room unit, and on the basis of adopting a unit routing solution such as a hash algorithm, a weight coefficient is additionally used to intervene in the unit routing. Based on this, an embodiment of the present application provides a service request processing method.

[0060] Figure 1 Schematic diagram of application scenarios of the service request processing method provided in the embodiment of the present application. Figure 1 As shown, the peripheral system 101 is connected to the unit 103 (which may be a partition unit or a global unit in a unitized architecture) of each computer room through a traffic gateway 102 .

[0061] In the specific implementation process, the peripheral system 101 sends the service request to the traffic diversion gateway, and the traffic diversion gateway 102 distributes the service request to the corresponding unit 103 for processing based on the dynamic policy allocation mechanism. Specifically, the target service request to be processed is obtained, and the target service request includes the first identification information that is uniquely corresponding. If there is the first identification information that is uniquely corresponding to the target service request in the corresponding relationship, then according to the first identification information, the first target unit is determined from the corresponding relationship, and the target service request is allocated to the first target unit for processing. The corresponding relationship includes the corresponding relationship between the first identification information and the unit, and the unit is a partition unit or a global unit in the unitized architecture. If there is no first identification information that is uniquely corresponding to the target service request in the corresponding relationship, then according to the preset algorithm and the weights assigned to the multiple units, the second target unit is determined from the multiple units, and the target service request is allocated to the second target unit for processing. The corresponding relationship between the first identification information and the second target unit is added to the corresponding relationship, and the weight is related to the load balancing of the multiple units. The business request processing method provided in this embodiment, by maintaining the correspondence between identification information and units, can directly and accurately locate the business request whose identification information exists in the correspondence to the target unit for processing the business request by querying the correspondence, and by setting weights according to the load balancing situation and then determining the target unit based on the weights on the basis of a preset algorithm, it can dynamically adjust the load balancing, improve the adjustment efficiency and convenience of the load balancing, and avoid serious load imbalance.

[0062] It should be noted that Figure 1 The scenario diagram shown is only an example. The business request processing method and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. Ordinary technicians in this field can know that with the evolution of the system and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.

[0063] The technical solution of the present application is described in detail with specific embodiments below. 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.

[0064] Figure 2 Schematic diagram of the process of processing a service request provided in the embodiment of the present application Figure 1 .like Figure 2 As shown, the method includes:

[0065] 201. Obtain a target service request to be processed; the target service request includes unique corresponding first identification information.

[0066] The execution subject of this embodiment may be a terminal device or a server. Figure 1 The traffic gateway in .

[0067] In this embodiment, the target business request is a request to call the microservices provided by multiple partition units provided by each computer room in the unitized architecture. Large-scale monolithic systems use evolution and new construction methods to split microservices and differentiate into multiple business microservice middle platforms. The following first describes the unitized deployment scheme on which the present invention is based. Active-active computer rooms, the first computer room and the second computer room, can be deployed in the unitized architecture. The first computer room A is designed with N+1 units, namely RZone01A, RZone02A, RZoneNA and GZone, and the second computer room B is designed with N+1 units, namely RZone01B, RZone02B, RZoneNB and GZone, and RZoneXA and RZoneXB deploy the same data.

[0068] Multiple microservice systems belong to RZone or GZone according to data volume and service characteristics. For example: Microservice Q has a large amount of data and no cross-service requests, so it belongs to RZone; Microservice B has a large amount of data and belongs to RZone; Microservices H and L have a small amount of data and are dependent on B in RZone, so they belong to GZone; Microservices Z1 and Z2 have very small amounts of data and serve other microservices, often requiring cross-unit requests, so they belong to GZone.

[0069] The load balancing in this embodiment refers to the load balancing between multiple partition units or global units with the same microservice, such as RZone01A in the first computer room A and RZone01B in the second computer room B.

[0070] 202. If there is first identification information that uniquely corresponds to the target business request in the corresponding relationship, determine the first target unit from the corresponding relationship based on the first identification information; allocate the target business request to the first target unit for processing; the corresponding relationship includes the corresponding relationship between the first identification information and the unit; the unit is a partition unit or a global unit in the unitized architecture.

[0071] In this embodiment, the first target unit includes room information and unit information, such as Rzone01 of the first room A. The target service request is dispatched to the first target unit for processing, which may be a read process or an update process.

[0072] Specifically, for precise addressing and fine management, the correspondence between the first identification information and the unit can be maintained, and the correspondence can be set in the form of a KV table. The method of maintaining the KV table is hereinafter referred to as the KV policy. The KV policy has the highest priority. Business requests usually include read requests, update requests, and write requests. Among them, read requests and update requests are for processing business data that have been written. Usually, the first identification information of the business request has been recorded in the KV table, so it will be hit by K, and the target computer room and unit can be accurately obtained; and the write request is usually not hit by KV because it is processed for the first time, then the target computer room and unit can be obtained through the following dynamic policy deployment mechanism.

[0073] 203. If the first identification information uniquely corresponding to the target business request does not exist in the corresponding relationship, the second target unit is determined from the multiple units according to a preset algorithm and weights assigned to the multiple units; the target business request is dispatched to the second target unit for processing; the corresponding relationship between the first identification information and the second target unit is added to the corresponding relationship; the weight is obtained by adjusting according to the load balancing situation of the multiple units.

[0074] In this embodiment, the target service request is dispatched to the second target unit for processing, which may be write processing.

[0075] Specifically, this embodiment proposes a dynamic allocation method based on the conventional unit routing method (such as the unit routing method based on the hash algorithm) to form a dynamic strategy, routes each business request to the computer room and unit, and adds the unit routing result to the KV table to maintain the KV table, so that subsequent read requests and update requests can be queried from the KV table to obtain the accurate address.

[0076] In some embodiments, considering that load imbalance is a relatively slow process, there is no need to make real-time adjustments for each business request. The weight adjustment can set a weight adjustment condition, and the weight adjustment is performed when the weight adjustment condition is met. Specifically, before determining the second target unit from the multiple units according to the preset algorithm and the weights assigned to the multiple units, it can include: if the weight adjustment condition is met, the current load balancing situation of the multiple units is obtained; the weight adjustment condition is at least one of the following: receiving an adjustment instruction input by the user, detecting that there is a unit with a load greater than a preset threshold, and the total time since the last weight adjustment reaches a preset period; determining the weights of the multiple units according to the current load balancing situation.

[0077] In this embodiment, the three conditions of receiving the adjustment instruction input by the user, detecting the existence of a unit with a load greater than a preset threshold, and the total time since the last weight adjustment reaching a preset period can be set to only meet one condition to determine that the weight adjustment condition is met, and can also be set to meet multiple conditions to determine that the weight adjustment condition is met. The specific setting can be based on actual needs, and this embodiment does not limit this.

[0078] Specifically, based on real-time monitoring and historical statistics, the load balancing of each computer room and unit is analyzed, and weights are assigned to each computer room unit based on this. Units with overload risks are assigned small weights, or dynamically adjusted according to other actual needs. After obtaining the target computer room and target unit corresponding to the business request through the dynamic strategy, the corresponding relationship is written into the KV table.

[0079] In some embodiments, obtaining the current load balancing status of multiple units may include: obtaining the historical load of the multiple units within a preset time period before the current moment; determining the load growth status of the multiple units based on the historical load; and determining the current load balancing status of the multiple units based on the load growth status.

[0080] Specifically, the current time refers to the time when the weight is adjusted. The preset period may be the period between the time when the weight was last adjusted and the time when the weight is currently adjusted.

[0081] In some embodiments, determining the weights of the multiple units based on the current load balancing situation may include: determining the load growth ratio of the multiple units based on the load growth situation; determining the weight ratio of the multiple units based on the load growth ratio; the weight ratio is inversely correlated with the load growth ratio; and determining the weights of the multiple units based on the weight ratio of the multiple units.

[0082] In this embodiment, the weight ratio is inversely correlated with the load growth ratio, which means that the greater the load growth of the unit, the smaller the allocated weight will be.

[0083] For example, to simplify the description, the global unit, backup unit, and gray unit are ignored, and only the partition units RZone01 and RZone02 are divided. RZone01 is deployed in computer room A, and RZone02 is deployed in computer room B.

[0084] Time node 1:

[0085] The hardware resources of the two computer rooms are configured in the same way and are allocated using a hash algorithm. RZone01 and RZone02 of the two computer rooms bear a considerable amount of business traffic. Figure 3 As shown, RZone01 and RZone02 each bear 50% of the load.

[0086] Time Node 2:

[0087] After a period of time, it is found through monitoring that the data volume of RZone02 grows significantly faster than that of RZone01, and has not reached the threshold that requires expansion. You can use the method of adding weights, such as Figure 4 As shown, based on the preset algorithms such as the hash algorithm, RZone01 is assigned a weight of 0.8 and RZone02 is assigned a weight of 0.2. Continue to monitor data growth and adjust the weights when the weight adjustment conditions are met (for example, if the user finds that weight adjustment is required based on actual needs, the user can enter a weight adjustment instruction).

[0088] In some embodiments, determining a second target unit from the multiple units according to a preset algorithm and weights assigned to the multiple units may include: determining the number of nodes corresponding to the multiple units respectively according to the weights assigned to the multiple units; the weights and the number of nodes are positively correlated; according to the preset algorithm, taking the modulus of the sum of the number of nodes of the multiple units to obtain a modulo result; and determining the unit where the node corresponding to the modulo result is located as the target unit.

[0089] In some embodiments, the preset algorithm is a hash algorithm, and taking the modulus of the sum of the number of nodes of the multiple units according to the preset algorithm to obtain a modulus result may include: determining the hash value of the first identification information according to a hash function; and taking the modulus of the total number of nodes of the multiple units according to the hash value to obtain a modulus result.

[0090] For example, continue with Figure 3 and Figure 4 For example, Figure 3 As shown in the figure, since the data volume grows similarly, the same weights can be set for the two units, 0.5 and 0.5 respectively. After calculating the ratios of the two (RZone01 is 1 times of RZone02), two nodes node1 and node2 are set, where node1 corresponds to RZone01 and node2 corresponds to RZone02. After receiving the external request, the key fields (such as the policy ID) are read out, the hash value is calculated by the hash function, and then modulo 2 is taken. If the value is 0, node1 is selected, that is, RZone01, and if the value is 1, node2 is selected, that is, RZone02.

[0091] like Figure 4As shown, at this time, the two units are set with different weights, 0.8 and 0.2 respectively. Based on this, after calculating the ratios of the two (RZone01 is 4 times that of RZone02), 5 nodes node1, node2, node3, node4, and node5 are set, where node1, node2, node3, and node4 correspond to RZone01, and node5 corresponds to RZone02. After receiving the external request, the key field (such as the policy ID) is read out, the hash value is calculated by the hash function, and then modulo 5 is taken. If the value is 0, node1 is selected, that is, RZone01. If the value is 1, node2 is selected, that is, RZone01. If the value is 2, node3 is selected, that is, RZone01. If the value is 3, node4 is selected, that is, RZone01. If the value is 4, node5 is selected, that is, RZone02.

[0092] The business request processing method provided in this embodiment, by maintaining the correspondence between identification information and units, can directly and accurately locate the business request whose identification information exists in the correspondence to the target unit for processing the business request by querying the correspondence, and by setting weights according to the load balancing situation and then determining the target unit based on the weights on the basis of a preset algorithm, it can dynamically adjust the load balancing, improve the adjustment efficiency and convenience of the load balancing, and avoid serious load imbalance.

[0093] Figure 5 Schematic diagram of the process of processing a service request provided in the embodiment of the present application Figure 2 .like Figure 5 As shown, based on the above embodiment, for example Figure 2 On the basis of the embodiment shown, this embodiment adds an example description of the grayscale strategy, and the method includes:

[0094] 501. Obtain a target service request to be processed; the target service request includes unique corresponding first identification information.

[0095] 502 . Determine whether there is first identification information uniquely corresponding to the target service request in the corresponding relationship. If so, execute step 503 ; if not, execute step 504 .

[0096] 503. According to the first identification information, determine the first target unit from the corresponding relationship; allocate the target business request to the first target unit for processing; the corresponding relationship includes the corresponding relationship between the first identification information and the unit; the unit is a partition unit or a global unit in the unitized architecture.

[0097] In this embodiment, steps 501 to 503 are similar to steps 201 to 202 in the above embodiment, and are not described again here.

[0098] 504. Obtain a grayscale list; the grayscale list includes a correspondence between the second identification information and the grayscale unit.

[0099] 505 . Determine whether the second identification information corresponding to the target service request is in the gray list. If so, execute step 506 ; if not, execute step 507 .

[0100] 506. Determine the target grayscale unit corresponding to the second identification information corresponding to the target business request from the grayscale list; allocate the target business request to the target grayscale unit for processing; and add the correspondence between the target business request and the target grayscale unit to the correspondence.

[0101] 507. Determine a second target unit from the multiple units according to a preset algorithm and weights assigned to the multiple units.

[0102] Specifically, in actual operations, there may be an algorithm that has been updated, but the risk is high and local experiments are required. In this case, a grayscale strategy can be adopted, that is, the grayscale list mentioned above, to set up a special grayscale unit to execute the algorithm with higher risk, and to assign the business requests in the grayscale list to the grayscale unit. The grayscale strategy has a higher priority than the dynamic strategy. By adjusting the grayscale list, the peripheral requests are distributed to the grayscale unit or distributed to other partition units through the dynamic strategy. First, using the isolation capability of the unit, set a grayscale unit, and use identification information such as customer ID or regional ID as the grayscale dimension to write it into the grayscale list to finely manage the flow direction; before the diversion gateway distributes according to the dynamic strategy, it will first query the grayscale list. If the grayscale list hits, the dynamic strategy is skipped and the corresponding relationship is written into the KV table.

[0103] For example, Figure 6 As shown in the figure, the dynamic strategy allocation mechanism based on KV strategy and grayscale strategy has distribution rules sorted according to the following priorities:

[0104] Determine whether the current K field value is hit by the KV table.

[0105] If the KV table hits, it is distributed to the partition unit pointed to by V.

[0106] If the KV table does not hit, it is distributed according to the grayscale and dynamic strategies.

[0107] Determine whether the current grayscale field value is included in the grayscale list.

[0108] If the grayscale list hits, it is distributed to the target grayscale unit.

[0109] If the gray list does not match, it is distributed according to the dynamic strategy.

[0110] The business request processing method provided in this embodiment, based on the grayscale strategy of the grayscale list, clarifies a grayscale strategy that is actually feasible in the unitized architecture, which can finely manage the risks of operations such as version upgrades, and the KV strategy based on the KV table, clarifies a strategy for precise addressing and fine management of read requests and update requests in the unitized architecture, and a unit dynamic strategy allocation mechanism based on real-time monitoring and historical statistics. This point amplifies the advantages of the unitized architecture, which can flexibly allocate unit loads, predict the timing of expansion, and postpone the expansion deadline, providing convenience for the governance of large-scale business systems. By combining the above three strategies, it can improve system stability, improve business processing efficiency, and ensure load balancing.

[0111] Figure 7 This is a schematic diagram of the structure of the service request processing device provided in the embodiment of the present application. Figure 7 As shown, the service request processing device 70 includes: an acquisition module 701 , a first allocation module 702 and a second allocation module 703 .

[0112] The acquisition module 701 is used to acquire a target service request to be processed; the target service request includes unique corresponding first identification information.

[0113] The first allocation module 702 is used to determine the first target unit from the corresponding relationship based on the first identification information if there is first identification information that uniquely corresponds to the target business request in the corresponding relationship; allocate the target business request to the first target unit for processing; the corresponding relationship includes the corresponding relationship between the first identification information and the unit; the unit is a partition unit or a global unit in the unitized architecture.

[0114] The second allocation module 703 is used to determine the second target unit from the multiple units according to a preset algorithm and weights assigned to the multiple units if the first identification information uniquely corresponding to the target business request does not exist in the corresponding relationship; allocate the target business request to the second target unit for processing; add the corresponding relationship between the first identification information and the second target unit to the corresponding relationship; the weight is obtained by adjusting according to the load balancing situation of the multiple units.

[0115] The business request processing device provided in the embodiment of the present application, by maintaining the correspondence between identification information and units, can directly and accurately locate the business request whose identification information exists in the correspondence to the target unit for processing the business request by querying the correspondence, and by setting weights according to the load balancing situation, and then determining the target unit based on the weights on the basis of a preset algorithm, it can dynamically adjust the load balancing, improve the adjustment efficiency and convenience of the load balancing, and avoid serious load imbalance.

[0116] In some embodiments, the second allocation module 703 is further configured to:

[0117] If the weight adjustment condition is met, the current load balancing status of the multiple units is obtained; the weight adjustment condition is at least one of the following: receiving an adjustment instruction input by a user, detecting that there is a unit with a load greater than a preset threshold, and the total time since the last weight adjustment reaches a preset period;

[0118] The weights of the multiple units are determined according to the current load balancing situation.

[0119] In some embodiments, the second allocation module 703 is specifically used to:

[0120] Obtaining historical loads of multiple units within a preset period before the current moment;

[0121] Determining the load growth of the plurality of units according to the historical load;

[0122] The current load balancing status of the multiple units is determined according to the load growth status.

[0123] In some embodiments, the second allocation module 703 is specifically used to:

[0124] Determining the load growth ratio of the plurality of units according to the load growth situation;

[0125] Determining weight ratios of the plurality of units according to the load growth ratio; the weight ratio is inversely correlated with the load growth ratio;

[0126] The weights of the multiple units are determined according to the weight ratios of the multiple units.

[0127] In some embodiments, the second allocation module 703 is specifically used to:

[0128] Determine the number of nodes corresponding to each of the multiple units according to the weights assigned to the multiple units; the weights are positively correlated with the number of nodes;

[0129] According to a preset algorithm, taking a modulus of a sum of the numbers of nodes of the plurality of units to obtain a modulus result;

[0130] The unit where the node corresponding to the modulo result is located is determined as the target unit.

[0131] In some embodiments, the preset algorithm is a hash algorithm, and the second allocation module 703 is specifically used to: determine the hash value of the first identification information according to the hash function;

[0132] According to the hash value, the total number of nodes of the multiple units is modulo to obtain a modulo result.

[0133] In some embodiments, the target service request includes corresponding second identification information; the second allocation module 703 is specifically used to:

[0134] If the first identification information uniquely corresponding to the target service request does not exist in the corresponding relationship, a gray list is obtained; the gray list includes a corresponding relationship between the second identification information and the gray unit;

[0135] If the second identification information corresponding to the target business request is in the grayscale list, determine the target grayscale unit corresponding to the second identification information corresponding to the target business request from the grayscale list; allocate the target business request to the target grayscale unit for processing; and add the correspondence between the target business request and the target grayscale unit to the correspondence.

[0136] If the second identification information corresponding to the target service request is not in the gray list, a second target unit is determined from the multiple units according to a preset algorithm and weights assigned to the multiple units.

[0137] The service request processing device provided in the embodiment of the present application can be used to execute the above-mentioned method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.

[0138] Figure 8 A schematic diagram of the hardware structure of a business request processing device provided in an embodiment of the present application, which device may be a terminal device, a traffic diversion gateway, a server, etc.

[0139] The device 80 may include one or more of the following components: a processing component 801 , a memory 802 , a power component 803 , a multimedia component 804 , an audio component 805 , an input / output (I / O) interface 806 , a sensor component 807 , and a communication component 808 .

[0140] The processing component 801 generally controls the overall operation of the device 80, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 801 may include one or more processors 809 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 801 may include one or more modules to facilitate the interaction between the processing component 801 and other components. For example, the processing component 801 may include a multimedia module to facilitate the interaction between the multimedia component 804 and the processing component 801.

[0141] The memory 802 is configured to store various types of data to support operations on the device 80. Examples of such data include instructions for any application or method operating on the device 80, contact data, phone book data, messages, pictures, videos, etc. The memory 802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0142] The power supply component 803 provides power to the various components of the device 80. The power supply component 803 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device 80.

[0143] The multimedia component 804 includes a screen that provides an output interface between the device 80 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 804 includes a front camera and / or a rear camera. When the device 80 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0144] The audio component 805 is configured to output and / or input audio signals. For example, the audio component 805 includes a microphone (MIC), and when the device 80 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 802 or sent via the communication component 808. In some embodiments, the audio component 805 also includes a speaker for outputting audio signals.

[0145] I / O interface 806 provides an interface between processing component 801 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0146] The sensor assembly 807 includes one or more sensors for providing various aspects of status assessment for the device 80. For example, the sensor assembly 807 can detect the open / closed state of the device 80, the relative positioning of components, such as the display and keypad of the device 80, and the sensor assembly 807 can also detect the position change of the device 80 or a component of the device 80, the presence or absence of user contact with the device 80, the orientation or acceleration / deceleration of the device 80, and the temperature change of the device 80. The sensor assembly 807 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 807 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 807 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0147] The communication component 808 is configured to facilitate wired or wireless communication between the device 80 and other devices. The device 80 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 808 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 808 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0148] In an exemplary embodiment, the device 80 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0149] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 802 including instructions, and the instructions can be executed by a processor 809 of the device 80 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0150] The computer-readable storage medium mentioned above can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0151] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0152] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0153] An embodiment of the present application further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the service request processing method executed by the service request processing device as described above is implemented.

[0154] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for processing a business request, characterized in that: include: Get the target business request to be processed; The target service request includes unique corresponding first identification information; If there is first identification information uniquely corresponding to the target service request in the corresponding relationship, determine the first target unit from the corresponding relationship according to the first identification information; dispatch the target service request to the first target unit for processing; the corresponding relationship includes the corresponding relationship between the first identification information and the unit; the unit is a partition unit or a global unit in the unitized architecture; If the first identification information uniquely corresponding to the target service request does not exist in the corresponding relationship, determining a second target unit from the multiple units according to a preset algorithm and weights assigned to the multiple units; dispatching the target service request to the second target unit for processing; adding the correspondence between the first identification information and the second target unit to the correspondence; The weight is obtained by adjusting according to the load balancing conditions of the multiple units.

2. The method according to claim 1, characterized in that Before determining the second target unit from the multiple units according to the preset algorithm and the weights assigned to the multiple units, the method includes: If the weight adjustment condition is met, the current load balancing status of the multiple units is obtained; the weight adjustment condition is at least one of the following: receiving an adjustment instruction input by a user, detecting that there is a unit with a load greater than a preset threshold, and the total time since the last weight adjustment reaches a preset period; The weights of the multiple units are determined according to the current load balancing situation.

3. The method according to claim 2, characterized in that The obtaining of the current load balancing status of the multiple units includes: Obtaining historical loads of multiple units within a preset period before the current moment; Determining the load growth of the plurality of units according to the historical load; The current load balancing status of the multiple units is determined according to the load growth status.

4. The method according to claim 2, characterized in that: The determining the weights of the plurality of units according to the current load balancing situation includes: Determining the load growth ratio of the plurality of units according to the load growth situation; Determining weight ratios of the plurality of units according to the load growth ratio; the weight ratio is inversely correlated with the load growth ratio; The weights of the multiple units are determined according to the weight ratios of the multiple units.

5. The method according to claim 1, characterized in that The determining a second target unit from the multiple units according to a preset algorithm and weights assigned to the multiple units comprises: Determine the number of nodes corresponding to each of the multiple units according to the weights assigned to the multiple units; the weights are positively correlated with the number of nodes; According to a preset algorithm, taking a modulus of a sum of the numbers of nodes of the plurality of units to obtain a modulus result; The unit where the node corresponding to the modulo result is located is determined as the target unit.

6. The method according to claim 5, characterized in that The preset algorithm is a hash algorithm, and taking a modulus of the sum of the number of nodes of the plurality of units according to the preset algorithm to obtain a modulus result includes: Determine a hash value of the first identification information according to a hash function; According to the hash value, the total number of nodes of the multiple units is modulo to obtain a modulo result.

7. The method according to any one of claims 1 to 6, characterized in that: The target service request includes corresponding second identification information; if the first identification information uniquely corresponding to the target service request does not exist in the corresponding relationship, determining a second target unit from the multiple units according to a preset algorithm and weights assigned to the multiple units, including: If the first identification information uniquely corresponding to the target service request does not exist in the corresponding relationship, a gray list is obtained; the gray list includes a corresponding relationship between the second identification information and the gray unit; If the second identification information corresponding to the target business request is in the grayscale list, determining the target grayscale unit corresponding to the second identification information corresponding to the target business request from the grayscale list; allocating the target business request to the target grayscale unit for processing; and adding the corresponding relationship between the target business request and the target grayscale unit to the corresponding relationship; If the second identification information corresponding to the target service request is not in the gray list, a second target unit is determined from the multiple units according to a preset algorithm and weights assigned to the multiple units.

8. A service request processing device, characterized in that: include: An acquisition module, used to acquire target business requests to be processed; The target service request includes unique corresponding first identification information; A first allocation module is used for determining a first target unit from the corresponding relationship according to the first identification information if there is first identification information uniquely corresponding to the target business request in the corresponding relationship; allocating the target business request to the first target unit for processing; the corresponding relationship includes a corresponding relationship between the first identification information and a unit; the unit is a partition unit or a global unit in a unitized architecture; A second allocation module, configured to determine a second target unit from the multiple units according to a preset algorithm and weights assigned to the multiple units if the first identification information uniquely corresponding to the target service request does not exist in the corresponding relationship; dispatching the target service request to the second target unit for processing; adding the correspondence between the first identification information and the second target unit to the correspondence; The weight is obtained by adjusting according to the load balancing conditions of the multiple units.

9. A service request processing 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 at least one processor executes the service request processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the service request processing method according to any one of claims 1 to 7 is implemented.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the service request processing method according to any one of claims 1 to 7 is implemented.