Service request processing method, device and storage medium
By allocating business processing channels to business requests and processing them based on resource sharding, and dynamically adjusting the amount of resources in each shard, the queuing effect and insufficient utilization of computing resources caused by ultra-large-scale group requests in existing technologies are solved, achieving efficient business processing and timely response.
Patent Information
- Application Number
- CN202110474589.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-29
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2041-04-29
AI Technical Summary
Existing technologies suffer from queuing effects caused by transaction locking, insufficient utilization of computing resources, and system performance bottlenecks under high concurrency when dealing with business requests from ultra-large-scale groups, thus affecting the processing efficiency of other users.
By allocating corresponding business processing channels to business requests and processing requests based on resource sharding, the amount of resources in resource shards can be dynamically adjusted to achieve balanced utilization and efficient processing of resources.
While ensuring business rules are maintained, queuing effects are reduced, the overall billing processing efficiency of the system is improved, computing power is enhanced, and the timeliness of response for each user in high-concurrency scenarios is ensured.
Smart Images

Figure CN115271279B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software performance optimization technology, and in particular to a method, apparatus and storage medium for processing business requests. Background Art
[0002] The Internet of Things (IoT) is a product of the rapid development of communication and internet technologies. For mobile operators, the rapid development of IoT has led to a rapid expansion in the number of terminals, which has impacted the system's capacity and processing capabilities. Especially after the emergence of the business model of ultra-large cluster shared consumption, the scale of a single group exceeds 500,000, and a single group shares the business volume of a single business pool. Each terminal needs to request business resources from the system when using the service.
[0003] During billing processing, concurrency control is needed for each transaction to prevent errors in results and logical judgments caused by concurrent deductions from more than one user's request. Current concurrency control primarily uses in-memory transaction locks, where other transactions wait until one transaction is completed, ensuring that only one user request is processed at a time.
[0004] However, existing database transaction locking methods have the following limitations when dealing with very large-scale groups:
[0005] 1. Transaction locking leads to a queuing effect, where only one request can be processed at a time, while other requests must wait in a queue, serializing the entire business process. This is inefficient when dealing with massive business requests from very large corporations, and may even fail to meet the timeliness requirements of business processing. It can cause persistent and unmanageable business congestion at specific times or after exceeding a certain volume. Figure 1 The diagram illustrates how business requests are processed in the prior art.
[0006] 2. Single resource processing cannot fully utilize system computing resources. A single business resource pool can only be maintained by a small number of business processing threads. These business processing threads have difficulty fully utilizing the computing resources of the multi-processor cores under the x86 architecture, and will reach the processing efficiency bottleneck due to the exhaustion of the resources of a single processor core, affecting business processing performance.
[0007] 3. The processing efficiency of a single ultra-large group affects the processing efficiency of other groups and users. Under the condition of high concurrency processing without differentiation, the processing of a large number of requests from the same group occupies most of the business processing channels, affecting the processing performance of other requests. Summary of the Invention
[0008] In view of the above-mentioned technical problems existing in the prior art, this application provides a method, apparatus and storage medium for processing business requests.
[0009] Firstly, this application provides a method for processing business requests, including:
[0010] Receive service requests;
[0011] Based on the business scenario corresponding to the business request, a corresponding business processing channel is allocated to the business request;
[0012] The service request is processed based on the resource fragments corresponding to the service processing channel;
[0013] The resource sharding is obtained by splitting the business resources corresponding to the business request.
[0014] Optionally, according to the business request processing method of this application, the resource fragmentation is obtained by splitting the business resources corresponding to the business request, including:
[0015] Based on the number of service requests, the service resource pool corresponding to the service requests is split to obtain the resource shards.
[0016] Optionally, the processing method for the business request according to this application further includes:
[0017] Based on the usage of the aforementioned business resources, the resource quantity of each resource shard is dynamically adjusted.
[0018] Optionally, according to the service request processing method of this application, the step of dynamically adjusting the resource quantity of each resource shard based on the usage of the service resources includes:
[0019] When the usage of the service resources reaches a preset threshold, the remaining service resources are allocated to the first resource shard; the first resource shard is the resource shard that consumes the most resources within a preset time period.
[0020] Optionally, according to the business request processing method of this application, the step of allocating a corresponding business processing channel for the business request based on the business scenario corresponding to the business request includes:
[0021] Determine the business scenario corresponding to the business request;
[0022] Based on the business scenario tags, the business processing channel corresponding to the business request is determined and allocated.
[0023] Optionally, according to the business request processing method of this application, the business scenario includes personal scenario and group scenario.
[0024] Secondly, this application also provides a service request processing apparatus, comprising:
[0025] The receiving module is used to receive business requests;
[0026] The business processing channel allocation module is used to allocate a corresponding business processing channel to the business request based on the business scenario corresponding to the business request.
[0027] The processing module is used to process the service request based on the resource shards corresponding to the service processing channel;
[0028] The resource sharding is obtained by splitting the business resources corresponding to the business request.
[0029] Optionally, according to the service request processing apparatus of this application, the resource fragmentation is obtained by splitting the service resources corresponding to the service request, including:
[0030] Based on the number of service requests, the service resource pool corresponding to the service requests is split to obtain the resource shards.
[0031] Thirdly, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method provided in the first aspect above.
[0032] Fourthly, this application also provides a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method provided in the first aspect above.
[0033] The service request processing method, apparatus, and storage medium provided in this application allocate corresponding service processing channels to the service request based on the service scenario corresponding to the service request, and process the service request based on the resource shards corresponding to the service processing channels. This can reduce queuing effects, enhance the effective application of computing power, and improve the efficiency of the overall billing processing of the system while maximizing the protection of business rules. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 This is a schematic diagram illustrating how business requests are processed in existing technologies.
[0036] Figure 2 This is a flowchart illustrating the processing method for business requests provided in this application;
[0037] Figure 3 This is a schematic diagram illustrating the processing method of the business requests provided in this application;
[0038] Figure 4 This is a schematic diagram illustrating the dynamic resource balancing adjustment method provided in this application;
[0039] Figure 5 This is a schematic diagram of the business processing channel allocation process provided in this application;
[0040] Figure 6 This is a schematic diagram of the structure of the service request processing device provided in this application;
[0041] Figure 7 This is a schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0043] The following is combined Figures 2-7 This application describes the method, apparatus, and storage medium for processing business requests.
[0044] Figure 2 A flowchart illustrating the processing method for the business requests provided in this application, as shown below. Figure 2 As shown, the method includes:
[0045] Step 210: Receive service requests.
[0046] Specifically, the service request is sent by a user terminal, which can be an individual user or a group user. The service request processing device receives the service request and performs subsequent service processing.
[0047] Step 220: Based on the business scenario corresponding to the business request, allocate a corresponding business processing channel for the business request.
[0048] Specifically, to ensure the isolation of business processing between large-scale groups and highly sensitive individual users, the business request processing device performs differentiated processing based on the business scenario to which the business request belongs. The business scenario includes individuals and groups; for ultra-large-scale groups, the business request is routed to a specific business processing channel for processing.
[0049] Step 230: Process the service request based on the resource shards corresponding to the service processing channel;
[0050] The resource sharding is obtained by splitting the business resources corresponding to the business request.
[0051] Specifically, Figure 3 The diagram illustrating the processing method of the business requests provided in this application is as follows: Figure 3 As shown, the service request processing device divides the shared service resource pool into several resource shards. The larger the group, the more resource pool shards there are. The total resource pool can be evenly distributed to the various shards through a preset allocation strategy. Of course, other sharding methods can also be used depending on the application scenario. This application embodiment does not specifically limit this.
[0052] By adding routing capabilities during business request processing, requests are routed to different resource shards based on the different terminals. This achieves a more balanced business processing access and splits the single request path into multiple request paths, thereby improving the overall concurrent processing capability and resource utilization efficiency.
[0053] The method provided in this application allocates a corresponding business processing channel to the business request based on the business scenario corresponding to the business request, and processes the business request based on the resource sharding corresponding to the business processing channel. This method can reduce queuing effects, enhance the effective application of computing power, and improve the overall efficiency of billing processing of the system while maximizing the protection of business rules.
[0054] Based on the above embodiments, the resource sharding is obtained by splitting the business resources corresponding to the business request, including:
[0055] Based on the number of service requests, the service resource pool corresponding to the service requests is split to obtain the resource shards.
[0056] Specifically, such as Figure 3 As shown, the service request processing device can split the service resource pool corresponding to the service request based on the pre-assessed number of service requests to obtain the resource shards, or it can split the service resource pool based on the real-time number of service requests. This application embodiment does not specifically limit this.
[0057] Meanwhile, in order to accelerate application access while maintaining dynamic control over the total amount of resources, a separate total amount of data is established to set the upper limit for business processing applications to quickly obtain the business resources.
[0058] The method provided in this application splits the business resource pool corresponding to the business request based on the number of business requests to obtain the resource shards, which can maximize the concurrent processing capability and resource utilization efficiency.
[0059] Based on the above embodiments, it also includes:
[0060] Based on the usage of the aforementioned business resources, the resource quantity of each resource shard is dynamically adjusted.
[0061] Specifically, due to differences in actual application scenarios and usage time between terminals (e.g., the number of rides per bike in a shared bicycle business varies), the balancing of services across terminals will also result in differences in service usage, and the utilization of different resource shards will also differ. Therefore, it is necessary to ensure balanced consumption of resources across shards to avoid exhausting resources in any single shard.
[0062] Figure 4 This application provides a schematic diagram of the resource dynamic balancing adjustment method, as shown below. Figure 4 As shown, the service request processing device uses resource usage counting to grasp the current total resource usage and total resource quantity, and uses this data as the basis for dynamic resource balancing. Dynamic resource balancing is based on the consumption status (i.e., usage status) of resource fragments to dynamically transfer resources that are used less to those that are used more, ensuring that the resource data of each resource fragment remains close in real time and avoiding the exhaustion of a single fragment.
[0063] The method provided in this application dynamically adjusts the resource quantity of each resource shard based on the usage of the business resources, thereby avoiding the exhaustion of a single shard while ensuring resource utilization efficiency.
[0064] Based on the above embodiments, dynamically adjusting the resource quantity of each resource shard based on the usage of the service resources includes:
[0065] When the usage of the service resources reaches a preset threshold, the remaining service resources are allocated to the first resource shard; the first resource shard is the resource shard that consumes the most resources within a preset time period.
[0066] Specifically, when the processing device for a business request determines that the resources in the entire resource pool are nearing exhaustion, it employs a "most recently consumed" strategy for resource allocation. This means allocating resources to the resource shard that has been consumed the most recently, ensuring that data can be fully consumed. The criterion for determining that resources are nearing exhaustion can be based on a preset threshold for resource usage. If the business resource usage reaches the preset threshold, the remaining business resources are allocated to the first resource shard. The preset threshold can be a usage ratio or other usage metrics; this embodiment does not specifically limit its application. The judgment duration (i.e., the length of the preset time period) corresponding to the "most recently consumed" strategy can be set according to the actual application scenario; this embodiment does not specifically limit its application.
[0067] The method provided in this application allocates the remaining business resources to a first resource segment when the usage of the business resources reaches a preset threshold. The first resource segment is the resource segment that consumes the most resources within a preset time period, which can maximize the resource utilization rate.
[0068] Based on the above embodiments, allocating a corresponding business processing channel for the business request based on the business scenario corresponding to the business request includes:
[0069] Determine the business scenario corresponding to the business request;
[0070] Based on the business scenario tags, the business processing channel corresponding to the business request is determined and allocated.
[0071] Specifically, Figure 5 This is a schematic diagram of the business processing channel allocation process provided in this application, such as... Figure 5 As shown, to further optimize the isolation between large-scale groups and highly sensitive individual users in high-concurrency scenarios, the business request processing device first identifies and distinguishes the business scenario to which the business request belongs. When a business request is identified as belonging to a very large-scale group, the group is automatically added to the target tag library, and the business processing channel is also given a tag attribute. Only business requests with matching tags can be accessed and processed through the corresponding business processing channel. Differential processing is performed based on the tags during business request processing. Based on this, the number of business channels supporting shared resource business requests from very large groups can be limited, thus controlling the concurrent processing capacity of this type of business, while simultaneously ensuring the service response timeliness of individual businesses.
[0072] The method provided in this application, by determining the business scenario corresponding to the business request, and based on the business scenario tag, determining and allocating the business processing channel corresponding to the business request, can control the concurrent processing capability of business requests for shared resources in a large group, while ensuring the service response timeliness of individual businesses.
[0073] Based on the above embodiments, the business scenarios include individual scenarios and group scenarios.
[0074] The corresponding technical effects of this embodiment have been described in the foregoing embodiments and will not be repeated here.
[0075] Based on any of the above embodiments Figure 6 A schematic diagram of the structure of the service request processing device provided in this application is shown below. Figure 6 As shown, the device includes:
[0076] The receiving module 610 is used to receive service requests;
[0077] The service processing channel allocation module 620 is used to allocate a corresponding service processing channel to the service request based on the service scenario corresponding to the service request.
[0078] Processing module 630 is used to process the service request based on the resource fragmentation corresponding to the service processing channel;
[0079] The resource sharding is obtained by splitting the business resources corresponding to the business request.
[0080] Based on the above embodiments, the resource sharding is obtained by splitting the business resources corresponding to the business request, including:
[0081] Based on the number of service requests, the service resource pool corresponding to the service requests is split to obtain the resource shards.
[0082] Based on the above embodiments, it also includes:
[0083] The resource balancing module is used to dynamically adjust the resource amount of each resource shard based on the usage of the business resources.
[0084] Based on the above embodiments, dynamically adjusting the resource quantity of each resource shard based on the usage of the service resources includes:
[0085] When the usage of the service resources reaches a preset threshold, the remaining service resources are allocated to the first resource shard; the first resource shard is the resource shard that consumes the most resources within a preset time period.
[0086] Based on the above embodiments, allocating a corresponding business processing channel for the business request based on the business scenario corresponding to the business request includes:
[0087] Determine the business scenario corresponding to the business request;
[0088] Based on the business scenario tags, the business processing channel corresponding to the business request is determined and allocated.
[0089] Based on the above embodiments, the business scenarios include individual scenarios and group scenarios.
[0090] The service request processing device provided in this application can execute the above-mentioned service request processing method. Its specific working principle and corresponding technical effects are the same as the above-mentioned method, and will not be repeated here.
[0091] Figure 7 An example of a physical structure diagram of an electronic device is shown below. Figure 7 As shown, the electronic device may include a processor 710, a communications interface 720, a memory 730, and a communication bus 740. The processor 710, communications interface 720, and memory 730 communicate with each other via the communication bus 740. The processor 710 can call logical instructions stored in the memory 730 to execute the processing methods for service requests provided by the aforementioned methods.
[0092] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0093] On the other hand, this application also provides a readable storage medium storing a computer program thereon, which, when executed by a processor, implements the processing method for business requests provided by the above methods.
[0094] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0095] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.
[0096] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for processing business requests, characterized in that, include: Receive service requests; Based on the business scenario corresponding to the business request, a corresponding business processing channel is allocated to the business request; The service request is processed based on the resource fragments corresponding to the service processing channel; The resource sharding is obtained by splitting the business resources corresponding to the business request. The method further includes: Based on the usage of the aforementioned business resources, the resource quantity of each of the aforementioned resource shards is dynamically adjusted; The step of dynamically adjusting the resource amount of each resource shard based on the usage of the service resources includes: When the usage of the service resources reaches a preset threshold, the remaining service resources are allocated to the first resource shard; the first resource shard is the resource shard that consumes the most resources within a preset time period. The business scenarios include individual scenarios and group scenarios.
2. The method for processing business requests according to claim 1, characterized in that, The resource sharding is obtained by splitting the business resources corresponding to the business request, including: Based on the number of service requests, the service resource pool corresponding to the service requests is split to obtain the resource shards.
3. The method for processing business requests according to claim 1, characterized in that, The step of allocating a corresponding business processing channel for the business request based on the business scenario corresponding to the business request includes: Determine the business scenario corresponding to the business request; Based on the business scenario tags, the business processing channel corresponding to the business request is determined and allocated.
4. A processing apparatus for business requests, characterized in that, include: The receiving module is used to receive business requests; The business processing channel allocation module is used to allocate a corresponding business processing channel to the business request based on the business scenario corresponding to the business request. The processing module is used to process the service request based on the resource shards corresponding to the service processing channel; The resource sharding is obtained by splitting the business resources corresponding to the business request. The device further includes: Based on the usage of the aforementioned business resources, the resource quantity of each of the aforementioned resource shards is dynamically adjusted; The step of dynamically adjusting the resource amount of each resource shard based on the usage of the service resources includes: When the usage of the service resources reaches a preset threshold, the remaining service resources are allocated to the first resource shard; the first resource shard is the resource shard that consumes the most resources within a preset time period. The business scenarios include individual scenarios and group scenarios.
5. The service request processing apparatus according to claim 4, characterized in that, The resource sharding is obtained by splitting the business resources corresponding to the business request, including: Based on the number of service requests, the service resource pool corresponding to the service requests is split to obtain the resource shards.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the service request processing method as described in any one of claims 1 to 3.
7. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the processing method for the service request as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Method and system for managing resources in cloud computing system
CN103560915A
Service request processing method and device
CN108683692A