CN106209737B - Control the method and apparatus that remote service calls frequency - Google Patents

Control the method and apparatus that remote service calls frequency Download PDF

Info

Publication number
CN106209737B
CN106209737B CN201510221800.0A CN201510221800A CN106209737B CN 106209737 B CN106209737 B CN 106209737B CN 201510221800 A CN201510221800 A CN 201510221800A CN 106209737 B CN106209737 B CN 106209737B
Authority
CN
China
Prior art keywords
duration
practical
called
transaction information
time
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.)
Active
Application number
CN201510221800.0A
Other languages
Chinese (zh)
Other versions
CN106209737A (en
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.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201510221800.0A priority Critical patent/CN106209737B/en
Publication of CN106209737A publication Critical patent/CN106209737A/en
Application granted granted Critical
Publication of CN106209737B publication Critical patent/CN106209737B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Telephonic Communication Services (AREA)

Abstract

The invention discloses a kind of methods that control remote service calls frequency, comprising: determines the expection duration for initiating to call every time;Statistics initiates the practical duration called every time;Judge whether the practical duration is less than the expected duration;When the practical duration is less than the expected duration, into dormant state, the duration of the dormant state is within the scope of the expected duration subtracts the maximum deviation of the difference of the practical duration.When initiating the practical duration called less than expected duration, the time difference of practical duration and expected duration is made up by suspend mode, postponement continues initiation and calls next time, calls frequency to achieve the effect that accurately to control.

Description

Control the method and apparatus that remote service calls frequency
Technical field
The invention belongs to field of computer technology, specifically, being related to a kind of method that control remote service calls frequency And device.
Background technique
In the scene of system interaction, some underlying system can give upper-level system one since the process performance of itself limits The threshold reference max_freq of a calling amount per second, if upper-level system is to the calling of underlying system service always greater than this frequency Rate, the pressure of handling up that will result in underlying system is excessive, response cycle is elongated, will lead to system crash when serious.Therefore, upper layer System needs the calling frequency to draw oneself up to be no more than this threshold value as far as possible.
Mainly take two methods in the prior art: one is the current limliting setting using clean cut formula, system settings one The quantity max_limit of a current limliting per second, this value may be configured as being equal to or less times greater than max_freq.Then per second under The calling amount of layer system is counted, when be less than or equal to it when can be normally carried out callings, beyond just forced when it without tune With and directly return to failure.But the shortcomings that this method is to be easy to cause to utilize unbalanced, task to the calling amount between system Just there is excessive calling amount when starting and be easy to cause failure, later period calling amount becomes sparse again.Such as calling amount shown in FIG. 1 Curve, the current limliting upper limit are set as 100tps, and darker curve is actual calling amount curve, and lighter curve is that upper-level system is planned to The calling amount curve of execution, it can be seen that calling amount, which excessively high can cause part to be called, when just starting to succeed, and the later period calls Measuring too low causes the utilization rate for exchanging dosage too low.Another method is adjustment number of threads, by increase to Thread Count or It reduces to control the increase and reduction of calling amount.But the shortcomings that this method, calling amount only pressed the ratio of thread first is that inaccurate Example control, for example 9 threads are reduced to from 10 threads, calling amount will be reduced 1/10, and be unable to control even more thin to 1/100 Granularity;Second is that transformation is more complicated, more threads and a few thread all can generate very big be transformed into regulative strategy This.In short, above-mentioned call the control method of frequency too simple rough upper-level system, the calling amount utilization rate between system It is lower.
Summary of the invention
In view of this, solving upper layer this application provides a kind of method and apparatus that control remote service calls frequency System accurately cannot voluntarily adjust the technical issues of calling frequency.
In order to solve the above-mentioned technical problem, this application discloses a kind of methods that control remote service calls frequency, comprising: Determine the expection duration for initiating to call every time;Statistics initiates the practical duration called every time;Judge whether the practical duration is small In the expected duration;When the practical duration is less than the expected duration, into dormant state, the dormant state is held Continuous duration is within the scope of the expected duration subtracts the maximum deviation of the difference of the practical duration.
The expection duration called is initiated in the determination every time, comprising: according to the number of threads for initiating to call and called system The maximum of system calls frequency, determines the expected duration.
The expected duration expect_time=1 ÷ max_freq × thread_num;Wherein, max_freq represents institute It states the maximum of called system and calls frequency, thread_num represents the number of threads for initiating to call.
The statistics initiates the practical duration called every time, comprising: record starts to process first when each Transaction Information The second moment when moment and each complete call;Second moment is subtracted into the difference at first moment as the reality Duration.
The method also includes: at the end of the dormant state, statistics initiates the practical duration called next time.
The method also includes: when the practical duration is greater than or equal to the expected duration, statistics is initiated next time The practical duration called.
The method also includes: Transaction Information is obtained from database every predetermined period.
It is described that Transaction Information is obtained from database every predetermined period, comprising: each thread obtains Transaction Information every time Quantity data_num=max_freq × interval ÷ thread_num;Wherein, max_freq represents called system Maximum calls frequency, and thread_num represents the number of threads for initiating to call, and interval represents the predetermined period.
It is described at the end of the dormant state, or when the practical duration is greater than or equal to the expected duration Method further include: judge whether the Transaction Information obtained is all disposed;When the Transaction Information of the acquisition is not handled all When finishing, statistics initiates the practical duration called next time.
In order to solve the above-mentioned technical problem, disclosed herein as well is the device that a kind of control remote service calls frequency, packets It includes: determining module, for determining the expection duration for initiating to call every time;Statistical module, for counting the reality for initiating to call every time Border duration;First judgment module, for judging whether the practical duration is less than the expected duration;Sleep block, for working as When the practical duration is less than the expected duration, into dormant state, the duration of the dormant state is in the expection Duration subtracts within the scope of the maximum deviation of the difference of the practical duration.
The determining module comprises determining that submodule, for according to the number of threads and called system for initiating to call Maximum calls frequency, determines the expected duration.
The expected duration expect_time=1 ÷ max_freq × thread_num;Wherein, max_freq represents quilt The maximum of calling system calls frequency, and thread_num represents the number of threads for initiating to call.
The statistical module includes: record sub module, and the first moment when each Transaction Information is started to process for recording With the second moment when each complete call;Submodule is handled, for second moment to be subtracted to the difference at first moment As the practical duration.
The statistical module is further used at the end of the dormant state, and statistics initiates the reality called next time Duration.
The statistical module is further used for when the practical duration is greater than or equal to the expected duration, under statistics The primary practical duration for initiating to call.
Described device further include: module is obtained, for obtaining Transaction Information from database every predetermined period.
It is described obtain each thread of module obtain every time the quantity data_num=max_freq of Transaction Information × interval÷thread_num;Wherein, wherein max_freq represents the maximum of called system and calls frequency, thread_ Num represents the number of threads for initiating to call, and interval represents the predetermined period.
Described device further include: the second judgment module, at the end of working as the dormant state, or when described practical When length is greater than or equal to the expected duration, judge whether the Transaction Information obtained is all disposed;The statistical module, into One step is used for when the Transaction Information of the acquisition is not disposed all, and statistics initiates the practical duration called next time.
Compared with prior art, the application can be obtained including following technical effect: the practical duration for initiating to call is less than It is expected that making up the time difference of practical duration and expected duration by suspend mode when duration, postponement continues to initiate to call next time, from And achievees the effect that accurately to control and call frequency.
Certainly, any product for implementing the application must be not necessarily required to reach all the above technical effect simultaneously.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present application, constitutes part of this application, this Shen Illustrative embodiments and their description please are not constituted an undue limitation on the present application for explaining the application.In the accompanying drawings:
Fig. 1 is calling amount curve synoptic diagram when being controlled in the prior art using current-limit mode;
Fig. 2 is the flow diagram for the method that a kind of control remote service provided by the embodiments of the present application calls frequency.
Fig. 3 is to call the calling amount curve when method of frequency to show using control remote service provided by the embodiments of the present application It is intended to;
Fig. 4 is the application scenarios schematic diagram of the embodiment of the present application;
Fig. 5 is the flow diagram for the method that a kind of control remote service provided by the embodiments of the present application calls frequency.
Fig. 6 is the flow diagram for the method that a kind of control remote service provided by the embodiments of the present application calls frequency.
Fig. 7 is the structural schematic diagram for the device that a kind of control remote service provided by the embodiments of the present application calls frequency.
Specific embodiment
Carry out the embodiment that the present invention will be described in detail below in conjunction with accompanying drawings and embodiments, how the present invention is applied whereby Technological means solves technical problem and reaches the realization process of technical effect to fully understand and implement.
Fig. 2 is a kind of method that control remote service calls frequency provided by the embodiments of the present application, is suitable for server system System, this approach includes the following steps.
In step slo, the expection duration for initiating to call every time is determined.
Server system calls frequency max_freq according to the maximum of called system, determines the expection for initiating to call every time Duration.The a length of fixed value when expection represents the time interval between the calling twice initiated to the system that is called.
In step s 11, statistics initiates the practical duration called every time.
A length of each process practical duration expended for initiating to call when this is practical.
In step s 12, judge whether practical duration is less than expected duration;
Since the expection duration is determining according to the maximum calling frequency for the system of being called, so if call every time Practical duration is both less than the expection duration, then the actual maximum calling frequency for calling frequency that can be higher than called system, can lead Cause the pressure of handling up of called system excessive.
In step s 13, when length is less than expected duration when practical, into dormant state, the duration of dormant state Within the scope of the maximum deviation for the difference that expected duration subtracts practical duration.
Practical maximum the case where calling frequency for calling frequency to be higher than called system, occurs in order to prevent, calls when each Practical duration when being less than expected duration, force local system to enter dormant state.The duration of the dormant state is in expection Duration subtracts within the scope of the maximum deviation of the difference of practical duration.That is the duration of the dormant state can be expected duration and subtract Go the difference or the slightly larger or slightly smaller difference that practical duration is subtracted in the expection duration of practical duration.When dormant state it is lasting when It is long when being slightly less than expected duration and subtracting the difference of practical duration, it is possible to will appear practical callings frequency slightly larger than the system of being called Maximum calls the situation of frequency, so as to cause system trigger current limliting strategy.Accordingly, it is preferred that the duration of dormant state should wait The difference of practical duration is subtracted in or slightly larger than expected duration, and the maximum deviation range should not be too large, if the maximum deviation Range, which crosses conference, reduces the utilization rate of flow system flow, which preferably subtracts the difference of practical duration in the expection duration ± 2% within.For example, call every time expection when a length of 100ms, i.e., call twice between expected time interval be 100ms, it is current complete once to call it is practical when a length of 80ms, then be expected duration and subtract the difference of practical duration to be 20ms, it is contemplated that The maximum deviation range that duration subtracts the difference of practical duration is 19.96ms-20.04ms, in order to avoid triggering the current limliting plan of system Slightly, the duration of dormant state is preferably in 20ms-20.04ms.
When the practical duration called every time is less than expected duration, the time between expected duration is made up by suspend mode Difference prevents practical calling frequency to be higher than the maximum calling frequency of called system to accurately control local calling frequency Situation occurs.
When length is greater than or equal to expected duration when practical, then return step S11, continues statistics and initiates calling next time Practical duration;After the dormant state in step S13, return step S11 continues statistics and initiates the reality called next time Duration.
The method for calling frequency using above-mentioned control remote service initiates calling amount curve when calling to called system For schematic diagram as shown in figure 3, compared with the calling amount curve shown in FIG. 1 used under current-limit mode in the prior art, the application is real The method that the control remote service for applying example offer calls frequency can generate more reasonable calling amount utilizing status, can only there is timing Brought slight calling amount loss when being adjusted between task switching for the protection of global data capacity, if timing is appointed Being engaged in, the period is longer, and the number of adjustment is fewer, and the loss of this calling amount also can be fewer.Calling amount is by being called system most Continue dynamic below the big numerical value for calling frequency to be limited to adjust, current-limit mode will not be triggered and come into force, realize and exchange dosage Smoothing processing more fully utilizes the calling amount between this system and called system.
Fig. 4 is the application scenarios schematic diagram for the method that control remote service provided by the embodiments of the present application calls frequency, packet Include database and system A and system B.System A obtains Transaction Information according to predetermined period from database, by local data After processing, then the remote service function of far call system B completes subsequent data processing.Wherein, system B is as system A's Underlying system provides remote service function to system A, provides maximum call to system A according to the performance of the remote service function Frequency max_freq;System A is obtained from database by the way of multi-threading parallel process every predetermined period interval A collection of Transaction Information, and the remote service function provided to system B initiate to call.System A initiates the thread called to system B Quantity is thread_num, then per thread once obtains quantity data_num=max_freq × interval of Transaction Information ÷thread_num.By being called frequency max_freq to be limited by the maximum of system B, system A is every predetermined period interval The Transaction Information amount obtained from database should be less than or be equal to max_freq × interval, i.e., calls frequency max_ with the maximum On the basis of freq, the maximum transaction data volume that B system is able to bear in this duration of predetermined period interval is obtained.System A unite according to the mode of multi-threading parallel process, then per thread once obtains the quantity data_num=max_ of Transaction Information Freq × interval ÷ thread_num, the Transaction Information amount for obtaining system A every predetermined period is all in the receiving of system B Within ability.For example, maximum frequency max_freq=100tps (Transactions Per Second, thing that system B is provided Number of being engaged in is per second), system A obtains the predetermined period interval=1s of data from database, and by 10 thread parallels from Database obtains Transaction Information, then per thread once obtains quantity data_num=100t/s × 1s ÷ 10=of Transaction Information 10t (Transactions, number of transactions).It realizes and is controlled according to the maximum calling frequency that the system of being called provides every time from data The Transaction Information amount that library is got, it is ensured that no more than the ability to bear of underlying system.So system A is in the affairs that ensure that acquisition The frequency called is initiated it is necessary to further go to control to system B after ability to bear of the data volume no more than system B, makes calling amount It is steady controllable, the calling amount between system A and system B was both made full use of, while to prevent the tune instantaneously initiated to system B The excessively high phenomenon of dosage occurs.
For system A it needs to be determined that initiating the expection duration called every time, which represents what system A was initiated to system B Time interval between calling twice.Therefore, system A is according to the number of threads thread_num and called system for initiating to call It is maximum call frequency max_freq, determine the expection duration (time between calling twice that each thread initiates to call every time Interval) expect_time=1 ÷ max_freq × thread_num.Since the system B maximum calling frequency provided is max_ Freq, then system A should be greater than to the time interval that system B initiates to call or be equal to 1 ÷ max_freq, if system A is using more Thread parallel to system B initiate call, then per thread initiate call expection duration should be greater than or be equal to 1 ÷ max_freq × thread_num.For example, the maximum frequency max_freq=100tps that system B is provided, system A are by 10 thread parallels to being The B that unites initiates to call, then per thread initiates the expection duration expect_time=1 ÷ 100tps × 10=100ms/t called, That is minimum value of the system A per thread to the system B expection duration (initiating the time interval between calling twice) for initiating to call It should be 100ms.If practical duration is less than the expection duration, illustrating that system A has exceeded to the frequency that system B initiates to call is The endurance of system B, therefore next system A will be counted and be initiated the practical duration called to system B every time, to determine whether being more than What system B was provided maximum calls frequency.
System A statistics initiates the method for the practical duration called as shown in figure 5, including the following steps every time.
In step S20, record starts to process the first moment when each Transaction Information.
Since the expection duration for initiating to call every time refers to the time interval between calling twice, hair every time is counted It, be at the beginning system A including consumed duration calculation when acting the practical duration called system A processing Transaction Information First moment is recorded when managing each Transaction Information, as the initial time for calculating practical duration.When system A uses multithreading simultaneously When capable mode is initiated to call to system B, then the first moment when each thread starts to process each Transaction Information is recorded.
In the step s 21, system A handles Transaction Information.
In step S22, system A initiates far call to system B.
In step S23, the second moment when the far call of the complete paired systems B of system A is recorded.
Second moment is as the finish time for calculating practical duration.
In step s 24, it regard the difference that the second moment subtracted for the first moment as practical duration.
In step s 25, judge whether practical duration is less than expected duration.When length is less than expected duration when practical, hold Row step S26;When length is greater than or equal to expected duration when practical, return step S20.
In step S26, system A enters dormant state, and the duration of the dormant state subtracts reality in expected duration Within the scope of the maximum deviation of the difference of duration.
When practical duration is less than expected duration, current calling frequency is represented higher than the maximum of system B and calls frequency, system The pressure of handling up of B can be excessive.In order to delay system A initiation to call next time, system A is forced to enter dormant state, to make up reality Time difference between border duration and expected duration.When the duration of dormant state reaches the difference that expected duration subtracts practical duration When, terminate the dormant state, starts statistics and initiate the practical duration called, i.e. return step S20 next time, record is opened next time The first moment when the processing Transaction Information that begins.When practical duration is greater than or equal to expected duration, it is small to represent current calling frequency Frequency is called in or equal to the maximum of system B, within the ability to bear in system B, can initiate to call next time immediately, this When start statistics and initiate the practical duration called next time, i.e. return step S20, record is when starting to process Transaction Information next time The first moment.
In one embodiment, after the dormant state in step S26 terminates, or reality is judged in step s 25 Before border duration needs return step S20 more than or equal to expected duration, as shown in fig. 6, further comprising the steps of.
In step s 27, system A judges whether the Transaction Information obtained is all disposed.When the Transaction Information of acquisition When being all disposed, then terminate this process;When the Transaction Information of acquisition is not disposed all, return step S20.It is logical The auxiliary of step S27 is crossed, system A can more accurately control the treatment process to the Transaction Information of acquisition, it is ensured that acquisition Transaction Information can be handled in time, also guarantee the treatment effeciency of Transaction Information while the calling amount of held stationary.
It can prevent from shaking because of network transmission state or the data processing performance of itself using above-mentioned process flow And there is instantaneous calling and measure excessively high situation.For example, it is no using above-mentioned process flow in the case where, system A and system B it Between network transmission performance decline suddenly, system A can be made to initiate the time spent by far call to system B and increased, and when being Network transmission performance between system A and system B restores suddenly again when, it may appear that system A is instantaneously initiating multiple call to system B The case where, call frequency in the maximum calling frequency that can be instantaneously higher than system B offer, and above-mentioned process flow is used, energy When there is above situation, calling frequency of the system A to system B is controlled within the ability to bear of system B.Similarly, when being When the data processing performance of system A itself is shaken, it also can be avoided by above-mentioned process flow and system A occur to system B's Call frequency in instantaneous excessively high situation.
Fig. 7 is the device that control remote service provided in an embodiment of the present invention calls frequency, comprising:
Determining module 30, for determining the expection duration for initiating to call every time;
Statistical module 31, for counting the practical duration for initiating to call every time;
First judgment module 32, for judging whether practical duration is less than expected duration;
Sleep block 33, for when practical it is long be less than expected duration when, into dormant state, dormant state it is lasting when It grows within the scope of the maximum deviation for the difference that expected duration subtracts practical duration.
The determining module packet 30 comprises determining that submodule, for according to the number of threads and called system for initiating to call It is maximum call frequency, determine expected duration.
Expection duration expect_time=1 ÷ max_freq × thread_num;Wherein, max_freq representative is adjusted Maximum with system calls frequency, and thread_num represents the number of threads for initiating to call.
The statistical module 31 includes: record sub module, for record every time initiate call when the first moment and every time it is complete At the second moment when calling;Submodule is handled, the difference for the second moment to be subtracted for the first moment is used as practical duration.
In one embodiment, the statistical module 31 is further used at the end of the dormant state, and statistics is next time Initiate the practical duration called;When the practical duration is greater than or equal to the expected duration, statistics is initiated to call next time Practical duration.
The device further includes obtaining module 34, for obtaining Transaction Information from database every predetermined period.The acquisition Module 34 obtains quantity data_num=max_freq × interval ÷ thread_num of Transaction Information every time;Wherein, Max_freq represents the maximum of called system and calls frequency, and thread_num represents the number of threads for initiating to call, Interval represents the predetermined period.
In one embodiment, the device further include: the second judgment module 35, at the end of working as dormant state, or When length is greater than or equal to expected duration when practical, judge whether the Transaction Information obtained is all disposed;
The then statistical module 31 is further used for when the Transaction Information of acquisition is not disposed all, and statistics is next time Initiate the practical duration called.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flashRAM).Memory is showing for computer-readable medium Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data. The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM), Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates Machine readable medium does not include non-temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
As used some vocabulary to censure specific components in the specification and claims.Those skilled in the art answer It is understood that hardware manufacturer may call the same component with different nouns.This specification and claims are not with name The difference of title is as the mode for distinguishing component, but with the difference of component functionally as the criterion of differentiation.Such as logical The "comprising" of piece specification and claim mentioned in is an open language, therefore should be construed to " include but do not limit In "." substantially " refer within the acceptable error range, those skilled in the art can within a certain error range solve described in Technical problem basically reaches the technical effect.In addition, " coupling " word includes any direct and indirect electric property coupling herein Means.Therefore, if it is described herein that a first device is coupled to a second device, then representing the first device can directly electrical coupling It is connected to the second device, or the second device indirectly electrically coupled through other devices or coupling means.Specification Subsequent descriptions are to implement better embodiment of the invention, so the description be for the purpose of illustrating rule of the invention, The range being not intended to limit the invention.Protection scope of the present invention is as defined by the appended claims.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability Include, so that commodity or system including a series of elements not only include those elements, but also including not clear The other element listed, or further include for this commodity or the intrinsic element of system.In the feelings not limited more Under condition, the element that is limited by sentence "including a ...", it is not excluded that in the commodity or system for including the element also There are other identical elements.
Several preferred embodiments of the invention have shown and described in above description, but as previously described, it should be understood that the present invention Be not limited to forms disclosed herein, should not be regarded as an exclusion of other examples, and can be used for various other combinations, Modification and environment, and the above teachings or related fields of technology or knowledge can be passed through within that scope of the inventive concept describe herein It is modified.And changes and modifications made by those skilled in the art do not depart from the spirit and scope of the present invention, then it all should be in this hair In the protection scope of bright appended claims.

Claims (14)

1. a kind of method that control remote service calls frequency characterized by comprising
Frequency is called according to the maximum of the number of threads and called system initiating to call, when determining the expection for initiating calling every time It is long;
Temporal information when temporal information and calling when being started to process according to Transaction Information are completed, counts and initiates calling every time Practical duration;
Judge whether the practical duration is less than the expected duration;
When the practical duration is less than the expected duration, into dormant state, the duration of the dormant state is in institute Within the scope of the maximum deviation for stating the difference that expected duration subtracts the practical duration;
When the practical duration is greater than or equal to the expected duration, statistics initiates the practical duration called next time.
2. the method as described in claim 1, which is characterized in that the expected duration expect_time=1 ÷ max_freq × thread_num;Wherein, max_freq represents the maximum of the called system and calls frequency, and thread_num represents the hair Act the number of threads called.
3. the method as described in claim 1, which is characterized in that temporal information when being started to process according to Transaction Information and Temporal information when completing is called, the practical duration for initiating to call every time is counted, comprising:
Record the second moment when the first moment and each complete call when starting to process each Transaction Information;
Second moment is subtracted into the difference at first moment as the practical duration.
4. the method as described in claim 1, which is characterized in that the method also includes:
At the end of the dormant state, statistics initiates the practical duration called next time.
5. the method as described in claim 1, which is characterized in that the method also includes:
Transaction Information is obtained from database every predetermined period.
6. method as claimed in claim 5, which is characterized in that described to obtain number of transactions from database every predetermined period According to, comprising:
Each thread obtains quantity data_num=max_freq × interval ÷ thread_num of Transaction Information every time;Its In, max_freq represents the maximum of called system and calls frequency, and thread_num represents the number of threads for initiating to call, Interval represents the predetermined period.
7. method as claimed in claim 5, which is characterized in that at the end of the dormant state, or when described practical When length is greater than or equal to the expected duration, the method also includes:
Judge whether the Transaction Information obtained is all disposed;
When the Transaction Information of the acquisition is not disposed all, statistics initiates the practical duration called next time.
8. the device that a kind of control remote service calls frequency characterized by comprising
Determining module determines hair every time for calling frequency according to the maximum of the number of threads and called system for initiating to call Act the expection duration called;
Statistical module, temporal information when temporal information and calling when for being started to process according to Transaction Information are completed, statistics The practical duration called is initiated every time;
First judgment module, for judging whether the practical duration is less than the expected duration;
Sleep block is used for when the practical duration is less than the expected duration, into dormant state, the dormant state Duration is within the scope of the expected duration subtracts the maximum deviation of the difference of the practical duration;
The statistical module is further used for when the practical duration is greater than or equal to the expected duration, and statistics is next time Initiate the practical duration called.
9. device as claimed in claim 8, which is characterized in that the expected duration expect_time=1 ÷ max_freq × thread_num;Wherein, max_freq represents the maximum of the system of being called and calls frequency, and thread_num, which is represented, initiates calling Number of threads.
10. device as claimed in claim 8, which is characterized in that the statistical module includes:
Second when record sub module, the first moment when starting to process each Transaction Information for recording and each complete call Moment;
Submodule is handled, for be subtracted to the difference at first moment as the practical duration second moment.
11. device as claimed in claim 8, which is characterized in that
The statistical module is further used at the end of the dormant state, and statistics initiates the practical duration called next time.
12. device as claimed in claim 8, which is characterized in that described device further include:
Module is obtained, for obtaining Transaction Information from database every predetermined period.
13. device as claimed in claim 12, which is characterized in that each thread of the acquisition module obtains Transaction Information every time Quantity data_num=max_freq × interval ÷ thread_num;Wherein, wherein max_freq represents called system The maximum of system calls frequency, and thread_num represents the number of threads for initiating to call, and interval represents the predetermined period.
14. device as claimed in claim 12, which is characterized in that described device further include:
Second judgment module, at the end of working as the dormant state, or when the practical duration is more than or equal to described pre- When phase duration, judge whether the Transaction Information obtained is all disposed;
The statistical module is further used for when the Transaction Information of the acquisition is not disposed all, and statistics is sent out next time Act the practical duration called.
CN201510221800.0A 2015-05-04 2015-05-04 Control the method and apparatus that remote service calls frequency Active CN106209737B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510221800.0A CN106209737B (en) 2015-05-04 2015-05-04 Control the method and apparatus that remote service calls frequency

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510221800.0A CN106209737B (en) 2015-05-04 2015-05-04 Control the method and apparatus that remote service calls frequency

Publications (2)

Publication Number Publication Date
CN106209737A CN106209737A (en) 2016-12-07
CN106209737B true CN106209737B (en) 2019-11-05

Family

ID=57458768

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510221800.0A Active CN106209737B (en) 2015-05-04 2015-05-04 Control the method and apparatus that remote service calls frequency

Country Status (1)

Country Link
CN (1) CN106209737B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113127216A (en) * 2019-12-30 2021-07-16 北京达佳互联信息技术有限公司 Service request processing method, device, server and storage medium
CN111245822B (en) * 2020-01-08 2023-03-14 北京小米松果电子有限公司 Remote procedure call processing method and device and computer storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0726688A1 (en) * 1995-02-07 1996-08-14 Nokia Mobile Phones Ltd. Radio telephone
CN101957729A (en) * 2010-09-27 2011-01-26 中兴通讯股份有限公司 Logical block transformation method and method and device compatible with reading and writing of user based on same
CN102325148A (en) * 2011-05-25 2012-01-18 重庆新媒农信科技有限公司 WebService service calling method
CN103282854A (en) * 2010-12-21 2013-09-04 英特尔公司 System and method for power management

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0726688A1 (en) * 1995-02-07 1996-08-14 Nokia Mobile Phones Ltd. Radio telephone
CN101957729A (en) * 2010-09-27 2011-01-26 中兴通讯股份有限公司 Logical block transformation method and method and device compatible with reading and writing of user based on same
CN103282854A (en) * 2010-12-21 2013-09-04 英特尔公司 System and method for power management
CN102325148A (en) * 2011-05-25 2012-01-18 重庆新媒农信科技有限公司 WebService service calling method

Also Published As

Publication number Publication date
CN106209737A (en) 2016-12-07

Similar Documents

Publication Publication Date Title
US11526889B2 (en) Resource transferring monitoring method and device
US10700994B2 (en) Multi-tenant throttling approaches
JP6495327B2 (en) Fine-grained bandwidth provisioning in memory controllers
US9081623B1 (en) Service resource allocation
CN105024933B (en) The control method and device of request packet transmission frequency
US10678596B2 (en) User behavior-based dynamic resource capacity adjustment
US8683472B2 (en) Adjusting thread priority to optimize computer system performance and the utilization of computer system resources
CN109064327B (en) Intelligent contract processing method, device and equipment
US8705307B2 (en) Memory system with dynamic refreshing
CN108111554B (en) Control method and device for access queue
US9305274B2 (en) Traffic shaping based on request resource usage
CN102521265B (en) Dynamic consistency control method in massive data management
CN109144700A (en) Determination method, apparatus, server and the data processing method of overtime duration
CN112463066B (en) Method and equipment for controlling burst service quality of distributed block storage logical volume
CN109739627B (en) Task scheduling method, electronic device and medium
US10305974B2 (en) Ranking system
CN106209737B (en) Control the method and apparatus that remote service calls frequency
CN106155646B (en) Method and device for limiting external application program to call service
WO2016058414A1 (en) Method and device for processing terminal application
CN107220165A (en) The method and apparatus of pressure test on a kind of artificial line
WO2022016845A1 (en) Multi-node monitoring method and apparatus, electronic device, and storage medium
CN104407917B (en) A kind of transaction processing method and device based on JMS
CN104933079B (en) A kind of browser clocking method and system
WO2023193527A1 (en) Thread execution method and apparatus, electronic device, and computer-readable storage medium
CN116489103A (en) Service flow limiting method, device and service processing system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1231272

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British Islands

Patentee after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British Islands

Patentee before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British Islands

Patentee after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: Alibaba Group Holding Ltd.

TR01 Transfer of patent right