CN112379978A - Back-end service calling method, device, equipment and storage medium - Google Patents

Back-end service calling method, device, equipment and storage medium Download PDF

Info

Publication number
CN112379978A
CN112379978A CN202011112164.5A CN202011112164A CN112379978A CN 112379978 A CN112379978 A CN 112379978A CN 202011112164 A CN202011112164 A CN 202011112164A CN 112379978 A CN112379978 A CN 112379978A
Authority
CN
China
Prior art keywords
calling
parameter value
service
end service
backend
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011112164.5A
Other languages
Chinese (zh)
Inventor
谭卓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Baiguoyuan Information Technology Co Ltd
Original Assignee
Guangzhou Baiguoyuan Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Baiguoyuan Information Technology Co Ltd filed Critical Guangzhou Baiguoyuan Information Technology Co Ltd
Priority to CN202011112164.5A priority Critical patent/CN112379978A/en
Publication of CN112379978A publication Critical patent/CN112379978A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-server
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/549Remote execution

Abstract

The embodiment of the invention discloses a method, a device, equipment and a storage medium for calling back-end service, wherein the method comprises the following steps: selecting one of a plurality of candidate backend services in response to a user request; comparing the recorded calling parameter value of the back-end service with an access threshold value, and calling the back-end service if the comparison result meets the access condition; and updating the calling parameter value. The scheme can accurately reflect the actual availability of the back-end service, so that the scheduling optimization of the back-end service is efficiently completed, the scheme does not need to rely on additional parameter indexes, and meanwhile, the calling mechanism does not rely on time data, so that the applicability is stronger.

Description

Back-end service calling method, device, equipment and storage medium
Technical Field
The embodiment of the application relates to the field of computers, in particular to a method, a device, equipment and a storage medium for calling back-end services.
Background
In the computer technology, the back-end service is called by the front-end through an interface providing mode to provide corresponding functions, and the mode of separating the front-end from the back-end can bring higher flexibility and response speed and simultaneously improve the overall performance of the system, so the system is widely used.
In order to optimize the call mechanism between the front end and the back end, a load balancer is adopted in the prior art to realize the scheduling between the front end and the back end. User requests are forwarded to a plurality of back-end services through a load balancer, and unavailable back-end services are avoided through a pre-designed strategy. One design strategy is to determine the calling success rate of the back-end service in a fixed time window and judge whether the back-end service is available according to the calling success rate, however, the method has higher requirements on the number of user requests, namely, more user requests are required to be present in the fixed time window for calculating the calling success rate of the back-end service, and if the number of the user requests is less, the scheme has poor availability; another design strategy is to monitor parameters of a machine where the backend service is located, such as CPU utilization, system load, etc., but there are many reasons for unavailability of the backend service, which are not necessarily caused by machine-related factors, such as unavailability of the backend service caused by network problems, and thus this approach cannot accurately reflect the actual availability of the backend service.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a storage medium for calling a back-end service, which can accurately reflect the actual availability of the back-end service so as to efficiently finish the scheduling optimization of the back-end service.
In a first aspect, an embodiment of the present invention provides a method for calling a backend service, where the method includes:
selecting one of a plurality of candidate backend services in response to a user request;
comparing the recorded calling parameter value of the back-end service with an access threshold value, and calling the back-end service if the comparison result meets the access condition;
and updating the calling parameter value.
In a second aspect, an embodiment of the present invention further provides a backend service invoking device, where the device includes:
a service acquisition module, configured to select a backend service from a plurality of candidate backend services in response to a user request;
the service calling module is used for comparing the recorded calling parameter value of the back-end service with an access threshold value, and calling the back-end service if the comparison result meets the access condition;
and the data updating module is used for updating the calling parameter value.
In a third aspect, an embodiment of the present invention further provides a back-end service invoking device, where the back-end service invoking device includes:
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, the one or more processors implement the backend service call method according to the embodiment of the present invention.
In a fourth aspect, the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform the backend service invocation method according to the present invention.
In the embodiment of the invention, when the back-end service is called, one back-end service is selected from a plurality of candidate back-end services by responding to a user request; comparing the recorded calling parameter value of the back-end service with an access threshold value, and calling the back-end service if the comparison result meets the access condition; the method and the system have the advantages that the calling parameter values are updated, the actual availability of the back-end service can be accurately reflected, the scheduling optimization of the back-end service is efficiently completed, extra parameter indexes are not needed, meanwhile, the calling mechanism does not depend on time data, and the applicability is stronger.
Drawings
Fig. 1 is a flowchart of a method for calling a backend service according to an embodiment of the present invention;
fig. 2 is a flowchart of another back-end service invoking method according to an embodiment of the present invention;
fig. 3 is a flowchart of another back-end service invoking method according to an embodiment of the present invention;
fig. 4 is a flowchart of another back-end service invoking method according to an embodiment of the present invention;
fig. 5 is a block diagram illustrating a structure of a backend service invoking device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
Detailed Description
The embodiments of the present invention will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad invention. It should be further noted that, for convenience of description, only some structures, not all structures, relating to the embodiments of the present invention are shown in the drawings.
Fig. 1 is a flowchart of a method for calling a backend service according to an embodiment of the present invention, where the embodiment is applicable to calling a backend service according to a request of a user, and the method may be executed by a computing device such as a server, and specifically includes the following steps:
step S101, responding to a user request, and selecting one back-end service from a plurality of candidate back-end services.
Multiple backend services may be run in one server, or a single backend service may be run in different servers. A plurality of backend services are defined as candidate backend services before being invoked by a current user program. The user request may be a request for calling a backend service sent by a user side (client) application.
In one embodiment, the user request may be forwarded by a configured load balancer, e.g., the load balancer may forward the received user request to a backend server. Optionally, selecting one backend service from the plurality of candidate backend services may be: one of the plurality of candidate backend services is randomly selected. For example, assuming that n (n is an integer greater than 1) candidate backend services are maintained in one backend server, in this step, the candidate backend service 3 is randomly selected as a corresponding backend service for subsequent processing by a design program run by the backend server.
And S102, comparing the recorded calling parameter value of the back-end service with an access threshold value, and calling the back-end service if the comparison result meets the access condition.
In one embodiment, a calling parameter value is recorded for each backend service in the backend server, and the calling parameter value represents the calling condition of the corresponding backend service, and parameters related to calling, such as calling success, calling failure, calling times and the like, can affect the size of the calling parameter value.
And when determining whether to call the back-end service, comparing the recorded calling parameter value with an access threshold, wherein the access threshold is a set value used for judging whether the current back-end service can be called, and the access threshold can be manually modified or dynamically changed according to different calling scenes, back-end service types and the like. Correspondingly, if the comparison result meets the access condition, the back-end service is called.
And step S103, updating the calling parameter value.
In one embodiment, when it is determined in step S102 that the backend service is called, a corresponding calling program is started to start calling the backend service, and a calling parameter value is updated accordingly. When there is again a user request for a response, the updated invocation parameter value is used to compare with the access threshold to determine whether the access condition is satisfied. Optionally, when the back-end service call is successful or the call is failed, the recorded call parameter value may be updated.
According to the scheme, in the process of calling the back-end service, the recorded calling parameter value of the back-end service is compared with the access threshold value, if the comparison result meets the access condition, the back-end service is called, and the calling parameter value is updated dynamically correspondingly. By the method, the actual availability of the back-end service can be accurately reflected, additional parameter indexes are not required, time data are not required, and the method is suitable for various different application scenes.
On the basis of the technical scheme, except that a calling parameter value is recorded for each back-end service, the calling parameter values recorded by all back-end services can be counted. For example, assuming that f backend services exist, the backend services are respectively a backend service 1, a backend service 2, and up to a backend service f, and the call parameter values recorded corresponding to each backend service are sequentially 1a, 2a,. and fa, and the call parameter values are sorted to determine the backend service with the highest call success rate. When a user request is received, a backend service with a high success rate is preferentially selected from the plurality of candidate backend services to be called, and the step S102 and the step S103 are executed. Therefore, the method can be timely distributed to available backend services for certain user requests with high requirements on time delay.
In another embodiment, when selecting one of the candidate backend services in response to a user request, a previously invoked successful backend service is preferentially selected. Specifically, a call list is maintained in the system, and the call condition of each backend service when being called last time is recorded in the call list. Illustratively, if the record associated with the backend service 1 is that the call is successful, the record associated with the backend service 2 is that the call is failed, and the record associated with the backend service 3 is that the call is successful, then a backend service is randomly selected from the backend service 1 and the backend service 3 to execute the step S102 and the step S103.
Fig. 2 is a flowchart of another back-end service invocation method according to an embodiment of the present invention, which provides a specific manner of updating an invocation parameter value, and further defines a processing manner when the back-end service invocation fails. As shown in fig. 2, the technical solution is as follows:
step S201, in response to a user request, selects one backend service from a plurality of candidate backend services.
Step S202, comparing the recorded calling parameter value of the back-end service with an access threshold value, and calling the back-end service if the comparison result meets the access condition.
In one embodiment, the access condition being met may be that the invocation parameter value is less than the access threshold. In another embodiment, the satisfied access condition may be that the invocation parameter value is greater than the access threshold. Here, the access conditions that it satisfies may be set by itself, and accordingly, when the satisfied access conditions are determined, the update manner of the associated call parameter values is determined accordingly.
Step 203, judging whether the back-end service is successfully called, if so, executing step 204, otherwise, executing step 205.
And step S204, updating the calling parameter value according to a first formula.
In one embodiment, the calling parameter value is updated by a pre-recorded first formula, which may be v, 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. And if the back-end service call is successful, updating the call parameter value to v-n or v m correspondingly.
It should be noted that the first formula herein corresponds to the case that the access condition satisfied in step S202 is that the value of the invocation parameter is smaller than the access threshold, and if the satisfied access condition is that the value of the invocation parameter is greater than the access threshold, the first formula may be adjusted to v ═ v + n or v ═ v × h, where h is a constant greater than 1, for example, the value is 1.2.
In another embodiment, for the case that the satisfied access condition is that the invocation parameter value is smaller than the access threshold, if the backend service invocation is successful, the manner of updating the invocation parameter value may also be: and if the back-end service is successfully called, determining the number of times that the back-end service is successfully called, looking up a table according to the number of times that the back-end service is successfully called to determine an associated decrement value, and updating the calling parameter value into a difference value between the calling parameter value and the decrement value. Illustratively, the table of the query is as follows:
number of consecutive successes 1 2 3 ... m
Decreasing value 1 4 10 ... z
In this embodiment, when adjusting the calling parameter value of the backend service, the adjustment is not performed according to a fixed value, but refers to the calling condition of the backend service for several times in succession, and a variable adjustment parameter updating manner is adopted, so that the response can be quickly and timely performed to perform the failover of the backend service in response to the situation that the backend service cannot be called.
And step S205, updating the calling parameter value according to a second formula.
In one embodiment, for the case that the access condition that is met is that the value of the invocation parameter is smaller than the access threshold, the second formula may be v ═ v × p +1, where p is a constant greater than 1, such as a value of 1.1.
Step S206, reselecting one back-end service from the candidate back-end services.
When the calling of the backend service fails, correspondingly, one backend service is reselected from the plurality of candidate backend services, and the step S202 is skipped to continue to be executed until the calling of the backend service is successful.
According to the scheme, in the process of calling the back-end service, the calling parameter value is dynamically adjusted according to different recorded formulas and different calling conditions, so that the back-end service calling mechanism in the scheme can efficiently and timely react to the back-end service condition, and the used parameter is only the calling parameter value, so that the overall operation efficiency is higher.
On the basis of the above technical solution, the step S206 includes:
and determining whether to reselect the back-end service according to the attribute of the user request, and if so, reselecting one back-end service from the candidate back-end services. In one embodiment, the user request includes a corresponding attribute value that marks whether the backend service needs to be reselected for a secondary call after the backend service call fails. In the step, the condition that secondary calling is not needed after one-time calling, namely calling failure, is solved without reselecting the back-end service, so that a back-end service calling mechanism is further improved, and the calling flexibility is improved.
Fig. 3 is a flowchart of another back-end service invoking method according to an embodiment of the present invention, which further defines a processing manner for a case that a result does not satisfy an access condition. As shown in fig. 3, the technical solution is as follows:
step S301 selects one backend service from the plurality of candidate backend services.
Step S302, obtaining the recorded calling parameter value of the back-end service.
Step S303, judging whether the relation between the calling parameter value and the access threshold value meets the access condition, if so, executing step S304, otherwise, executing step S305.
And step S304, calling the back-end service.
And S305, updating the calling parameter value according to a third formula, skipping the back-end service, and executing the step S301.
And if the fact that the current front-end service and the current back-end service do not meet the calling condition is determined, directly skipping and modifying the calling parameter value. In one embodiment, for the case that the access condition satisfied in step S303 is that the invocation parameter value is smaller than the access threshold, the third formula may be v-n or v-m, where n is a constant greater than 0, e.g., n is 1, m is a constant greater than 0 and smaller than 1, e.g., m is 0.9.
Step S306, judging whether the back-end service is successfully called, if so, executing step S307, otherwise, executing step S308.
And step S307, updating the calling parameter value according to a first formula.
And step S308, updating the calling parameter value according to a second formula.
Step S309, determining whether to reselect the backend service, if so, executing step S310, otherwise, ending the process.
Step S310, reselecting one back-end service from the candidate back-end services, and jumping to step S301.
According to the scheme, in the calling process of the back-end service, the back-end service which does not meet the calling condition is directly skipped by evaluating the calling parameter value, the service fault transfer can be accurately and efficiently carried out, meanwhile, the calling parameter value is reasonably modified, after a certain back-end service is skipped for multiple times, if the calling condition is met again, a corresponding calling strategy is executed, other artificial or reference factors are not needed in the whole process, and the calling mechanism of the back-end service is obviously optimized.
Fig. 4 is a flowchart of another back-end service invocation method according to an embodiment of the present invention, which shows a specific update method of invocation parameter values and an actual application example. As shown in fig. 4, the technical solution is as follows:
step S401 selects one backend service from a plurality of candidate backend services.
And step S402, acquiring the recorded calling parameter value of the back-end service.
And S403, judging whether the calling parameter value is larger than an access threshold value, if so, executing S404, and if not, executing S405.
In one embodiment, the access threshold size is set to 1000. The initial value of the call parameter value is set to 0.
Step S404, reselecting one back-end service from the candidate back-end services, and reducing the calling parameter value.
In one embodiment, decreasing the call parameter value comprises decreasing the call parameter value by 1.
And step S405, calling the back-end service.
Step S406, judging whether the back-end service is successfully called, if so, executing step S407, otherwise, executing step S408.
And S407, reducing the calling parameter value, and if the reduced calling parameter value is smaller than a preset minimum value, determining the preset minimum value as the calling parameter value.
In one embodiment, decreasing the call parameter value comprises decreasing the call parameter value by 1. The preset minimum value is set to 1, that is, the calling parameter value is set to 1 when the calling parameter value is less than 1 after being subtracted from 1, and if the calling parameter value is greater than 1 after being subtracted from 1, the calling parameter value is determined to be a new calling parameter value after being subtracted from 1.
And step S408, multiplying the calling parameter value by the access coefficient and adding a preset constant value to obtain an updated calling parameter value.
Illustratively, the access coefficient value is set to a magnitude of 1.1, and the predetermined constant value is set to a magnitude of 1.
On the basis of the scheme, the method further comprises the step of dynamically adjusting the access coefficient value. In one embodiment, the corresponding access coefficient values are determined according to the type of different backend services. For example, the back-end service type can be calibrated to be high, medium and low according to the requirement on the response speed of the user request and the importance degree of the service. Wherein the access coefficient value is set to 3 for backend services with a high backend service type, to 2 for backend services with a medium backend service type, and to 1.1 for backend services with a low backend service type. Through setting of different access coefficients, for important backend services, if unavailable situations exist, skipping conditions are met in a few update periods of calling parameter values, and further backend services are searched. Aiming at a plurality of subsequent user requests, the method does not perform multiple times of useless polling on the same unavailable back-end service, improves the convergence speed and further perfects the calling mechanism of the back-end service.
Step S409, determining whether to reselect the back-end service according to the attribute of the user request, if so, executing step S410, otherwise, ending the process.
Step S410, reselecting a backend service from the plurality of candidate backend services, and executing step S401.
Specifically, taking the parameter example value as an example, when one backend service is selected, it is determined whether the calling parameter value is greater than 1000 (the access threshold S is 1000), if so, the backend service is considered to be unavailable, the backend service is skipped, and meanwhile, the calling parameter value is updated by subtracting 1 from the value, and if not, the backend service is considered to be available, and the next calling operation is performed. When the service is called, if the calling is successful, the calling parameter value is updated in a mode that the calling parameter value is max (1, v-1), and if the calling is failed, the calling parameter value is updated in a mode that the updating formula is v p +1, wherein p is an access coefficient and the value is 1.1. If the backend service is in a normal state, the value v of the invocation parameter is kept at a value of 1, if the service is continuously failed, v is 10501.5 after 72 times of failed invocations, wherein v is greater than S, and when the backend service is selected, the service is skipped, and v is automatically reduced by 1. After the backend service is skipped 502 times, v is 9999.5, v < S, the backend service is reselected and called, if the backend service fails to recover and the subsequent calling succeeds, v is continuously reduced, otherwise v is 10999.5, and after the backend service is skipped 1000 times, v < S is called again.
According to the scheme, service availability is judged only by calling the success or failure of the back-end service, other data indexes do not need to be collected, accuracy and stability are high, the back-end service calling mechanism is irrelevant to time, and the same set of parameters can be used for calling the back-end service no matter how high the back-end service request is called.
Fig. 5 is a block diagram of a backend service invoking device according to an embodiment of the present invention, where the device is configured to execute the backend service invoking method provided in the foregoing embodiment, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 5, the apparatus specifically includes: a service acquisition module 101, a service invocation module 102, and a data update module 103, wherein,
a service acquisition module 101, configured to select one backend service from a plurality of candidate backend services in response to a user request;
the service calling module 102 is configured to compare the recorded calling parameter value of the backend service with an access threshold, and if the comparison result meets an access condition, call the backend service;
and the data updating module 103 is used for updating the calling parameter value.
According to the scheme, when the back-end service is called, one back-end service is selected from a plurality of candidate back-end services by responding to a user request; comparing the recorded calling parameter value of the back-end service with an access threshold value, and calling the back-end service if the comparison result meets the access condition; the method and the system have the advantages that the calling parameter values are updated, the actual availability of the back-end service can be accurately reflected, the scheduling optimization of the back-end service is efficiently completed, extra parameter indexes are not needed, meanwhile, the calling mechanism does not depend on time data, and the applicability is stronger.
In a possible embodiment, the data updating module 103 is specifically configured to:
and if the back-end service is successfully called, updating the calling parameter value according to a first formula.
In a possible embodiment, the data updating module 103 is specifically configured to:
if the back-end service calling fails, updating the calling parameter value according to a second formula;
the service acquisition module 101 is configured to:
reselecting one of the plurality of candidate backend services.
In a possible embodiment, the service acquisition module 101 is specifically configured to:
and determining whether to reselect the back-end service according to the attribute of the user request, and if so, reselecting one back-end service from the candidate back-end services.
In a possible embodiment, the service invocation module 102 is specifically configured to:
if the comparison result does not meet the access condition, updating the calling parameter value according to a third formula;
the service acquisition module 101 is specifically configured to: skipping the backend services, and reselecting one of the candidate backend services.
In one possible embodiment, the access condition comprises that the invocation parameter value is not greater than the access threshold.
In a possible embodiment, the data updating module 103 is specifically configured to: and if the calling is successful, reducing the calling parameter value.
In a possible embodiment, the data updating module 103 is further specifically configured to:
and after the calling parameter value is reduced, if the reduced calling parameter value is smaller than a preset minimum value, determining the preset minimum value as the calling parameter value.
In a possible embodiment, the data updating module 103 is specifically configured to: and if the calling fails, increasing the calling parameter value.
In a possible embodiment, the data updating module 103 is specifically configured to:
and multiplying the calling parameter value by an access coefficient and adding a preset constant value to obtain an updated calling parameter value, wherein the access coefficient is greater than 1.
In a possible embodiment, the data updating module 103 is specifically configured to: and if the comparison result does not meet the access condition, reducing the calling parameter value.
Fig. 6 is a schematic structural diagram of a back-end service invoking device according to an embodiment of the present invention, as shown in fig. 6, the device includes a processor 201, a memory 202, an input device 203, and an output device 204; the number of the processors 201 in the device may be one or more, and one processor 201 is taken as an example in fig. 6; the processor 201, the memory 202, the input device 203 and the output device 204 in the apparatus may be connected by a bus or other means, for example in fig. 6. The memory 202 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the backend 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 software programs, instructions and modules stored in the memory 202, that is, implements the above-described back-end service calling method. The input device 203 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function controls of the apparatus. The output device 204 may include a display device such as a display screen.
Embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a method for backend service invocation, the method including:
selecting one of a plurality of candidate backend services in response to a user request;
comparing the recorded calling parameter value of the back-end service with an access threshold value, and calling the back-end service if the comparison result meets the access condition;
and updating the calling parameter value.
From the above description of the embodiments, it is obvious for those skilled in the art that the embodiments of the present invention can be implemented by software and necessary general hardware, and certainly can be implemented by hardware, but the former is a better implementation in many cases. Based on such understanding, the technical solutions of the embodiments of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions to make a computer device (which may be a personal computer, a service, or a network device) perform the methods described in the embodiments of the present invention.
It should be noted that, in the embodiment of the backend service invoking device, each included unit and module are only divided according to functional logic, but are not limited to the above division, as long as the corresponding function can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiment of the invention.
It should be noted that the foregoing is only a preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will appreciate that the embodiments of the present invention are not limited to the specific embodiments described herein, and that various obvious changes, adaptations, and substitutions are possible, without departing from the scope of the embodiments of the present invention. Therefore, although the embodiments of the present invention have been described in more detail through the above embodiments, the embodiments of the present invention are not limited to the above embodiments, and many other equivalent embodiments may be included 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 (14)

1. The back-end service calling method is characterized by comprising the following steps:
selecting one of a plurality of candidate backend services in response to a user request;
comparing the recorded calling parameter value of the back-end service with an access threshold value, and calling the back-end service if the comparison result meets the access condition;
and updating the calling parameter value.
2. The method of claim 1, wherein the updating the call parameter value comprises:
and if the back-end service is successfully called, updating the calling parameter value according to a first formula.
3. The method according to claim 1 or 2, characterized in that if the backend service call fails, the call parameter values are updated according to a second formula;
reselecting one of the plurality of candidate backend services.
4. The method of claim 3, wherein reselecting a backend service from among the plurality of candidate backend services comprises:
and determining whether to reselect the back-end service according to the attribute of the user request, and if so, reselecting one back-end service from the candidate back-end services.
5. The method according to claim 1 or 2, characterized in that if the comparison result does not satisfy the access condition, the calling parameter value is updated according to a third formula;
skipping the backend services, and reselecting one of the candidate backend services.
6. The method of claim 1, wherein the access condition comprises the invocation parameter value not being greater than the access threshold.
7. The method of claim 6, wherein the updating the call parameter value comprises: and reducing the calling parameter value.
8. The method of claim 7, further comprising, after said reducing said call parameter value:
and if the reduced calling parameter value is smaller than the preset minimum value, determining the preset minimum value as the calling parameter value.
9. Method according to any of claims 6-8, wherein the call parameter value is increased if the call fails.
10. The method of claim 9, wherein the increasing the call parameter value comprises:
and multiplying the calling parameter value by an access coefficient and adding a preset constant value to obtain an updated calling parameter value, wherein the access coefficient is greater than 1.
11. The method according to any of claims 6-8, wherein the value of the invocation parameter is decreased if the comparison result does not satisfy the access condition.
12. A back-end service invocation device, comprising:
a service acquisition module, configured to select a backend service from a plurality of candidate backend services in response to a user request;
the service calling module is used for comparing the recorded calling parameter value of the back-end service with an access threshold value, and calling the back-end service if the comparison result meets the access condition;
and the data updating module is used for updating the calling parameter value.
13. A back-end service invocation apparatus, the apparatus comprising: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the back-end service invocation method of any of claims 1-11.
14. A storage medium containing computer-executable instructions for performing the back-end service invocation method recited in any one of claims 1-11 when executed by a computer processor.
CN202011112164.5A 2020-10-16 2020-10-16 Back-end service calling method, device, equipment and storage medium Pending CN112379978A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011112164.5A CN112379978A (en) 2020-10-16 2020-10-16 Back-end service calling method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011112164.5A CN112379978A (en) 2020-10-16 2020-10-16 Back-end service calling method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112379978A true CN112379978A (en) 2021-02-19

Family

ID=74580050

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011112164.5A Pending CN112379978A (en) 2020-10-16 2020-10-16 Back-end service calling method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112379978A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110205586A1 (en) * 2010-02-22 2011-08-25 Canon Kabushiki Kaisha Printing system, cloud computing system, printing system control method, and storage medium
CN109862052A (en) * 2017-11-30 2019-06-07 中国移动通信集团安徽有限公司 Call method, device, computer equipment and the storage medium of service request

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110205586A1 (en) * 2010-02-22 2011-08-25 Canon Kabushiki Kaisha Printing system, cloud computing system, printing system control method, and storage medium
CN109862052A (en) * 2017-11-30 2019-06-07 中国移动通信集团安徽有限公司 Call method, device, computer equipment and the storage medium of service request

Similar Documents

Publication Publication Date Title
CN109104336B (en) Service request processing method and device, computer equipment and storage medium
CN110096336B (en) Data monitoring method, device, equipment and medium
US8572621B2 (en) Selection of server for relocation of application program based on largest number of algorithms with identical output using selected server resource criteria
EP3432157B1 (en) Data table joining mode processing method and apparatus
US11438271B2 (en) Method, electronic device and computer program product of load balancing
CN111274026A (en) Load balancing method and device and electronic equipment
US20220035666A1 (en) Method and apparatus for data processing, server and storage medium
CN108897858B (en) Distributed cluster index fragmentation evaluation method and device and electronic equipment
CN111159131A (en) Performance optimization method, device, equipment and computer readable storage medium
CN111382141B (en) Master-slave architecture configuration method, device, equipment and computer readable storage medium
CN112650449A (en) Release method and release system of cache space, electronic device and storage medium
JP2007328413A (en) Method for distributing load
CN112379978A (en) Back-end service calling method, device, equipment and storage medium
CN115190010B (en) Distributed recommendation method and device based on software service dependency relationship
CN111143210A (en) Test task scheduling method and system
CN115563160A (en) Data processing method, data processing device, computer equipment and computer readable storage medium
CN116126719A (en) Interface testing method and device, electronic equipment and storage medium
US20090168092A1 (en) Job management and scheduling method for network system
CN113342893B (en) Node synchronization method and device based on block chain, storage medium and server
CN111865722B (en) Node health state detection and processing method
CN110083438B (en) Transaction distribution method, device, equipment and storage medium
CN110175182B (en) Data checking method and device
CN111061712A (en) Data connection operation processing method and device
CN116701410B (en) Method and system for storing memory state data for data language of digital networking
CN109885330B (en) Virtual machine generation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination