Backend service calling method, device, equipment and storage medium
By comparing the call parameter value and the access threshold in the back-end service call, and dynamically updating the parameter value, the problem of inaccurate judgment of back-end service availability in the existing technology is solved, and efficient back-end service scheduling optimization and applicability are achieved. promote.
Patent Information
- Application Number
- CN202011112164.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-16
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-10-16
AI Technical Summary
When judging the availability of back-end services, the existing technology relies on the number of user requests or machine parameter monitoring, which cannot accurately reflect the actual availability of back-end services. It is also dependent on time data and has poor applicability.
By selecting a backend service from multiple candidate backend services and comparing the recorded call parameter value with the access threshold, if the comparison result meets the access conditions, the backend service is called and dynamically updated. Call parameter values to reflect the actual availability of the backend service.
It achieves accurate availability judgment and efficient scheduling optimization of back-end services without relying on additional parameter indicators or time data. It has stronger applicability and can be effectively used in a variety of application scenarios.
Smart Images

Figure CN112379978B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the computer field, and in particular to a backend service calling method, apparatus, device and storage medium. Background Art
[0002] In computer technology, back-end services are called by the front-end by providing interfaces to provide corresponding functions. This separation of the front-end and back-end can bring higher flexibility and response speed, while improving the overall performance of the system, and is therefore widely used.
[0003] In order to optimize the calling mechanism between the front-end and back-end, a load balancer is used in the prior art to implement the scheduling between the front-end and back-end. The load balancer forwards user requests to multiple back-end services, and avoids unavailable back-end services through pre-designed strategies. Among them, one design strategy is to determine the call success rate of the back-end service within a fixed time window, and judge whether the back-end service is available based on the call success rate. However, this method has high requirements on the number of user requests, that is, more user requests need to exist within the fixed time window to calculate the call success rate of the back-end service. If the number of user requests is small, the availability of the solution is poor; another design strategy is to monitor the parameters of the machine where the back-end service is located, such as CPU usage, system load, etc., but there are many reasons for the unavailability of the back-end service, which are not necessarily caused by factors related to the machine, such as the unavailability of the back-end service caused by network problems, so this method cannot accurately reflect the actual availability of the back-end service. Summary of the invention
[0004] The embodiments of the present invention provide a back-end service calling method, apparatus, device and storage medium, which can accurately reflect the actual availability of the back-end service, and then efficiently complete the scheduling optimization of the back-end service. This solution does not need to rely on additional parameter indicators, and the calling mechanism does not rely on time data, and is more applicable.
[0005] In a first aspect, an embodiment of the present invention provides a backend service calling method, the method comprising:
[0006] In response to a user request, selecting a backend service from a plurality of candidate backend services;
[0007] Compare the recorded call parameter value of the backend service with the access threshold, and if the comparison result meets the access condition, call the backend service;
[0008] The calling parameter value is updated.
[0009] In a second aspect, an embodiment of the present invention further provides a backend service calling device, the device comprising:
[0010] A service acquisition module, used to select a backend service from multiple candidate backend services in response to a user request;
[0011] A service calling module, used to compare the recorded calling parameter value of the backend service with the access threshold, and if the comparison result meets the access condition, call the backend service;
[0012] A data updating module updates the calling parameter value.
[0013] In a third aspect, an embodiment of the present invention further provides a backend service calling device, the device comprising:
[0014] one or more processors;
[0015] a storage device for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the backend service calling method described in the embodiment of the present invention.
[0017] In a fourth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the backend service calling method described in the embodiment of the present invention.
[0018] In an embodiment of the present invention, when a backend service call is made, a backend service is selected from multiple candidate backend services in response to a user request; the recorded call parameter value of the backend service is compared with the access threshold, and if the comparison result meets the access condition, the backend service is called; the call parameter value is updated to accurately reflect the actual availability of the backend service, thereby efficiently completing the scheduling optimization of the backend service. This solution does not need to rely on additional parameter indicators, and the call mechanism does not rely on time data, and is more applicable. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A flowchart of a backend service calling method provided by an embodiment of the present invention;
[0020] Figure 2 A flowchart of another backend service calling method provided by an embodiment of the present invention;
[0021] Figure 3 A flowchart of another backend service calling method provided by an embodiment of the present invention;
[0022] Figure 4 A flowchart of another backend service calling method provided by an embodiment of the present invention;
[0023] Figure 5 A structural block diagram of a backend service calling device provided by an embodiment of the present invention;
[0024] Figure 6 A schematic diagram of the structure of a device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present invention, rather than to limit the embodiments of the present invention. It is also necessary to explain that, for ease of description, only parts related to the embodiments of the present invention are shown in the accompanying drawings, rather than all structures.
[0026] Figure 1 A flowchart of a backend service calling method provided in an embodiment of the present invention. This embodiment can be applied to calling a backend service according to a user's request. The method can be executed by a computing device such as a server, and specifically includes the following steps:
[0027] Step S101: In response to a user request, select a backend service from a plurality of candidate backend services.
[0028] Multiple backend services can be run in one server, or a single backend service can be run in different servers. Before being called by the current user program, multiple backend services are defined as candidate backend services. Among them, the user request can be a request issued by the user-side (client) application to call the backend service.
[0029] In one embodiment, the user request may be forwarded by a configured load balancer, such as the load balancer may forward the received user request to a backend server. Optionally, selecting a backend service from a plurality of candidate backend services may be: randomly selecting a backend service from a plurality of candidate backend services. Exemplarily, assuming that n (n is an integer greater than 1) candidate backend services are maintained in a backend server, in this step, the design program running through the backend server randomly selects the candidate backend service 3 as the corresponding backend service for subsequent processing.
[0030] Step S102: Compare the recorded call parameter value of the backend service with the access threshold, and if the comparison result meets the access condition, call the backend service.
[0031] In one embodiment, a call parameter value is recorded for each backend service in the backend server, and the call parameter value represents the call status of the corresponding backend service. Call-related parameters such as call success, call failure, and call count will affect the size of the call parameter value.
[0032] When determining whether to call the backend service, the recorded call parameter value is compared with the access threshold, where the access threshold is a value set to determine whether the current backend service can be called, and the access threshold can be manually modified or dynamically changed according to different call scenarios, backend service types, etc. Correspondingly, if the comparison result meets the access condition, the backend service is called.
[0033] Step S103: Update the calling parameter value.
[0034] In one embodiment, when it is determined in step S102 that the backend service is called, the corresponding calling program is started to start the call to the backend service, and the call parameter value is updated accordingly. When there is a user request that needs to be responded to again, the updated call parameter value is compared with the access threshold to determine whether the access condition is met. Optionally, the call parameter value of the record may be updated when the backend service call succeeds or fails.
[0035] It can be seen from the above scheme that in the process of calling the backend service, the recorded call parameter value of the backend service is compared with the access threshold. If the comparison result meets the access condition, the backend service is called, and the call parameter value is dynamically updated accordingly. In this way, the actual availability of the backend service can be accurately reflected without relying on additional parameter indicators. It does not rely on time data and can be applied to a variety of different application scenarios.
[0036] On the basis of the above technical solution, in addition to recording a call parameter value for each backend service, the call parameter values recorded by all backend services can be counted. Exemplarily, assuming that there are f backend services, namely backend service 1, backend service 2 to backend service f, and the call parameter values corresponding to each backend service are 1a, 2a, ..., fa, respectively. These call parameter values are sorted to determine the backend service with the highest call success rate. When a user request is received, the backend service with a high success rate is preferentially selected from multiple candidate backend services for calling, and the above steps S102 and S103 are executed. As a result, some user requests with higher latency requirements can be promptly allocated to available backend services.
[0037] In another embodiment, when selecting a backend service from candidate backend services in response to a user request, the backend service that was successfully called the last time is given priority. Specifically, a call list is maintained in the system, and the call list records the call status of each backend service when it was most recently called. For example, if the record associated with backend service 1 is a successful call, the record associated with backend service 2 is a failed call, and the record associated with backend service 3 is a successful call, then a backend service is randomly selected from backend service 1 and backend service 3 to execute the above steps S102 and S103.
[0038] Figure 2 The flowchart of another backend service calling method provided by the embodiment of the present invention provides a specific method for updating the calling parameter value, and further defines the processing method when the backend service call fails. Figure 2 As shown, the technical solution is as follows:
[0039] Step S201: In response to a user request, select a backend service from multiple candidate backend services.
[0040] Step S202: Compare the recorded call parameter value of the backend service with the access threshold. If the comparison result meets the access condition, call the backend service.
[0041] In one embodiment, the access condition that is satisfied may be that the call parameter value is less than the access threshold. In another embodiment, the access condition that is satisfied may be that the call parameter value is greater than the access threshold. Here, the access condition that is satisfied may be set by the user. Accordingly, when the access condition that is satisfied is determined, the update method of the associated call parameter value is determined accordingly.
[0042] Step S203, determine whether the backend service is called successfully, if yes, execute step S204, otherwise execute step S205.
[0043] Step S204: Update the calling parameter value according to the first formula.
[0044] In one embodiment, the calling parameter value is updated by a pre-recorded first formula. For example, the calling parameter value is v, and the first formula may be v=vn or v=v*m, where n is a constant greater than 0, such as n is 1, and m is a constant greater than 0 and less than 1, such as m is 0.9. If the backend service call is successful, the calling parameter value is updated to vn or v*m accordingly.
[0045] It should be noted that the first formula here corresponds to the case where the access condition satisfied in step S202 is that the calling parameter value is less than the access threshold. If the access condition satisfied is that the calling parameter value is greater than the access threshold, the first formula can be adjusted accordingly to v=v+n or v=v*h, where h is a constant greater than 1, such as 1.2.
[0046] In another embodiment, for the case where the access condition is satisfied that the call parameter value is less than the access threshold, if the backend service call is successful, the way to update the call parameter value may also be: if the backend service call is successful, determine the number of consecutive successful calls of the backend service, look up the table according to the number of consecutive successful calls to determine the associated decrement value, and update the call parameter value to the difference between the call parameter value and the decrement value. Exemplarily, the query table is as follows:
[0047] Consecutive successes 1 2 3 ... m Decrement value 1 4 10 ... z
[0048] In this embodiment, when adjusting the backend service call parameter value, it is not adjusted according to a fixed value, but refers to the consecutive calls of the backend service, and adopts a variable adjustment parameter update method. In the case that the backend service cannot be called, it can respond quickly and timely and perform failover of the backend service.
[0049] Step S205: Update the calling parameter value according to the second formula.
[0050] In one embodiment, for the case where the access condition is satisfied that the call parameter value is less than the access threshold, the second formula may be v=v*p+1, where p is a constant greater than 1, such as 1.1.
[0051] Step S206: reselect a backend service from the multiple candidate backend services.
[0052] When the call to the backend service fails, accordingly, a backend service is reselected from the multiple candidate backends, and the process jumps to step S202 to continue execution until a backend service is successfully called.
[0053] It can be seen from the above scheme that in the process of calling the backend service, the calling parameter value is dynamically adjusted according to different calling situations based on the different recorded formulas, so that the backend service calling mechanism in this scheme can respond to the backend service situation efficiently and promptly. Since the parameters used are only the calling parameter values, the overall operating efficiency is higher.
[0054] Based on the above technical solution, step S206 includes:
[0055] Determine whether to reselect the backend service based on the attributes of the user request, and if so, reselect a backend service from the multiple candidate backend services. In one embodiment, the user request includes a corresponding attribute value, which marks whether it is necessary to reselect the backend service for a second call after the backend service call fails. In this step, for the case where a one-time call fails and a second call is not required, the backend service is not reselected, which further improves the backend service call mechanism and enhances the call flexibility.
[0056] Figure 3 This is a flowchart of another backend service calling method provided by an embodiment of the present invention, which further defines the processing method when the comparison result does not meet the access condition. Figure 3 As shown, the technical solution is as follows:
[0057] Step S301: Select a backend service from multiple candidate backend services.
[0058] Step S302: Obtain the recorded call parameter values of the backend service.
[0059] Step S303: determine whether the relationship between the calling parameter value and the access threshold satisfies the access condition. If yes, execute step S304; otherwise, execute step S305.
[0060] Step S304: calling the backend service.
[0061] Step S305: Update the calling parameter value according to the third formula, skip the backend service, and execute step S301.
[0062] If it is determined that the current backend service does not meet the call condition, it is directly skipped and the call parameter value is modified. In one embodiment, for the case where the access condition met in step S303 is that the call parameter value is less than the access threshold, the third formula can be v=vn or v=v*m, where n is a constant greater than 0, such as n is 1, and m is a constant greater than 0 and less than 1, such as m is 0.9.
[0063] Step S306, determine whether the backend service is called successfully, if yes, execute step S307, otherwise execute step S308.
[0064] Step S307: Update the calling parameter value according to the first formula.
[0065] Step S308: Update the calling parameter value according to the second formula.
[0066] Step S309: determine whether to reselect the backend service. If yes, execute step S310; otherwise, end the process.
[0067] Step S310: reselect a backend service from the multiple candidate backend services, and jump to step S301.
[0068] It can be seen from the above scheme that in the process of backend service calling, by evaluating the calling parameter values, the backend services that do not meet the calling conditions are directly skipped, which can accurately and efficiently perform service failover. At the same time, the calling parameter values are reasonably modified. When a backend service is skipped multiple times, if the calling conditions are met again, the corresponding calling strategy is executed. The whole process does not require the participation of other human or reference factors, which significantly optimizes the calling mechanism of the backend service.
[0069] Figure 4 The flowchart of another backend service calling method provided by the embodiment of the present invention provides a specific update method of calling parameter values and a practical application example. Figure 4 As shown, the technical solution is as follows:
[0070] Step S401: Select a backend service from multiple candidate backend services.
[0071] Step S402: Obtain the recorded call parameter values of the backend service.
[0072] Step S403: determine whether the call parameter value is greater than the access threshold, if yes, execute step S404, if no, execute step S405.
[0073] In one embodiment, the access threshold value is set to 1000. The initial value of the calling parameter value is set to 0.
[0074] Step S404: reselect a backend service from the multiple candidate backend services and reduce the calling parameter value.
[0075] In one embodiment, decreasing the call parameter value includes decrementing the call parameter value by 1.
[0076] Step S405: calling the backend service.
[0077] Step S406, determine whether the backend service is called successfully, if yes, execute step S407, otherwise execute step S408.
[0078] Step S407: reduce the calling parameter value. If it is determined that the reduced calling parameter value is less than a preset minimum value, determine the preset minimum value as the calling parameter value.
[0079] In one embodiment, reducing the calling parameter value includes decrementing the calling parameter value by 1. The preset minimum value is set to 1, that is, when the calling parameter value is less than 1 after being decremented by 1, the calling parameter value is set to 1, and if the calling parameter value is greater than 1 after being decremented by 1, the value after the calling parameter value is decremented by 1 is determined as the new calling parameter value.
[0080] Step S408: multiply the calling parameter value by the access coefficient and add the resultant to a preset constant value to obtain an updated calling parameter value.
[0081] Exemplarily, the access coefficient value is set to 1.1, and the preset constant value is set to 1.
[0082] On the basis of this scheme, a step of dynamically adjusting the access coefficient value is further included. In one embodiment, the corresponding access coefficient value is determined according to the type of different backend services. Exemplarily, the backend service type can be calibrated as high, medium, and low according to the requirements for the response speed of user requests and the importance of the service. Among them, for the backend service with a high backend service type, the access coefficient value is set to 3, for the backend service with a medium backend service type, the access coefficient value is set to 2, and for the backend service with a low backend service type, the access coefficient value is set to 1.1. Through the setting of different access coefficients, for important backend services, if they are unavailable, within a shorter update cycle of the call parameter value, in order to meet the skip condition, another backend service is found. For subsequent multiple user requests, multiple useless polls will not be performed on the same unavailable backend service, which improves the convergence speed and further improves the calling mechanism of the backend service.
[0083] Step S409: determine whether to reselect the backend service according to the attributes of the user request. If yes, execute step S410; otherwise, end the process.
[0084] Step S410: reselect a backend service from the multiple candidate backend services and execute step S401.
[0085] Specifically, taking the above parameter example values as an example, when selecting a backend service, it is determined whether the call parameter value is greater than 1000 (the access threshold S is set to 1000). If so, it is considered that the backend service is unavailable, and this backend service is skipped. At the same time, the call parameter value is updated to decrease by 1. If not, it is considered that the backend service is available, and the next call operation is performed. When calling this service, if the call is successful, the call parameter value is updated, and the update method is call parameter value = max(1, v - 1). If the call fails, the call parameter value is updated, and the update formula is v = v * p + 1, where p is the access coefficient and its value is 1.1. If the backend service is in a normal state, the call parameter value v remains at the value 1. If the service continuously fails, after 72 failed calls, v = 10501.5. At this time, v > S. When this backend service is selected, this service will be skipped, and at the same time, v is decreased by 1. After this backend service has been skipped 502 times, v = 9999.5. At this time, v < S, and this backend service will be re-selected for call. If the backend service failure is recovered and the subsequent call is successful, then v continues to decrease. Otherwise, v = 10999.5. After this backend service is skipped 1000 more times, it will be called again only when v < S.
[0086] As can be seen from the above solution, in this solution, only the success or failure of calling the backend service is used to determine the service availability, without the need to collect other data metrics, and the accuracy and stability are high. This backend service call mechanism has nothing to do with time. Regardless of the high or low number of backend service request calls, the same set of parameters can be used to call the backend service.
[0087] Figure 5 It is a structural block diagram of a backend service call device provided by an embodiment of the present invention. This device is used to execute the backend service call method provided by the above embodiment, and has the corresponding functional modules and beneficial effects for executing the method. As Figure 5 shown, this device specifically includes: a service acquisition module 101, a service call module 102, and a data update module 103, where,
[0088] The service acquisition module 101 is configured to select a backend service from multiple candidate backend services in response to a user request;
[0089] The service call module 102 is configured to compare the recorded call parameter value of the backend service with the access threshold, and if the comparison result meets the access condition, call the backend service;
[0090] The data update module 103 updates the call parameter value.
[0091] It can be seen from the above scheme that when making a backend service call, a backend service is selected from multiple candidate backend services in response to a user request; the recorded call parameter value of the backend service is compared with the access threshold, and if the comparison result meets the access condition, the backend service is called; the call parameter value is updated to accurately reflect the actual availability of the backend service, and then efficiently complete the scheduling optimization of the backend service. This scheme does not need to rely on additional parameter indicators, and the calling mechanism does not rely on time data, and is more applicable.
[0092] In a possible embodiment, the data updating module 103 is specifically used for:
[0093] If the backend service call is successful, the call parameter value is updated according to the first formula.
[0094] In a possible embodiment, the data updating module 103 is specifically used for:
[0095] If the backend service call fails, the call parameter value is updated according to the second formula;
[0096] The service acquisition module 101 is used for:
[0097] Reselect a backend service from the multiple candidate backend services.
[0098] In a possible embodiment, the service acquisition module 101 is specifically used for:
[0099] Determine whether to reselect a backend service according to the attribute of the user request, and if yes, reselect a backend service from the multiple candidate backend services.
[0100] In a possible embodiment, the service calling module 102 is specifically used for:
[0101] If the comparison result does not meet the access condition, the calling parameter value is updated according to the third formula;
[0102] The service acquisition module 101 is specifically used to skip the backend service and reselect a backend service from the multiple candidate backend services.
[0103] In a possible embodiment, the access condition includes that the call parameter value is not greater than the access threshold.
[0104] In a possible embodiment, the data updating module 103 is specifically configured to: if the calling is successful, reduce the calling parameter value.
[0105] In a possible embodiment, the data updating module 103 is further configured to:
[0106] After reducing the calling parameter value, if it is determined that the reduced calling parameter value is less than a preset minimum value, the preset minimum value is determined as the calling parameter value.
[0107] In a possible embodiment, the data updating module 103 is specifically configured to: if the call fails, increase the call parameter value.
[0108] In a possible embodiment, the data updating module 103 is specifically used for:
[0109] The updated calling parameter value is obtained by multiplying the calling parameter value by the access coefficient and adding a preset constant value, and the access coefficient is greater than 1.
[0110] In a possible embodiment, the data updating module 103 is specifically configured to reduce the calling parameter value if the comparison result does not meet the access condition.
[0111] Figure 6 A schematic diagram of the structure of a backend service calling device provided by an embodiment of the present invention, such as Figure 6 As shown, the device includes a processor 201, a memory 202, an input device 203 and an output device 204; the number of processors 201 in the device can be one or more. Figure 6 A processor 201 is taken as an example; the processor 201, memory 202, input device 203 and output device 204 in the device can be connected by a bus or other means. Figure 6 The example of connecting via a bus is taken. The memory 202, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the back-end service calling method in the embodiment of the present invention. The processor 201 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 202, that is, implements the above-mentioned back-end service calling method. The input device 203 can be used to receive input digital or character information, and generate key signal input related to user settings and function control of the device. The output device 204 may include a display device such as a display screen.
[0112] An embodiment of the present invention further provides a storage medium containing computer executable instructions, wherein the computer executable instructions are used to execute a backend service calling method when executed by a computer processor, the method comprising:
[0113] In response to a user request, selecting a backend service from a plurality of candidate backend services;
[0114] Compare the recorded call parameter value of the backend service with the access threshold, and if the comparison result meets the access condition, call the backend service;
[0115] The calling parameter value is updated.
[0116] Through the above description of the implementation method, the technicians in the relevant field can clearly understand that the embodiments of the present invention can be implemented by means of software and necessary general hardware, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the embodiments of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, service, or network device, etc.) to execute the methods described in each embodiment of the embodiments of the present invention.
[0117] It is worth noting that in the embodiment of the above-mentioned back-end service calling device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present invention.
[0118] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the embodiments of the present invention are not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the embodiments of the present invention. Therefore, although the embodiments of the present invention are described in more detail through the above embodiments, the embodiments of the present invention are not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the embodiments of the present invention, and the scope of the embodiments of the present invention is determined by the scope of the appended claims.
Claims
1. The backend service calling method is characterized by: include: In response to a user request, randomly select a backend service from multiple candidate backend services; Compare the recorded call parameter value of the backend service with the access threshold, and if the comparison result meets the access condition, call the backend service; The calling parameter value is updated, wherein, if the backend service call is successful, the calling parameter value is updated according to a first formula, the first formula includes a calculation formula for decreasing the calling parameter value; if the backend service call fails, the calling parameter value is updated according to a second formula, the second formula includes a calculation formula for increasing the calling parameter value, and a backend service is reselected from the multiple candidate backend services; If the comparison result between the call parameter value and the access threshold does not meet the access condition, the call parameter value is updated according to a third formula, and the third formula includes a calculation formula for reducing the call parameter value, skipping the backend service, and reselecting a backend service from the multiple candidate backend services.
2. The method according to claim 1, characterized in that: Reselecting a backend service from the multiple candidate backend services includes: Determine whether to reselect a backend service according to the attribute of the user request, and if yes, reselect a backend service from the multiple candidate backend services.
3. The method according to claim 1, characterized in that The access condition includes that the call parameter value is not greater than the access threshold.
4. The method according to claim 3, characterized in that The updating of the calling parameter value includes: reducing the calling parameter value.
5. The method according to claim 4, characterized in that After reducing the calling parameter value, the method further comprises: If it is determined that the reduced calling parameter value is less than the preset minimum value, the preset minimum value is determined as the calling parameter value.
6. The method according to any one of claims 3 to 5, characterized in that: If the call fails, the call parameter value is increased.
7. The method according to claim 6, characterized in that The increasing of the calling parameter value comprises: The updated calling parameter value is obtained by multiplying the calling parameter value by the access coefficient and adding a preset constant value, and the access coefficient is greater than 1.
8. The method according to any one of claims 3 to 5, characterized in that: If the comparison result does not meet the access condition, the calling parameter value is reduced.
9. The backend service calling device is characterized in that: include: A service acquisition module, used to randomly select a backend service from multiple candidate backend services in response to a user request; A service calling module, used to compare the recorded calling parameter value of the backend service with the access threshold, and if the comparison result meets the access condition, call the backend service; A data update module is used to update the call parameter value, wherein if the backend service call is successful, the call parameter value is updated according to a first formula, and the first formula includes a calculation formula for reducing the call parameter value; if the backend service call fails, the call parameter value is updated according to a second formula, and the second formula includes a calculation formula for increasing the call parameter value, and a backend service is reselected from the multiple candidate backend services; if the comparison result of the call parameter value and the access threshold does not meet the access condition, the call parameter value is updated according to a third formula, and the third formula includes a calculation formula for reducing the call parameter value. The service acquisition module is also used to skip the backend service and reselect a backend service from the multiple candidate backend services.
10. A backend service calling device, comprising: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the backend service calling method as described in any one of claims 1-8.
11. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to execute the backend service calling method according to any one of claims 1 to 8 when executed by a computer processor.
Citation Information
Patent Citations
Service request calling method and device, computer equipment and storage medium
CN109862052A
Printing system, cloud computing system, printing system control method, and storage medium
US20110205586A1
