Service request processing method and device, electronic equipment and storage medium
By including a variety of business processing algorithms and algorithm diversion strategies in the business request, the backend server directly executes the algorithm diversion strategy to select the target processing algorithm, solving the problem of inefficient processing in the existing technology and achieving more efficient business request processing.
Patent Information
- Application Number
- CN202311685181.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-07
- Publication Date
- 2025-06-10
AI Technical Summary
In the prior art, the backend server needs to judge the processing method of service requests by itself, which leads to the cumbersome and time-consuming judgment process and reduces the processing efficiency of service requests.
By including a variety of business processing algorithms and algorithm shunt strategies in the business request, the backend server directly executes the algorithm shunt strategy to select the target processing algorithm, thereby simplifying the processing process and improving processing efficiency.
It simplifies the background processing process, improves the processing efficiency of business requests, and ensures that the algorithmic diversion strategy is more suitable for the needs of the business side, thereby improving the processing success rate.
Smart Images

Figure CN120122920A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a method, device, electronic device, and storage medium for processing service requests. Background Art
[0002] Generally, when a service terminal at the front end needs to access a service provided by the back end, the service terminal needs to send a service request to the back-end server, and the back-end server processes the service request to implement service processing.
[0003] In the related art, the service request sent by the service terminal at the front end only contains necessary parameter information such as a request type identifier. After the back-end server obtains the service request, it needs to determine the specific processing method of the service request according to the parameter information contained in the service request. Since the judgment process is cumbersome and time-consuming, the processing efficiency of the service request is low and the processing delay is high. Summary of the Invention
[0004] This application provides a method, device, electronic device, and storage medium for processing service requests to improve the processing efficiency of service requests.
[0005] In a first aspect, this application provides a method for processing a service request, including:
[0006] In response to a service request sent by a service terminal, obtaining and parsing the policy configuration information included in the service request, and determining the service processing algorithm and algorithm splitting strategy included in the policy configuration information;
[0007] In the case where the policy configuration information includes at least two service processing algorithms and an algorithm splitting strategy, selecting a target processing algorithm from the at least two service processing algorithms according to the algorithm splitting strategy;
[0008] Processing the service request through the target processing algorithm;
[0009] Wherein, the algorithm splitting strategy is determined by the service terminal according to the service terminal identifier, and the service terminal identifier includes at least one of the following: a scenario class identifier associated with a service scenario, a program class identifier associated with a program type, and a device class identifier associated with a device type.
[0010] In a second aspect, this application provides a device for processing a service request, including:
[0011] A parsing module, configured to obtain and parse the policy configuration information included in the service request in response to a service request sent by a service terminal, and determine the service processing algorithm and algorithm splitting strategy included in the policy configuration information;
[0012] A shunt module, which is used to select a target processing algorithm from at least two service processing algorithms according to the algorithm shunt policy when the policy configuration information includes at least two service processing algorithms and the algorithm shunt policy;
[0013] A processing module, which is used to process the service request through the target processing algorithm;
[0014] Wherein, the algorithm shunt policy is determined by the service end according to the service end identifier, and the service end identifier includes at least one of the following: a scenario class identifier associated with the service scenario, a program class identifier associated with the program type, and a device class identifier associated with the device type.
[0015] In a third aspect, the present application provides an electronic device, which includes: at least one processor; at least one memory; and one or more I / O interfaces connected between the processor and the memory; wherein, the memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor so that the at least one processor can execute the above-mentioned service request processing method.
[0016] In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, wherein the computer program implements the above-mentioned service request processing method when executed by a processor / processing core.
[0017] According to a service request processing method provided by the present application, first, in response to a service request sent by a service end, obtain and parse the policy configuration information included in the service request, and determine the service processing algorithms and the algorithm shunt policy included in the policy configuration information; secondly, when the policy configuration information includes at least two service processing algorithms and the algorithm shunt policy, select a target processing algorithm from the at least two service processing algorithms according to the algorithm shunt policy; finally, process the service request through the target processing algorithm. In this method, the service request sent by the service end simultaneously includes multiple service processing algorithms and an algorithm shunt policy for selecting among the above multiple service processing algorithms. The background only needs to directly execute the algorithm shunt policy in the service request parsing result to determine the target processing algorithm from the multiple service processing algorithms included in the service request, thereby simplifying the background processing process and improving the processing efficiency of the service request. And because the algorithm shunt policy is determined by the service end according to the service end identifier, it can ensure that the algorithm shunt policy included in the service request is more suitable for the own needs of the service end, thereby further improving the processing success rate of the service request.
[0018] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become readily understood through the following description. Description of the Drawings
[0019] The drawings are used to provide a further understanding of the present application and form a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation to the present application. By referring to the drawings to describe the detailed exemplary embodiments, the above and other features and advantages will become more apparent to those skilled in the art. In the drawings:
[0020] Figure 1 It is a flowchart of a method for processing a service request provided by an embodiment of the present application;
[0021] Figure 2 It is a flowchart of an algorithmic diversion strategy for a random diversion type provided by an embodiment of the present application;
[0022] Figure 3 It is a block diagram of a device for processing a service request provided by an embodiment of the present application;
[0023] Figure 4 It is a block diagram of an electronic device provided by an embodiment of the present application. Detailed Embodiments
[0024] To enable those skilled in the art to better understand the technical solutions of the present application, the following provides descriptions of exemplary embodiments of the present application with reference to the drawings. Various details of the embodiments of the present application are included to assist in understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted below.
[0025] Without conflict, the embodiments of the present application and the features in the embodiments can be combined with each other.
[0026] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0027] The terms used in this document are only for describing specific embodiments and are not intended to limit this application. As used herein, the singular forms "a" and "the" are also intended to include the plural forms unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "consisting of" are used in this specification, it specifies the presence of the stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or their groups. Words such as "connected" or "coupled" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0028] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in common dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this application, and will not be interpreted as having an idealized or overly formal meaning unless expressly so defined herein.
[0029] The method for processing a service request according to an embodiment of this application can be executed by an electronic device such as a terminal device or a server. The terminal device can be an in-vehicle device, a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, an in-vehicle device, a wearable device, etc.; the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. Specifically, the method can be implemented by a processor calling a computer program stored in a memory.
[0030] In the related art, the service request sent by the service end at the front end only contains necessary parameter information such as a request type identifier. After the background server obtains the service request, it needs to determine the specific processing method of the service request by itself according to the parameter information contained in the service request. Since the judgment process is cumbersome and time-consuming, the processing efficiency of the service request is low and the processing delay is high. To solve the above problems, this application proposes a method for processing a service request. In this method, the service request sent by the service end simultaneously contains multiple service processing algorithms and an algorithm splitting strategy for selecting among the multiple service processing algorithms. The background only needs to directly execute the algorithm splitting strategy in the service request parsing result to determine the target processing algorithm from the multiple service processing algorithms contained in the service request.
[0031] Figure 1The flowchart of a method for processing a service request provided by an embodiment of the present application. Refer to Figure 1 The method includes:
[0032] Step S110: In response to a service request sent by a service end, obtain and parse the policy configuration information included in the service request, and determine the service processing algorithm and the algorithm shunting policy included in the policy configuration information.
[0033] Among them, the service end refers to the front-end network device that generates the service request. For example, the service end can be the front part of a website, and specifically can include web pages running on browsers such as the PC side and the mobile side and presented to users for browsing. The service request refers to the data information for requesting to execute the corresponding service in response to the operation of the user on the service end. The service request includes instructions, methods for executing the service, and relevant configuration information during the implementation process.
[0034] Among them, for the same type of service requests sent by different service ends in different application scenarios, the background can process the service request through a variety of different service processing algorithms. The service party pre-sets a service processing algorithm that meets the specific requirements in the service request according to the specific requirements of the application scenario where the service request is generated.
[0035] Among them, the algorithm shunting policy refers to the method policy for selecting a target processing algorithm for processing a specific service request generated by the service end from a variety of service processing algorithms. The policy configuration information refers to the data information used to record and transmit the service processing algorithm identifier and the algorithm shunting policy. The policy configuration information is included in the service request and is usually sent from the service front-end to the management background in the form of a JSON string or a JavaScript script.
[0036] In an optional implementation manner, if the policy configuration information is sent in the form of a preset script (such as a JavaScript script), obtaining and parsing the policy configuration information included in the service request includes: obtaining the preset script (such as a JavaScript script) used to record the policy configuration information in the service request, and performing parsing processing on the preset script. Among them, the JavaScript script can be parsed through the ScriptEngineManager class.
[0037] Step S120: When the policy configuration information includes at least two service processing algorithms and the algorithm shunting policy, select a target processing algorithm from at least two service processing algorithms according to the algorithm shunting policy.
[0038] Among them, according to the different requirements of different business parties in different application scenarios, the shunting of the business processing algorithm can be realized in a variety of different ways, that is, the algorithm shunting strategy can be specifically realized in a variety of ways. In an optional implementation manner, the types of the algorithm shunting strategy include: random shunting type, polling shunting type, weighted shunting type, hash shunting type.
[0039] Step S130: Process the service request through the target processing algorithm;
[0040] Among them, the algorithm shunting strategy is determined by the service end according to the service end identifier, and the service end identifier includes at least one of the following: a scenario class identifier associated with the service scenario, a program class identifier associated with the program type, and a device class identifier associated with the device type.
[0041] Among them, the service end determines the corresponding algorithm shunting strategy according to the service end identifier, and then adds the algorithm shunting strategy to the service request to improve the request processing efficiency of the background server. Since the service characteristics of different service end identifiers are different, therefore, the method of customizing the corresponding algorithm shunting strategy according to the service end identifier can ensure that the algorithm shunting strategy better matches the actual service requirements, thereby improving the processing success rate of the service request. In this application, the specific types of the service end identifier can be set flexibly, and this application does not limit the specific types of the service end identifier.
[0042] For example, the scenario class identifier associated with the service scenario is used to represent the specific service scenario, such as payment scenarios, authentication scenarios, data access scenarios, etc. Correspondingly, the service end can flexibly configure different algorithm shunting strategies according to the security requirements of the service scenario and / or the response latency requirements of the service scenario. If the security requirements of the service scenario are relatively high, then preferentially configure an algorithm shunting strategy that can be shunted to a business processing algorithm with higher reliability; if the response latency requirements of the service scenario are relatively high, then preferentially configure an algorithm shunting strategy that can be shunted to a business processing algorithm with lower latency.
[0043] Another example is that the program class identifier associated with the program type is used to represent information such as the program type or program manufacturer of the specific program that sends the service request. Correspondingly, an algorithm shunting strategy for a business processing algorithm with a higher matching degree with the current program type can be preferentially configured. For example, different business processing algorithms correspond to different business manufacturers, and different program types also correspond to different program manufacturers. Correspondingly, an algorithm shunting strategy for the business processing algorithm of the business manufacturer that has a cooperative relationship with the program manufacturer of the current program type can be preferentially configured.
[0044] For another example, the device class identifier associated with the device type is used to characterize the device type and other information of the specific device that sends the service request. Accordingly, the algorithm diversion strategy of the service processing algorithm that has a higher degree of match with the current device can be configured preferentially. For example, by statistically analyzing the processing results of historical service requests, it can be known that the service request sent by the first device has a higher success rate when processed by the first service processing algorithm. Then, the algorithm diversion strategy can be flexibly configured so that the service request sent by the first device can be processed by the first service processing algorithm with a high probability.
[0045] In short, this application does not limit the specific implementation method of how to determine the corresponding algorithm diversion strategy according to the service end identifier, as long as it can ensure that the algorithm diversion strategy is compatible with the service end identifier.
[0046] In an optional implementation, in order to reduce the workload of background configuration, the policy configuration information only includes the calling interface of the business processing algorithm and the algorithm diversion strategy for selecting the target processing algorithm, and does not include the specific implementation code of the business processing algorithm. Then step S130 specifically includes: calling the algorithm calling interface corresponding to the target processing algorithm to call the target processing algorithm to process the business request. Different business processing algorithms correspond to different algorithm calling interfaces, so that multiple business processing algorithms can be flexibly called through the interface to achieve compatibility between multiple business processing algorithms and the management background.
[0047] In summary, according to a method for processing a business request provided by an embodiment of the present application, first, in response to a business request sent by a business end, the policy configuration information contained in the business request is obtained and parsed, and the business processing algorithm and the algorithm diversion strategy contained in the policy configuration information are determined; secondly, when the policy configuration information contains at least two business processing algorithms and the algorithm diversion strategy, the target processing algorithm is selected from at least two business processing algorithms according to the algorithm diversion strategy; finally, the business request is processed by the target processing algorithm. In this method, the business request sent by the business end includes multiple business processing algorithms and the algorithm diversion strategy selected for the above multiple business processing algorithms. The background only needs to directly execute the algorithm diversion strategy in the business request parsing result to determine the target processing algorithm from the multiple business processing algorithms contained in the business request, thereby simplifying the background processing process and improving the processing efficiency of the business request. In addition, since the algorithm diversion strategy is determined by the business end according to the business end identifier, it can ensure that the algorithm diversion strategy contained in the business request is more suitable for the business end's own needs, thereby further improving the processing success rate of the business request.
[0048] In an alternative implementation, after processing the service request through the target processing algorithm, an algorithm splitting strategy for the service request corresponding to the service end identifier is further determined according to the mapping relationship among the request processing result of the service request, the target processing algorithm corresponding to the service request, and the service end identifier corresponding to the service request. Among them, after the service request is processed, the request processing result of the service request (such as a success result or a failure result) can be obtained. Moreover, the target processing algorithm selected during the processing of the service request is known, and the service end identifier corresponding to the service request can also be obtained. Therefore, the mapping relationship among the request processing result of the service request, the target processing algorithm corresponding to the service request, and the service end identifier corresponding to the service request can be determined. According to the mapping relationship among the above three, the target processing algorithm with a higher success rate corresponding to the service end identifier can be determined. Correspondingly, for the service requests sent by the service end corresponding to the same service end identifier, the algorithm splitting strategy for the service request corresponding to the service end identifier can be adjusted according to the mapping relationship among the request processing result of the previous service request, the target processing algorithm corresponding to the service request, and the service end identifier corresponding to the service request, so as to configure the algorithm splitting strategy more reasonably, so that the target processing algorithm with a higher success rate corresponding to the service end identifier has a higher selection probability.
[0049] In an alternative implementation, according to the mapping relationship among the request processing result of the service request, the target processing algorithm corresponding to the service request, and the service end identifier corresponding to the service request, determining the algorithm splitting strategy for the service request corresponding to the service end identifier includes:
[0050] First, obtain the correspondence between the request processing results and the target processing algorithms of multiple processed service requests, where the multiple processed service requests correspond to the same service end identifier.
[0051] Then, determine the processing ability value of each target processing algorithm according to the above correspondence.
[0052] Among them, the processing ability value of each target processing algorithm is used to characterize the processing efficiency of the target processing algorithm in historical service requests, such as processing success rate, processing delay, etc. In short, the processing ability value of each target processing algorithm can be determined according to the processing results of the target processing algorithm in multiple historical service requests.
[0053] Among them, when the difference between the processing capacity values of multiple target processing algorithms does not exceed a preset threshold, it is determined that the algorithm shunting strategy in the service request corresponding to the service end identifier is the first type of shunting strategy; when the difference between the processing capacity values of multiple target processing algorithms exceeds the preset threshold, it is determined that the algorithm shunting strategy in the service request corresponding to the service end identifier is the second type of shunting strategy. Among them, in the first type of shunting strategy, the probabilities of multiple service processing algorithms being selected are approximately equal. Since the difference between the processing capacity values of multiple target processing algorithms does not exceed the preset threshold, it indicates that the processing capacities of multiple target processing algorithms are not very different. At this time, the target processing algorithm is selected through the first type of shunting strategy, thereby increasing the utilization rate of various service processing algorithms and helping to achieve a more balanced shunting effect. In the second type of shunting strategy, the probabilities of multiple service processing algorithms being selected are not equal. Since the difference between the processing capacity values of multiple target processing algorithms exceeds the preset threshold, it indicates that the processing capacities of multiple target processing algorithms are quite different. At this time, the target processing algorithm is selected through the second type of shunting strategy, which helps to increase the utilization rate of the service processing algorithm with higher processing capacity, thereby ensuring a higher processing success rate of the service request.
[0054] Optionally, the request processing result of the above service request includes: a first type of processing result for indicating whether the processing result is successful, and / or a second type of processing result for indicating the processing delay. Correspondingly, the processing capacity value of the target processing algorithm can be determined by the success rate determined by the first type of processing result and / or the delay rate determined by the second type of processing result. And, the types of the first type of shunting strategy include at least one of the following: random shunting type, polling shunting type, and hash shunting type; the type of the second type of shunting strategy includes: weighted shunting type.
[0055] Among them, the algorithm shunting strategies in the above embodiments can be multiple. For example, Figure 2 is a flowchart of the algorithm shunting strategy of the random shunting type provided by the embodiment of the present application. In an optional implementation manner, when the type of the algorithm shunting strategy is the random shunting type, referring to Figure 2 , the shunting method implemented based on the algorithm shunting strategy specifically includes the following steps:
[0056] Step S210: Sort at least two service processing algorithms according to at least two preset service processing algorithms and the preset shunting ratio corresponding to each service processing algorithm.
[0057] Among them, when the type of the algorithm traffic splitting strategy is the random traffic splitting type, the policy configuration information includes at least two service processing algorithms and the preset traffic splitting ratio corresponding to each service processing algorithm. Among them, the preset traffic splitting ratio is pre-configured by the service provider in the policy configuration information of the service request according to the scenario requirements. Those skilled in the art can set it specifically according to the scenario requirements when implementing this embodiment, and no limitation is made here.
[0058] Step S220: According to the result of the sorting process, allocate a corresponding ratio interval for each service processing algorithm; among them, the sum of the interval ranges of the ratio intervals corresponding to each service processing algorithm is the preset total value interval.
[0059] Among them, the result of the sorting process is the result of sorting at least two service processing algorithms according to at least two preset service processing algorithms and the preset traffic splitting ratio corresponding to each service processing algorithm in step S210. In the result of this sorting process, at least two service processing algorithms included in the policy configuration information are arranged in sequence according to the preset order standard. Among them, the preset order standard is specifically set by those skilled in the art according to the scenario requirements when implementing this method, and no limitation is made here. For example, it can be from large to small or from small to large, etc.
[0060] Among them, when the preset order standard is arranged from small to large, the lower limit value of the ratio interval corresponding to the first sequential service processing algorithm (that is, the service processing algorithm with the least corresponding preset traffic splitting ratio) is 0, and the upper limit value of this ratio interval is the preset traffic splitting ratio corresponding to this service processing algorithm. Starting from the second sequential service processing algorithm (that is, the service processing algorithm with the second least corresponding preset traffic splitting ratio), the lower limit value of the ratio interval corresponding to each service processing algorithm is the upper limit value of the ratio interval corresponding to the previous sequential service processing algorithm, and the upper limit value is the sum of the preset traffic splitting ratio of this service processing algorithm and the upper limit value of the ratio interval corresponding to the previous sequential service processing algorithm.
[0061] Among them, the sum of the interval ranges of the ratio intervals corresponding to each service processing algorithm is the preset total value interval, that is, the lower limit value corresponding to the preset total value interval is 0, and the upper limit value is the upper limit value of the ratio interval corresponding to the last sequential service processing algorithm. Among them, the upper limit value of the ratio interval corresponding to the last sequential service processing algorithm is the sum of the preset traffic splitting ratios of all service processing algorithms.
[0062] Step S230: Obtain a positive random number within the preset total value interval, and match this positive random number with the interval range of the ratio interval corresponding to each service processing algorithm.
[0063] Step S240: Determine the ratio interval to which the positive random number belongs according to the matching result, and determine the service processing algorithm corresponding to the ratio interval to which the positive random number belongs as the target processing algorithm.
[0064] Among them, a positive random number is randomly selected within the numerical range of the preset total value range, and the magnitude relationship between the positive random number and the upper and lower limit values of the ratio range corresponding to each service processing algorithm is compared to determine the ratio range into which the positive random number falls, so as to determine the service processing algorithm corresponding to the ratio range as the target processing algorithm. Thus, the ratio range to which the positive random number belongs means: the ratio range where the lower limit value of the range is not greater than the positive random number and the upper limit value of the range is not less than the positive random number.
[0065] In an alternative implementation manner, the policy configuration information in the service request sent by the service end includes three preset service processing algorithms, that is, the policy configuration information includes: the first service processing algorithm, the second service processing algorithm, and the third service processing algorithm. Among them, the first preset diversion ratio corresponding to the first service processing algorithm, the second preset diversion ratio corresponding to the second service processing algorithm, and the third preset diversion ratio corresponding to the third service processing algorithm increase in sequence, that is, the first service processing algorithm, the second service processing algorithm, and the third service processing algorithm are arranged in ascending order according to the preset diversion ratio. Among them, the preset diversion ratio can be pre-configured by the service party in the policy configuration information of the service request according to the scenario requirements. Correspondingly, by parsing the policy configuration information, the preset diversion ratio included therein can be obtained. The specific value of the preset diversion ratio can be flexibly set by those skilled in the art according to the scenario requirements when implementing this embodiment, and is not limited here. Correspondingly, the first service processing algorithm corresponds to the first ratio range determined according to the first preset diversion ratio, the second service processing algorithm corresponds to the second ratio range determined according to the first preset diversion ratio and the second preset diversion ratio, and the third service processing algorithm corresponds to the third ratio range determined according to the preset total value range and the third preset diversion ratio; among them, the preset total value range is the sum of the first preset diversion ratio, the second preset diversion ratio, and the third preset diversion ratio.
[0066] It can be seen that the first service processing algorithm corresponds to a first ratio interval whose upper limit value does not exceed the first preset diversion ratio, the second service processing algorithm corresponds to a second ratio interval whose upper limit value exceeds the first preset diversion ratio and does not exceed the sum of the first preset diversion ratio and the second preset diversion ratio, and the third service processing algorithm corresponds to a third ratio interval whose upper limit value exceeds the sum of the first preset diversion ratio and the second preset diversion ratio and does not exceed the preset total value interval. In other words, the lower limit value of the first ratio interval is 0, the upper limit value of the first ratio interval and the lower limit value of the second ratio interval are the first preset diversion ratio, the upper limit value of the second ratio interval and the lower limit value of the third ratio interval are the sum of the first preset diversion ratio and the second preset diversion ratio, and the upper limit value of the third ratio interval is the sum of the first preset diversion ratio, the second preset diversion ratio, and the third preset diversion ratio. Among them, the preset total value interval is the sum of the first preset diversion ratio, the second preset diversion ratio, and the third preset diversion ratio, that is, the upper limit value of the third ratio interval.
[0067] Therefore, according to the above optional implementation manners, when the policy configuration information includes three preset service processing algorithms, step S240 specifically includes:
[0068] If the positive random number matches the first ratio interval, determine the first service processing algorithm corresponding to the first ratio interval as the target processing algorithm;
[0069] If the positive random number matches the second ratio interval, determine the second service processing algorithm corresponding to the second ratio interval as the target processing algorithm;
[0070] If the positive random number matches the third ratio interval, determine the third service processing algorithm corresponding to the third ratio interval as the target processing algorithm.
[0071] For ease of understanding, the following takes a specific example to introduce in detail the specific implementation details of the algorithm diversion strategy of the above random diversion type.
[0072] For example, the policy configuration information of the service request sent by the service end includes three service processing algorithms A, B, and C. Among them, the preset diversion ratio corresponding to A is 0.1, the preset diversion ratio corresponding to B is 0.6, and the preset diversion ratio corresponding to C is 0.3. Then, after sorting, the following result is obtained: A:C:B = 0.1:0.3:0.6. Therefore, the first ratio interval is 0 to 0.1, the second ratio interval is 0.1 to 0.4, the third ratio interval is 0.4 to 1, and the preset total value interval is 0 to 1.
[0073] Therefore, a random number m is selected within the range of 0 to 1. When m is 0.02, it falls into the first proportional interval, and A is determined as the target processing algorithm; when m is 0.2, it falls into the second proportional interval, and C is determined as the target processing algorithm; when m is 0.7, it falls into the third proportional interval, and B is determined as the target processing algorithm.
[0074] According to a service processing method provided by an embodiment of the present application, when the type of the algorithm splitting strategy is the random splitting type, the background only needs to directly execute the random splitting strategy in the service request parsing result, and then can determine the target processing algorithm from multiple service processing algorithms included in the service request according to the combination of the preset splitting ratio and the random number. Therefore, it is not necessary to pre-configure the splitting ratio corresponding to each service processing algorithm in the background database in advance and call it according to the algorithm splitting strategy included in the service request after receiving the service request, achieving decoupling from the background database and cutting off the pressure and risk of the database. Moreover, since the present application no longer needs to further write relevant code for implementing the algorithm splitting strategy in the background, the online process of background code update is eliminated, making the configuration of new service processing algorithms more flexible, shortening the update cycle, and reducing the development cost.
[0075] In an optional implementation manner, since the preset splitting ratio corresponding to the service processing algorithm included in the policy configuration information may be 0, in order to further improve the efficiency of splitting and processing at least two service processing algorithms included in the policy configuration information through the algorithm splitting strategy of the random splitting type, before step S120, it further includes: among the preset at least two service processing algorithms, removing the service processing algorithm corresponding to the preset splitting ratio with a value of 0. Thus, in the subsequent processing steps, only the service processing algorithms with a non-zero preset splitting ratio need to be sorted and divided into proportional intervals, etc., improving the processing efficiency.
[0076] In an optional implementation manner, when coding the algorithm splitting strategy included in the policy configuration information, in order to improve the efficiency of code writing, the coding of the algorithm splitting strategy is implemented based on the Stream algorithm. Thus, in the process of coding the algorithm splitting strategy, the Stream algorithm is used to replace the method implemented by the if-else logic in the related technology, and at the same time, the parameter definition is simplified, thereby reducing the code redundancy, improving the programming efficiency, and making the logic of the code clearer and easier for technical personnel to understand.
[0077] In an alternative implementation, the method for processing a service request in this embodiment is applied to a face recognition scenario. Then, the service processing algorithm includes algorithms for implementing face recognition provided by multiple different algorithm providers. Among them, the algorithm provider can specifically be a network device set up by a manufacturer that provides face recognition authentication services, such as SenseTime, Alibaba Cloud, Tencent, etc. The device interfaces, specifications, etc. of network devices of different manufacturers are different, and this application can be compatible with multiple different manufacturers' devices. Thus, the algorithm provider mainly refers to different algorithm interface platforms provided by different companies. Therefore, this application can be compatible with multiple different algorithm interface platforms.
[0078] Therefore, the algorithm splitting strategy of the service processing algorithm included in the policy configuration information can be determined according to at least one of the following: the application scenario type of the service request, the program type of the service end that sends the service request, and the device type of the service end device that sends the service request. The service party pre-configures the service processing algorithm and the algorithm splitting strategy that meet specific requirements in the policy configuration information according to the above influencing factors.
[0079] Among them, the application scenarios of the service request include directly performing face recognition on a user through the device camera, performing face recognition on a picture uploaded by the user, etc. Thus, the scenario characteristics of different application scenario types are different. Therefore, the specific configurations of the service processing algorithm and the algorithm splitting strategy can also be different. For example, if there are no special requirements for the types of service processing algorithms in the application scenario, the algorithm splitting strategy can be directly configured as a random splitting strategy. Another example is that if the application scenario has different degrees of preference for different types of service processing algorithms, the algorithm splitting strategy can be configured as a weighted splitting strategy to configure a greater weight for the service processing algorithm that is better adapted to the application scenario, thereby ensuring the rationality of the algorithm splitting strategy.
[0080] The programs of the service end that send service requests include web pages, APPs, mini programs, etc. Among them, since the algorithm call interfaces and interface call methods adopted by different types of service end programs are different, different algorithm shunting strategies can be flexibly configured according to the characteristics of the service end program types. For example, assuming that the service end of the APP program type has a faster call speed when calling the first service processing algorithm, the algorithm shunting strategy configured for the service end of the APP program type is: weight shunting strategy, and the weight of the first service processing algorithm is greater; Another example is that assuming that the service end of the mini program type has a faster call speed when calling the second service processing algorithm, the algorithm shunting strategy configured for the service end of the mini program type is: weight shunting strategy, and the weight of the second service processing algorithm is greater. In addition, the devices of the service end that send service requests include devices such as PC ends, Android ends, iOS ends, etc. Since the device performances and call interfaces of different types of devices are different, different algorithm shunting strategies can be configured according to the device characteristics of various types of service end devices.
[0081] In an optional implementation manner, if the policy configuration information included in the service request sent by the service end only includes a preset service processing algorithm, after the background parses the service processing algorithm included in the policy configuration information, the service processing algorithm can be directly determined as the target processing algorithm for processing the service request. In another optional implementation manner, if the service request sent by the service end does not include a preset service processing algorithm and related policy configuration information, one of the service processing algorithms preset in the background is selected as the target processing algorithm for processing the service request. Among them, the service processing algorithms preset in the background are specifically set by those skilled in the art according to the scenario requirements when implementing this method, and are not limited here. For example, in the face recognition scenario, the service processing algorithms preset in the background can be set to facexh5 and facexsdk.
[0082] In a specific example of this application, the service request can be a face recognition request. Correspondingly, the service processing algorithm can be a face recognition algorithm, and the algorithm shunting strategy is used to select the face recognition algorithm used for this service request from multiple face recognition algorithms. Among them, the policy configuration information included in the service request can be implemented in the form of a json string or a js script. Correspondingly, by parsing the policy configuration information in the form of a json string or a js script, a shunting technology ratio configuration Map object is obtained, so as to determine the target processing algorithm through this object. Of course, in other embodiments of this application, the service request can also be various requests such as fingerprint recognition requests, iris recognition requests, service payment requests, etc., and the specific types of service requests in this application are not limited.
[0083] In summary, the technical solution in this application can solve the following technical problems existing in the related technology and achieve the corresponding technical effects:
[0084] (1) In the related technology, the background needs to parse the service request and obtain the identifiers of various service processing algorithms included therein, and further, relevant code for implementing the algorithm shunting strategy for selecting the target processing algorithm needs to be written. However, there is an online process for the update and iteration of the background code. When generating a new algorithm shunting strategy, the update cycle is long and the development cost is high. To solve this problem, this application includes the algorithm shunting strategy of the service processing algorithm in the policy configuration information, so that the algorithm shunting strategy in the service request parsing result can be directly executed, and the target processing algorithm can be determined from various service processing algorithms included in the service request. Thus, there is no need to further write relevant code for implementing the algorithm shunting strategy in the background, and the online process for background code update is eliminated, making the configuration for new service processing algorithms more flexible, shortening the update cycle, and reducing the development cost.
[0085] (2) In the related technology, when the background sorts and shunts and selects among multiple configured service processing algorithms, it is necessary to perform normal sorting on the service processing algorithms with a configured shunting ratio of 0, resulting in wasted unnecessary processing time. To solve this problem, before sorting at least two service processing algorithms, this application further eliminates the service processing algorithms corresponding to the preset shunting ratio with a value of 0 among the preset at least two service processing algorithms. Thus, there is no need to sort the service processing algorithms with a shunting ratio of 0 in the subsequent sorting process, improving the processing efficiency. In short, it can improve the configuration efficiency and reduce the error probability.
[0086] (3) In the related technology, the specific implementation of the shunting strategy requires writing code in the background, and the code implementation is redundant, and the code is implemented entirely through if-else, which is not conducive to understanding, and there are many defined parameters; every time a new technology is added, code must be added and the production online process must be followed. To solve this problem, this application directly includes the algorithm shunting strategy in the service request and also supports the js script parsing method. In addition, through the stream algorithm, the original redundant 400 lines of code can be reduced to 80 lines of code. Moreover, through the stream algorithm, the original if-else logic can be replaced, which is clear and understandable, and supports the dynamic addition of new technologies without adding new code.
[0087] Figure 3 It is a block diagram of a processing device 30 for a service request provided by an embodiment of this application. Referring to Figure 3 , the device 30 includes:
[0088] A parsing module 31, configured to obtain and parse the policy configuration information included in the service request in response to the service request sent by the service end, and determine the service processing algorithm and the algorithm shunt policy included in the policy configuration information;
[0089] A shunt module 32, configured to select a target processing algorithm from at least two service processing algorithms according to the algorithm shunt policy when the policy configuration information includes at least two service processing algorithms and the algorithm shunt policy;
[0090] A processing module 33, configured to process the service request through the target processing algorithm;
[0091] Wherein, the algorithm shunt policy is determined by the service end according to the service end identifier, and the service end identifier includes at least one of the following: a scenario class identifier associated with the service scenario, a program class identifier associated with the program type, and a device class identifier associated with the device type.
[0092] In an optional implementation manner, after processing the service request through the target processing algorithm, it further includes:
[0093] Determine the algorithm shunt policy in the service request corresponding to the service end identifier according to the mapping relationship among the request processing result of the service request, the target processing algorithm corresponding to the service request, and the service end identifier corresponding to the service request.
[0094] In an optional implementation manner, determining the algorithm shunt policy of the service request corresponding to the service end identifier according to the mapping relationship among the request processing result of the service request, the target processing algorithm corresponding to the service request, and the service end identifier corresponding to the service request includes:
[0095] Obtain the correspondence between the request processing results and the target processing algorithms of multiple processed service requests, and the multiple processed service requests correspond to the same service end identifier;
[0096] Determine the processing capacity value of each target processing algorithm according to the correspondence;
[0097] When the difference between the processing capacity values of multiple target processing algorithms does not exceed a preset threshold, determine that the algorithm shunt policy in the service request corresponding to the service end identifier is the first type of shunt policy;
[0098] When the difference between the processing capacity values of multiple target processing algorithms exceeds the preset threshold, determine that the algorithm shunt policy in the service request corresponding to the service end identifier is the second type of shunt policy.
[0099] In an alternative implementation, the request processing result of the service request includes: a first type of processing result for characterizing whether the processing result is successful, and / or a second type of processing result for characterizing the processing delay; then the processing capacity value of the target processing algorithm is determined by the success rate determined by the first type of processing result and / or the delay rate determined by the second type of processing result;
[0100] Moreover, the types of the first type of shunting strategy include at least one of the following: random shunting type, polling shunting type, and hash shunting type; the type of the second type of shunting strategy includes: weighted shunting type.
[0101] In an alternative implementation, when the type of the algorithm shunting strategy is the random shunting type, the algorithm shunting strategy includes:
[0102] Sort the at least two service processing algorithms according to at least two preset service processing algorithms and the preset shunting ratio corresponding to each service processing algorithm;
[0103] According to the result of the sorting process, allocate a corresponding ratio interval for each service processing algorithm; wherein, the sum of the interval ranges of the ratio intervals corresponding to each service processing algorithm is the preset total value interval;
[0104] Obtain a positive random number within the preset total value interval, and match the positive random number with the ratio interval corresponding to each service processing algorithm;
[0105] Determine the ratio interval to which the positive random number belongs according to the matching result, and determine the service processing algorithm corresponding to the ratio interval to which the positive random number belongs as the target processing algorithm.
[0106] In an alternative implementation, the policy configuration information includes: a first service processing algorithm, a second service processing algorithm, and a third service processing algorithm; wherein, the first preset shunting ratio corresponding to the first service processing algorithm, the second preset shunting ratio corresponding to the second service processing algorithm, and the third preset shunting ratio corresponding to the third service processing algorithm increase in sequence;
[0107] Then the first service processing algorithm corresponds to a first ratio interval determined according to the first preset shunting ratio, the second service processing algorithm corresponds to a second ratio interval determined according to the first preset shunting ratio and the second preset shunting ratio, and the third service processing algorithm corresponds to a third ratio interval determined according to the preset total value interval and the third shunting ratio; wherein, the preset total value interval is the sum of the first preset shunting ratio, the second preset shunting ratio, and the third shunting ratio;
[0108] Determining the proportional interval to which the positive random number belongs according to the matching result, and determining the service processing algorithm corresponding to the proportional interval to which the positive random number belongs as the target processing algorithm includes:
[0109] If the positive random number matches the first proportional interval, then determine the first service processing algorithm corresponding to the first proportional interval as the target processing algorithm;
[0110] If the positive random number matches the second proportional interval, then determine the second service processing algorithm corresponding to the second proportional interval as the target processing algorithm;
[0111] If the positive random number matches the third proportional interval, then determine the third service processing algorithm corresponding to the third proportional interval as the target processing algorithm.
[0112] In an alternative implementation, before sorting at least two service processing algorithms according to at least two preset service processing algorithms and the preset diversion ratios corresponding to each service processing algorithm, it further includes:
[0113] Among the at least two preset service processing algorithms, eliminate the service processing algorithms corresponding to the preset diversion ratios with a value of 0.
[0114] In an alternative implementation, the processing module 33 is specifically configured to:
[0115] Call the algorithm call interface corresponding to the target processing algorithm to call the target processing algorithm to process the service request; wherein, different service processing algorithms correspond to different algorithm call interfaces.
[0116] In an alternative implementation, if the policy configuration information is sent in the form of a JavaScript script, then the parsing module 31 is specifically configured to:
[0117] Obtain the JavaScript script used to record the policy configuration information in the service request, and perform parsing processing on the JavaScript script.
[0118] In an alternative implementation, the coding of the algorithm diversion policy is implemented based on the Stream algorithm.
[0119] In an alternative implementation, if the processing method of the service request is applied to the face recognition scenario, then the service processing algorithm includes algorithms for implementing face recognition provided by multiple different algorithm providers;
[0120] The algorithm type of the service processing algorithm included in the policy configuration information is determined according to at least one of the following: the application scenario type of the service request, the program type of the service end sending the service request, and the device type of the service end device sending the service request.
[0121] For the specific structures and working principles of the above-mentioned various modules, reference can be made to the corresponding parts of the method embodiments, which will not be elaborated here.
[0122] Each of the above-mentioned modules in the service request processing device can be implemented in whole or in part by software, hardware, and their combination. The above-mentioned modules can be embedded in the processor in the computer device in hardware form or be independent of it, or can be stored in the memory in the computer device in software form, so that the processor can call and execute the operations corresponding to the above-mentioned various modules.
[0123] Figure 4 This is a block diagram of an electronic device provided by an embodiment of the present application. Refer to Figure 4 , the electronic device 40 includes: at least one processor 401; at least one memory 402; and one or more I / O interfaces 403 connected between the processor 401 and the memory 402; wherein, the memory 402 stores one or more computer programs executable by at least one processor 401, and the one or more computer programs are executed by at least one processor 401 so that at least one processor 401 can execute the above-mentioned service request processing method.
[0124] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, wherein the computer program implements the above-mentioned service request processing method when executed by a processor / processing core. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.
[0125] An embodiment of the present application also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in the processor of the electronic device, the processor in the electronic device executes the above-mentioned service request processing method.
[0126] Those of ordinary skill in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in systems and devices, can be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division of functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be executed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable storage medium, which can include computer storage media (or non-transitory media) and communication media (or transitory media).
[0127] As is well known to those of ordinary skill in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable program instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technologies, portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically includes computer-readable program instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium.
[0128] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to various computing / processing devices, or downloaded to an external computer or external storage device through a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage media in each computing / processing device.
[0129] The computer program instructions for performing the operations of the present application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine - related instructions, microcode, firmware instructions, state - setting data, or source code or object code written in any combination of one or more programming languages, including object - oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer - readable program instructions may be executed entirely on the user's computer, partially on the user's computer, executed as a stand - alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via an Internet service provider through the Internet). In some embodiments, by using the state information of the computer - readable program instructions to customize an electronic circuit, such as a programmable logic circuit, a field - programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute the computer - readable program instructions to implement various aspects of the present application.
[0130] The computer program product described herein may be implemented specifically by hardware, software, or a combination thereof. In an alternative embodiment, the computer program product is specifically embodied as a computer storage medium. In another alternative embodiment, the computer program product is specifically embodied as a software product, such as a Software Development Kit (SDK), etc.
[0131] Aspects of the present application are described herein with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present application. It should be understood that each block of the flowcharts and / or block diagrams, and the combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer - readable program instructions.
[0132] These computer-readable program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus to produce a machine such that the instructions, when executed by the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions may also be stored in a computer-readable storage medium that causes a computer, a programmable data processing apparatus, and / or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises a manufacture, including instructions that implement various aspects of the functions / acts specified in one or more blocks of the flowchart and / or block diagram.
[0133] The computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other devices to produce a computer-implemented process such that the instructions executed on the computer, other programmable data processing apparatus, or other devices implement the functions / acts specified in one or more blocks of the flowchart and / or block diagram.
[0134] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a segment of code, or a portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two consecutive blocks may in fact be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or acts, or by a combination of dedicated hardware and computer instructions.
[0135] Example embodiments have been disclosed herein, and although specific terms are employed, they are used in a general descriptive sense only and are not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly stated, features, characteristics, and / or elements described in connection with a particular embodiment may be used singly or in combination with features, characteristics, and / or elements described in connection with other embodiments. Accordingly, those skilled in the art will appreciate that various forms and details may be changed without departing from the scope of the present application as set forth by the appended claims.
Claims
1. A method for processing a service request, characterized in that, it includes: In response to a service request sent by a service terminal, obtaining and parsing the policy configuration information included in the service request, and determining the service processing algorithm and algorithm shunt policy included in the policy configuration information; When at least two service processing algorithms and algorithm shunt policies are included in the policy configuration information, according to the algorithm shunt policy, selecting a target processing algorithm from the at least two service processing algorithms; Processing the service request through the target processing algorithm; Wherein, the algorithm shunt policy is determined by the service terminal according to the service terminal identifier, and the service terminal identifier includes at least one of the following: a scenario class identifier associated with a service scenario, a program class identifier associated with a program type, and a device class identifier associated with a device type.
2. The method according to claim 1, characterized in that, after processing the service request through the target processing algorithm, it further includes: Determining the algorithm shunt policy of the service request corresponding to the service terminal identifier according to the mapping relationship among the request processing result of the service request, the target processing algorithm corresponding to the service request, and the service terminal identifier corresponding to the service request.
3. The method according to claim 2, characterized in that, the determining the algorithm shunt policy of the service request corresponding to the service terminal identifier according to the mapping relationship among the request processing result of the service request, the target processing algorithm corresponding to the service request, and the service terminal identifier corresponding to the service request includes: Obtaining the correspondence between the request processing results and the target processing algorithms of multiple processed service requests, and the multiple processed service requests correspond to the same service terminal identifier; Determining the processing capacity value of each target processing algorithm according to the correspondence; When the difference between the processing capacity values of multiple target processing algorithms does not exceed a preset threshold, determining the algorithm shunt policy of the service request corresponding to the service terminal identifier as the first type of shunt policy; When the difference between the processing capacity values of multiple target processing algorithms exceeds a preset threshold, determining the algorithm shunt policy of the service request corresponding to the service terminal identifier as the second type of shunt policy.
4. The method according to claim 3, characterized in that, the request processing result of the service request includes: a first type of processing result for indicating whether the processing result is successful and / or a second type of processing result for indicating the processing delay; the processing capacity value of the target processing algorithm is determined by the success rate determined by the first type of processing result and / or the delay rate determined by the second type of processing result; And, the type of the first type of shunt policy includes at least one of the following: random shunt type, polling shunt type, and hash shunt type; the type of the second type of shunt policy includes: weight shunt type.
5. The method according to claim 4, characterized in that, when the type of the algorithm shunt policy is the random shunt type, the algorithm shunt policy includes: According to the at least two preset business processing algorithms and the preset diversion ratio corresponding to each business processing algorithm, the at least two business processing algorithms are sorted; According to the result of the sorting process, a corresponding proportional interval is allocated to each business processing algorithm; wherein the sum of the interval ranges of the proportional intervals corresponding to each business processing algorithm is the preset total value interval; Obtaining a positive random number within the preset total value interval, and matching the positive random number with a proportional interval corresponding to each business processing algorithm; The proportion interval to which the positive random number belongs is determined according to the matching result, and the business processing algorithm corresponding to the proportion interval to which the positive random number belongs is determined as the target processing algorithm.
6. The method according to claim 5, It is characterized in that The policy configuration information includes: a first service processing algorithm, a second service processing algorithm, and a third service processing algorithm; wherein the first preset diversion ratio corresponding to the first service processing algorithm, the second preset diversion ratio corresponding to the second service processing algorithm, and the third preset diversion ratio corresponding to the third service processing algorithm are increased in sequence; The first business processing algorithm corresponds to a first ratio interval determined according to a first preset diversion ratio, the second business processing algorithm corresponds to a second ratio interval determined according to the first preset diversion ratio and the second preset diversion ratio, and the third business processing algorithm corresponds to a third ratio interval determined according to a preset total value interval and a third preset diversion ratio; wherein the preset total value interval is the sum of the first preset diversion ratio, the second preset diversion ratio, and the third preset diversion ratio; The determining, according to the matching result, the proportion interval to which the positive random number belongs, and determining the business processing algorithm corresponding to the proportion interval to which the positive random number belongs as the target processing algorithm, includes: If the positive random number matches the first proportional interval, determining the first service processing algorithm corresponding to the first proportional interval as the target processing algorithm; If the positive random number matches the second proportional interval, determining the second service processing algorithm corresponding to the second proportional interval as the target processing algorithm; If the positive random number matches the third proportional interval, the third service processing algorithm corresponding to the third proportional interval is determined as the target processing algorithm.
7. The method according to any one of claims 1 to 5, It is characterized in that Before sorting the at least two preset service processing algorithms according to the at least two preset service processing algorithms and the preset diversion ratio corresponding to each service processing algorithm, the method further includes: Among the at least two preset service processing algorithms, the service processing algorithm corresponding to the preset diversion ratio with a value of 0 is eliminated.
8. A device for processing a business request, It is characterized in that include: A parsing module, configured to respond to a service request sent by a service end, obtain and parse the policy configuration information contained in the service request, and determine the service processing algorithm and algorithm diversion strategy contained in the policy configuration information; A shunt module, configured to select a target processing algorithm from the at least two service processing algorithms according to the algorithm shunt policy when the policy configuration information includes at least two service processing algorithms and an algorithm shunt policy; A processing module, configured to process the service request through the target processing algorithm; wherein, the algorithm shunt policy is determined by the service end according to the service end identifier, and the service end identifier includes at least one of the following: a scenario class identifier associated with a service scenario, a program class identifier associated with a program type, and a device class identifier associated with a device type.
9. An electronic device, characterized in that it includes: at least one processor; at least one memory; and one or more I / O interfaces, connected between the processor and the memory; wherein, the memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor, so that the at least one processor can execute the service request processing method according to any one of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when executed by a processor, implements the service request processing method according to any one of claims 1-7.