CN110535776A - Gateway current-limiting method, device, gateway, system and storage medium - Google Patents

Gateway current-limiting method, device, gateway, system and storage medium Download PDF

Info

Publication number
CN110535776A
CN110535776A CN201910613993.2A CN201910613993A CN110535776A CN 110535776 A CN110535776 A CN 110535776A CN 201910613993 A CN201910613993 A CN 201910613993A CN 110535776 A CN110535776 A CN 110535776A
Authority
CN
China
Prior art keywords
current limliting
unit
plug
limliting plug
current
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.)
Granted
Application number
CN201910613993.2A
Other languages
Chinese (zh)
Other versions
CN110535776B (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.)
Zhongchang (hangzhou) Information Technology Co Ltd
China Mobile Communications Group Co Ltd
Original Assignee
Zhongchang (hangzhou) Information Technology Co Ltd
China Mobile Communications Group 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 Zhongchang (hangzhou) Information Technology Co Ltd, China Mobile Communications Group Co Ltd filed Critical Zhongchang (hangzhou) Information Technology Co Ltd
Priority to CN201910613993.2A priority Critical patent/CN110535776B/en
Publication of CN110535776A publication Critical patent/CN110535776A/en
Application granted granted Critical
Publication of CN110535776B publication Critical patent/CN110535776B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present embodiments relate to information technology fields, disclose a kind of gateway current-limiting method, device, gateway, system and storage medium, it include: that the current limliting plug-in unit being locally located is started by list with predetermined period, synchronized update is that the current limliting plug-in unit being arranged in database starts list;Wherein, the current limliting plug-in unit starting list is used to indicate each current limliting plug-in unit that need to start, and each current limliting plug-in unit respectively corresponds a current limliting strategy;Start list according to the updated current limliting plug-in unit, runs each current limliting plug-in unit that need to start and carry out current limliting.Gateway current-limiting method, device, gateway, system and the storage medium provided in embodiment of the present invention, can be improved the efficiency of gateway current limliting policy update.

Description

Gateway current-limiting method, device, gateway, system and storage medium
Technical field
The present embodiments relate to information technology field, in particular to a kind of gateway current-limiting method, device, gateway, system And storage medium.
Background technique
In order to guarantee network steady fixed sum data library normal use, need to implement network when user concurrent number is larger Current limliting.Currently used current-limiting method has the modes such as token bucket, leaky bucket, counter.
At least there are the following problems in the prior art for inventor's discovery: when current limliting strategy needs to change, traditional method It needs to test under advanced line, after being successfully tested under line, the change of current limliting strategy, limit is carried out after being restarted in the system free time The update of Flow Policy is inflexible, and efficiency is lower.
Summary of the invention
Be designed to provide a kind of gateway current-limiting method, device, gateway, system and the storage of embodiment of the present invention are situated between Matter, so that the efficiency of the update of current limliting strategy improves.
In order to solve the above technical problems, embodiments of the present invention provide a kind of gateway current-limiting method, comprising: with default The current limliting plug-in unit being locally located is started list by the period, and synchronized update is that the current limliting plug-in unit being arranged in database starts list;Its In, the starting list of current limliting plug-in unit is used to indicate each current limliting plug-in unit that need to start, and each current limliting plug-in unit respectively corresponds a current limliting strategy;Root Start list according to updated current limliting plug-in unit, each current limliting plug-in unit that running need to start carries out current limliting.
Embodiments of the present invention additionally provide a kind of gateway current-limiting apparatus, comprising: starting list maintenance module, for The current limliting plug-in unit being locally located is started list by predetermined period, and synchronized update is the current limliting plug-in unit starting column being arranged in database Table;Wherein, current limliting plug-in unit starting list is used to indicate each current limliting plug-in unit that need to start, and each current limliting plug-in unit respectively corresponds a current limliting plan Slightly;Current limliting module, for starting list according to updated current limliting plug-in unit, each current limliting plug-in unit that running need to start carries out current limliting.
Embodiments of the present invention additionally provide a kind of gateway, comprising: at least one processor;And at least one The memory of processor communication connection;Wherein, memory is stored with the instruction that can be executed by least one processor, instructs by extremely A few processor executes, so that at least one processor is able to carry out above-mentioned gateway current-limiting method.
Embodiments of the present invention additionally provide a kind of gateway current limiting system, comprising: database and with database communication connect The N number of above-mentioned gateway connect, wherein N is the natural number greater than zero.
Embodiments of the present invention additionally provide a kind of computer readable storage medium, are stored with computer program, calculate Machine program realizes above-mentioned gateway current-limiting method when being executed by processor.
Embodiment of the present invention in terms of existing technologies, provides a kind of gateway current-limiting method, by preset week The current limliting plug-in unit being locally located is started list by the phase, and synchronized update is that the current limliting plug-in unit being arranged in database starts list;According to Updated current limliting plug-in unit starts list, and each current limliting plug-in unit that running need to start carries out current limliting.Since each gateway node is all Current limliting is carried out with the list of identical starting plug-in unit, therefore the starting current limliting plug-in unit of each node can be made always consistent, Moreover, indicating to need current limliting plug-in unit to be started in such a way that current limliting plug-in unit starts list, flexibility ratio is high, can be realized without restarting The update of current limliting strategy and update efficiency that is synchronous, therefore improving current limliting strategy.
In addition, described start list according to the updated current limliting plug-in unit, each current limliting plug-in unit that need to start is run Current limliting is carried out, is specifically included: if the current limliting plug-in unit starting list before the update, the relatively described updated current limliting plug-in unit starting List then obtains from the database and starts the current limliting plug-in unit of the missing there are the current limliting plug-in unit of missing;If it is described more Current limliting plug-in unit before new starts list, and the relatively described updated current limliting plug-in unit starts list, and there are extra current limliting plug-in units, then Stop the operation of the extra current limliting plug-in unit.Arrange the current limliting plug-in unit of gateway server and the current limliting plug-in unit starting in database Table is consistent, and realizes the update of current limliting strategy.
In addition, the current limliting plug-in unit is uploaded in the following manner in the database: obtaining the current limliting that client uploads Plug-in unit, the current limliting plug-in unit of the upload include plug-in unit starting method predetermined;The current limliting plug-in unit of the upload is carried out only One mark;By the current limliting plug-in unit after the unique identification, it is uploaded to the database.Pass through the current limliting plug-in unit to upload Unique identification is carried out, even if user has used identical title when uploading current limliting plug-in unit, gateway server can also be distinguished; Current limliting plug-in unit after unique identification is uploaded to database, database can also carry out each current limliting plug-in unit according to unique identification It distinguishes, facilitates the subsequent maintenance to current limliting plug-in unit.
In addition, gateway current-limiting method can also include: the current limliting plug-in unit start command sent in response to client, institute is obtained State the title of the current limliting plug-in unit of the need starting of current limliting plug-in unit start command instruction;If the need of the current limliting plug-in unit start command instruction The current limliting plug-in unit of starting is the current limliting plug-in unit stored in the database, then opens the need that the current limliting plug-in unit start command indicates The title of dynamic current limliting plug-in unit is added in the current limliting plug-in unit starting list being arranged in the database;It is sent out in response to client The current limliting plug-in unit sent is ceased and desisted order, obtain the current limliting plug-in unit cease and desist order instruction need stop current limliting plug-in unit title, and In the current limliting plug-in unit starting list being arranged in the database, the title of the current limliting plug-in unit that need to stop is deleted.Pass through visitor Transmission current limliting plug-in unit in family end starts or stops order, can flexibly implement corresponding current limliting strategy, improve current limliting strategy Update efficiency.
Detailed description of the invention
Fig. 1 is a flow diagram of gateway current-limiting method in first embodiment of the invention;
Fig. 2 is the exemplary diagram that current limliting plug-in unit is uploaded to database in first embodiment of the invention;
Fig. 3 is a flow diagram of gateway current-limiting method in second embodiment of the invention;
Fig. 4 is in second embodiment of the invention by an exemplary diagram of the current limliting plug-in download of missing;
Fig. 5 is the exemplary diagram for loading the current limliting plug-in unit of downloading in second embodiment of the invention;
Fig. 6 is in second embodiment of the invention by an exemplary diagram that extra current limliting plug-in unit is out of service;
Fig. 7 is in second embodiment of the invention by an exemplary diagram of the current limliting plug-in unit starting after downloading;
Fig. 8 is a specific example figure of gateway server in second embodiment of the invention;
Fig. 9 is a configuration diagram of gateway server in second embodiment of the invention;
Figure 10 is a flow diagram of gateway current-limiting method in third embodiment of the invention;
Figure 11 is a functional block diagram of gateway current-limiting apparatus in four embodiment of the invention;
Figure 12 is a structural schematic diagram of gateway in fifth embodiment of the invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with attached drawing to the present invention Each embodiment be explained in detail.However, it will be understood by those skilled in the art that in each embodiment party of the present invention In formula, in order to make the reader understand this application better, many technical details are proposed.But even if without these technical details And various changes and modifications based on the following respective embodiments, the application technical solution claimed also may be implemented.With Under the division of each embodiment be for convenience, any restriction should not to be constituted to specific implementation of the invention, it is each Embodiment can be combined with each other mutual reference under the premise of reconcilable.
The first embodiment of the present invention is related to a kind of gateway current-limiting methods.It in the present embodiment, will with predetermined period The current limliting plug-in unit starting list being locally located, synchronized update are that the current limliting plug-in unit being arranged in database starts list;Wherein, current limliting Plug-in unit starting list is used to indicate each current limliting plug-in unit that need to start, and each current limliting plug-in unit respectively corresponds a current limliting strategy;According to update Current limliting plug-in unit afterwards starts list, and each current limliting plug-in unit that running need to start carries out current limliting.By by the current limliting of local gateway node It is that the current limliting plug-in unit in database starts list that plug-in unit, which starts list update, starts column according to updated local current limliting plug-in unit Table runs each current limliting plug-in unit, and the update of current limliting strategy can be completed without carrying out restarting for system, improve the update of current limliting strategy Efficiency and inclusiveness to each current-limiting mode.
The realization details of the gateway current-limiting method of present embodiment is specifically described below, the following contents is only side The realization details of offer is just provided, the necessary of this programme is not implemented.
It should be noted that the database in some embodiments of the present invention can be distributed key value to storing data Library, such as Redis, or other databases, embodiment of the present invention are not particularly limited this.
The flow diagram of gateway current-limiting method in present embodiment as shown in Figure 1, specifically includes the following steps:
Step 101: judging whether to reach prefixed time interval.
It should be noted that the executing subject of present embodiment can be gateway server, optionally, gateway service utensil Body can take device for API gateway, wherein gateway server represents a gateway node, and each gateway node is connected with database It connects, for realizing the access of access, server to database or the current limliting of other situations, guarantees the steady of network and database It is fixed.
Wherein, prefixed time interval can be configured according to actual needs, and present embodiment is not particularly limited this.
Specifically, gateway server can be judged according to the timer of setting, if between the time arrival preset time Every then entering step 102, otherwise continue to execute step 101, reach preset time interval until the time.
Step 102: the current limliting plug-in unit being locally located being started into list, synchronized update is the current limliting plug-in unit being arranged in database Start list.
Wherein, current limliting plug-in unit refers to that access or other situations for access, server to database carry out current limliting Plug-in unit, present embodiment are not particularly limited this.One current limliting plug-in unit corresponds to a kind of current limliting strategy, and current limliting strategy includes token The modes such as bucket, leaky bucket, counter;The starting list of current limliting plug-in unit, which is used to indicate each gateway node, needs current limliting plug-in unit to be started, this The current limliting plug-in unit starting list of ground setting refers to the current limliting plug-in unit starting list for being set to each gateway node.
Optionally, the current limliting plug-in unit starting list being arranged in database is by user (such as gateway management person) according to current limliting plan Slightly carry out periodic maintenance.
Optionally, after gateway server downloads the current limliting plug-in unit starting list in database, by the current limliting plug-in unit of downloading Starting list is replaced the current limliting plug-in unit starting list of local gateway node, and the current limliting plug-in unit for completing local gateway node opens The update of dynamic list.
Step 103: list being started according to updated current limliting plug-in unit, each current limliting plug-in unit that running need to start carries out current limliting.
Optionally, gateway server, which obtains each according to the starting list of updated current limliting plug-in unit, needs current limliting to be started The title of plug-in unit runs each current limliting plug-in unit, the current limliting strategy of implementation database further according to the title of current limliting plug-in unit one by one.Its In, each current limliting plug-in unit can be downloaded to obtain by gateway server from a specified position, and be stored in gateway server, net Closing server according to the name acquiring of current limliting plug-in unit and can run current limliting plug-in unit.
After step 103 has executed, 101 are returned to step, that is, rejudges and whether reaches prefixed time interval, into Enter next circulation.
Compared with prior art, present embodiment is by judging whether to reach prefixed time interval, if then will locally set The current limliting plug-in unit starting list update set is that the current limliting plug-in unit being arranged in database starts list, according to updated current limliting plug-in unit Starting list operation needs limitation plug-in unit to be started to carry out current limliting.Present embodiment realizes the plug-in mode of hot-pluggable, Since each gateway node is all to carry out current limliting with the list of identical starting plug-in unit, the starting of each node can be made to limit It is always consistent to flow plug-in unit, moreover, indicating to need current limliting plug-in unit to be started, flexibility ratio in such a way that current limliting plug-in unit starts list Height can be realized the update of current limliting strategy and update efficiency that is synchronous, therefore improving current limliting strategy without restarting, while also mention The high inclusiveness to each current-limiting mode.
In a specific example, current limliting plug-in unit can be uploaded in database by following steps:
Step 201: obtaining the current limliting plug-in unit that client uploads, the current limliting plug-in unit of upload includes plug-in unit starting predetermined Method.
Step 202: unique identification is carried out to the current limliting plug-in unit of upload.
Step 203: by the current limliting plug-in unit after unique identification, being uploaded to database.
Referring to FIG. 2, it is the exemplary diagram that current limliting plug-in unit is uploaded to database.
Wherein, client refers to the client connecting with gateway server, for example, can be browser, APP or other is answered Use program;Plug-in unit Starting mode predetermined can be configured according to actual needs, such as be started in a manner of stark slotting Part, and plug-in unit Starting mode predetermined can be set to identical mode, or different current limliting plug-in units is different Starting mode, present embodiment is without limitation.
Wherein, unique identification, which refers to, carries out different marks to each current limliting plug-in unit, respectively corresponds each current limliting plug-in unit One mark.It is alternatively possible to timestamp is set for the current limliting plug-in unit uploaded, since timestamp is to change over time and different, Therefore unique identification can be carried out to current limliting plug-in unit with timestamp.Unique identification is carried out with current limliting plug-in unit of the timestamp to upload, Even if user has used identical title when uploading current limliting plug-in unit, gateway server can also be distinguished according to timestamp. Alternatively it is also possible to using it is other mark to current limliting plug-in unit carry out unique identification, for example, can with serial number to current limliting plug-in unit into Line identifier, present embodiment are not particularly limited this.
It optionally, when current limliting plug-in unit is uploaded to gateway server by client, is uploaded by post interface.
After the current limliting plug-in unit that client is uploaded carries out unique identification, the gateway server current limliting plug-in unit that unique identification is good It is uploaded to database.
It is understood that due to user client be carried out by the node of a certain gateway server upload current limliting insert Part, therefore other gateway nodes and the current limliting plug-in unit of not stored upload, other gateway nodes also need from database downloading on The current limliting plug-in unit of biography could load operating.
By carrying out unique identification to the current limliting plug-in unit of upload, even if user has used identical name when uploading current limliting plug-in unit Claim, gateway server can also distinguish;Current limliting plug-in unit after unique identification is uploaded to database, database can also root Each current limliting plug-in unit is distinguished according to unique identification, facilitates the subsequent maintenance to current limliting plug-in unit.Meanwhile by by current limliting plug-in unit Uniquely changed, can allow in database the current limliting plug-in unit safeguarded starting list can after current limliting update of plug-in different editions, Even if carrying out the update for having variation in the case where not updating current limliting plugin name, each gateway node can also be inserted according to current limliting Part starting list deletes legacy version current limliting plug-in unit and loads the current limliting plug-in unit of new version.
Second embodiment of the present invention is related to a kind of gateway current-limiting method, as shown in figure 3, second embodiment and first Embodiment is roughly the same, is in step 103 in place of the main distinction, i.e., starts list according to updated current limliting plug-in unit, Each current limliting plug-in unit that running need to start carries out current limliting, can specifically include following steps:
Step 1031: judging the whether relatively updated current limliting plug-in unit starting column of the current limliting plug-in unit starting list before updating Table, there are the current limliting plug-in units of missing.The current limliting plug-in unit lacked if it exists, then enter step 1032;The current limliting lacked if it does not exist Plug-in unit then enters step 1033.
Step 1032: the current limliting plug-in unit of missing is obtained and started from database.
Step 1033: judging the whether relatively updated current limliting plug-in unit starting column of the current limliting plug-in unit starting list before updating Table, there are extra current limliting plug-in units.Extra current limliting plug-in unit if it exists, then enter step 1034;Extra current limliting if it does not exist Plug-in unit, then return step 101.
Step 1034: stopping the operation of extra current limliting plug-in unit.
Optionally, the current limliting plug-in unit in the starting list of current limliting plug-in unit and database of the gateway server by itself starts list It is compared, if some current limliting plug-in unit starts in the current limliting plug-in unit of gateway server in the current limliting plug-in unit starting list in database Do not have in list, then gateway server determines that there are the current limliting plug-in unit be the current limliting plug-in unit of missing, and gateway server is from database The middle current limliting plug-in unit for downloading the missing and load operating.Optionally, it is preceding and updated that update is preserved in gateway server Current limliting plug-in unit starts list, available to lack after the current limliting plug-in unit starting list for updating front and back is compared by gateway server The current limliting plug-in unit of mistake.
Referring to FIG. 4, it is the exemplary diagram of the current limliting plug-in download that will lack to gateway server.Specifically, gateway takes Device be engaged according to the title of the current limliting plug-in unit of the current limliting plug-in unit starting list acquisition missing in database, is inserted further according to the current limliting of missing The title of part finds corresponding current limliting plug-in unit in the database, is stored in the catalogue specified to gateway server after downloading, such as In src/Plugins/otherPlugins/ catalogue.
Referring to FIG. 5, it is the exemplary diagram for the current limliting plug-in unit load that will be downloaded.Specifically, gateway server obtains to be added The current limliting plugin name (the current limliting plug-in unit for the missing downloaded) of load, according to the specified path of current limliting plugin name to be loaded (catalogue specified when downloading) load current limliting plug-in unit.
In step 1031, if the current limliting plug-in unit starting list before updating starts list relative to updated current limliting plug-in unit Do not change, then gateway server determines the current limliting plug-in unit not lacked, and enters step 1033, judges the current limliting plug-in unit before updating Starting the whether relatively updated current limliting plug-in unit starting list of list, there are extra current limliting plug-in units.
Specifically, the current limliting plug-in unit in the starting list of current limliting plug-in unit and database of the gateway server by itself starts list It is compared, if there are the current limliting plug-in unit of some current limliting plug-in unit in the database to start column in the current limliting plug-in unit starting list of itself Do not have in table, then gateway server determines that the current limliting plug-in unit is extra current limliting plug-in unit, and gateway server is by the extra current limliting Plug-in unit is out of service.
Referring to FIG. 6, it is the exemplary diagram that extra current limliting plug-in unit is out of service.Specifically, gateway server according to The current limliting plug-in unit starting list of itself obtains the title of extra current limliting plug-in unit, further according to the title time of the extra current limliting plug-in unit The routing stacks table of gateway server is gone through, if in the presence of the item of the name-matches of the current limliting plug-in unit extra with this in routing stacks table, it will The matched item is deleted.
In step 1033, if the current-limited startup list before updating does not have relative to the starting list of updated current limliting plug-in unit Extra current limliting plug-in unit, then return step 101, into recycling next time.After step 1034 has executed, step is also returned to 101。
Compared with prior art, present embodiment starts column by comparing the current limliting plug-in unit that gateway server updates front and back Table, the current limliting plug-in unit lacked if it exists, then download and run from database;Extra current limliting plug-in unit if it exists, then stop transporting The extra current limliting plug-in unit of row is consistent the current limliting plug-in unit of gateway server with the current limliting plug-in unit starting list in database, Realize the update of current limliting strategy.
In one example, step 1032, i.e., the current limliting plug-in unit that missing is obtained and started from database, specifically can wrap Include following steps:
Step 301: the current limliting plug-in unit of missing is downloaded from database.
Step 302: title variation, the starting title of the current limliting plug-in unit lacked are carried out to the current limliting plug-in unit of missing.
Step 303: being started in the plug-in unit starting method of the current limliting plug-in unit of missing.
Step 304: adjusting position of the launching process of the current limliting plug-in unit of missing in routing stacks.
Referring to FIG. 7, it is the exemplary diagram of the current limliting plug-in unit starting after downloading.Specifically, gateway server is according to scarce The title of the current limliting plug-in unit of mistake carries out the starting title of the current limliting plug-in unit lacked after title variation, further according to the current limliting of missing The plug-in unit starting method of plug-in unit is started, for example, calling the start method of the plug-in unit by app.use to start current limliting and insert Part, and position of the launching process of the current limliting plug-in unit of the missing in routing stacks is adjusted to executable place.It is understood that Due to holding the succession by routing stacks in system process implementation procedure, by by the launching process of the current limliting plug-in unit of missing adjust to Executable position, it is ensured that current limliting strategy is timely implemented, to ensure that the stabilization of network and database.
In one example, referring to FIG. 8, it is a specific example figure of gateway server.
Wherein, the upload submodule in download module is uploaded, for uploading customized current limliting plug-in unit to gateway server, Gateway server is uploaded to database again;
Submodule is downloaded, for downloading current limliting plug-in unit from database;
The trigger unit of promoter module in current limliting plug-in unit starting module, for triggering starting execution unit;
Start execution unit, the current limliting plug-in component operation for that will load;
The trigger unit of stopping submodule in current limliting plug-in unit starting module, stops execution unit for triggering;
Stop execution unit, for stop according to current limliting plugin name to be stopped the operation of current limliting plug-in unit;
Timing submodule in synchronization module is operated for the predetermined period timing execution of synchronization by configuring;
Synchronous submodule starts list for synchronizing the current limliting plug-in unit run on each gateway node.
Referring to FIG. 9, it is a configuration diagram of gateway server, and specifically, in figure by taking Redis database as an example, ApiGateway represents each gateway node, and Client represents client;Client uploads customized limit by gateway server Plug-in unit is flowed to Redis database, and list, each gateway server are started according to the current limliting plug-in unit in current limliting policy update database It is according to whether the current limliting plug-in unit of predetermined period inspection local starting list starts list with the current limliting plug-in unit in Redis database It is no consistent, some current limliting plug-in unit is started or stoped according to the current limliting plug-in unit starting list in Redis database.
Third embodiment of the present invention is related to a kind of gateway current-limiting method, the flow chart of present embodiment such as Figure 10 institute Show, specifically includes the following steps:
Step 401: judging whether to receive the current limliting plug-in unit start command of client transmission, be opened if receiving current limliting plug-in unit Dynamic order, then enter step 402;If not receiving current limliting plug-in unit start command, 405 are entered step.
Step 402: obtaining the title of the current limliting plug-in unit of the need starting of current limliting plug-in unit start command instruction.
Step 403: whether the current limliting plug-in unit for judging the need starting of current limliting plug-in unit start command instruction is to store in database Current limliting plug-in unit 404 are entered step, if needing to start if the current limliting plug-in unit that need to start is the current limliting plug-in unit that stores in database Current limliting plug-in unit be not database purchase current limliting plug-in unit, then return to error message.
Step 404: the title of the current limliting plug-in unit of the need starting of current limliting plug-in unit start command instruction is added in database In the current limliting plug-in unit starting list of setting.
Step 405: judging whether that the current limliting plug-in unit for receiving client transmission is ceased and desisted order, stop if receiving current limliting plug-in unit It only orders, then enters step 406;If not receiving current limliting plug-in unit to cease and desist order, end step process.
Step 406: obtaining current limliting plug-in unit and cease and desist order the title of current limliting plug-in unit that the need of instruction stop, and in the database In the current limliting plug-in unit starting list of setting, the title for the current limliting plug-in unit that need to stop is deleted.
Specifically, gateway server can receive the related command for the current limliting plug-in unit that client is sent, for example, gateway pipe Reason person sends current limliting plug-in unit start command to gateway server by client according to the change of current limliting strategy.In step 401, If it is determined that being not received by the current limliting plug-in unit start command of client transmission, then 405 are entered step.
When gateway server receives the current limliting plug-in unit start command of client transmission, according to current limliting plug-in unit start command Obtain the title for the current limliting plug-in unit that need to start;Gateway server is communicated with database, judges that current limliting plug-in unit start command needs Current limliting plug-in unit to be started whether be database purchase current limliting plug-in unit, if so, by the title of the current limliting plug-in unit that need to start It is added in the current limliting plug-in unit starting list being arranged in database, so that the current limliting plug-in unit in database is started list and carried out more Newly, so that subsequent gateway node starts the current limliting plug-in unit having updated in the current limliting plug-in unit being locally located starting list and database List is compared, to add the current limliting plug-in unit of the need starting of current limliting plug-in unit start command instruction on gateway node;If it is not, Error message is then returned, keeps user subsequent by carrying out again after the corresponding current limliting plug-in unit of client upload current limliting plug-in unit start command Operation.
When the current limliting plug-in unit for receiving client transmission is ceased and desisted order, gateway server is ceased and desisted order according to current limliting plug-in unit In the current limliting plug-in unit starting list for obtaining the title for needing the current limliting plug-in unit stopped, and being arranged in the database, deletes and need to stop The title of current limliting plug-in unit only makes the current limliting plug-in unit in database start list update, so that gateway node is according in database Current limliting plug-in unit starting list stopping and current limliting plug-in unit cease and desist order corresponding current limliting plug-in unit.
Compared with prior art, present embodiment receives the current limliting plug-in unit starting life that client is sent by gateway server It enables, the corresponding current limliting plugin name of current limliting plug-in unit start command is added in the starting list of the current limliting plug-in unit in database;It is logical It crosses and receives the current limliting plug-in unit that client is sent and cease and desist order, current limliting plug-in unit is ceased and desisted order into corresponding current limliting plugin name from data It is deleted in current limliting plug-in unit starting list in library, realizes the update of the current limliting plug-in unit starting list in database.Pass through client Transmission current limliting plug-in unit in end starts or stops order, can flexibly implement corresponding current limliting strategy, improve current limliting strategy more New efficiency.
The step of various methods divide above, be intended merely to describe it is clear, when realization can be merged into a step or Certain steps are split, multiple steps are decomposed into, as long as including identical logical relation, all in the protection scope of this patent It is interior;To adding inessential modification in algorithm or in process or introducing inessential design, but its algorithm is not changed Core design with process is all in the protection scope of the patent.
Four embodiment of the invention is related to a kind of gateway current-limiting apparatus, as shown in figure 11, comprising:
Start list maintenance module 501, for the current limliting plug-in unit being locally located to be started list with predetermined period, synchronizes more The new current limliting plug-in unit to be arranged in database starts list;Wherein, current limliting plug-in unit starting list is used to indicate each limit that need to start Plug-in unit is flowed, each current limliting plug-in unit respectively corresponds a current limliting strategy;
Current limliting module 502, for starting list according to updated current limliting plug-in unit, run each current limliting plug-in unit that need to start into Row current limliting.
Optionally, current limliting module 502 is also used to:
If the current limliting plug-in unit before updating starts list, relatively updated current limliting plug-in unit starts list, and there are the limits of missing Plug-in unit is flowed, then the current limliting plug-in unit of missing is obtained and started from database;
If the current limliting plug-in unit before updating starts list, relatively updated current limliting plug-in unit starts list, and there are extra limits Plug-in unit is flowed, then stops the operation of extra current limliting plug-in unit.
Optionally, current limliting plug-in unit can be uploaded in database in the following manner:
The current limliting plug-in unit that client uploads is obtained, the current limliting plug-in unit of upload includes plug-in unit starting method predetermined;
Unique identification is carried out to the current limliting plug-in unit of upload;
By the current limliting plug-in unit after unique identification, it is uploaded to database.
It is alternatively possible to which timestamp is arranged for the current limliting plug-in unit uploaded.
Optionally, the current limliting plug-in unit that missing is obtained and started from database, specifically includes:
The current limliting plug-in unit of missing is downloaded from database;
Title variation, the starting title of the current limliting plug-in unit lacked are carried out to the current limliting plug-in unit of missing;
Started in the plug-in unit starting method of the current limliting plug-in unit of missing;
Adjust position of the launching process of the current limliting plug-in unit of missing in routing stacks.
Optionally, the gateway current-limiting apparatus of present embodiment is also used to:
In response to the current limliting plug-in unit start command that client is sent, the need starting of current limliting plug-in unit start command instruction is obtained The title of current limliting plug-in unit;
If the current limliting plug-in unit of the need starting of current limliting plug-in unit start command instruction is the current limliting plug-in unit stored in database, will The title of the current limliting plug-in unit of the need starting of current limliting plug-in unit start command instruction is added to the current limliting plug-in unit starting being arranged in database In list;
In response to client send current limliting plug-in unit cease and desist order, obtain current limliting plug-in unit cease and desist order instruction need stop The title of current limliting plug-in unit, and in the current limliting plug-in unit starting list being arranged in the database, delete the name for the current limliting plug-in unit that need to stop Claim.
Optionally, database is specially distributed key-value pair storing data library.
It is not difficult to find that present embodiment is system embodiment corresponding with first embodiment, present embodiment can be with First embodiment is worked in coordination implementation.The relevant technical details mentioned in first embodiment still have in the present embodiment Effect, in order to reduce repetition, which is not described herein again.Correspondingly, the relevant technical details mentioned in present embodiment are also applicable in In first embodiment.
It is noted that each module involved in present embodiment is logic module, and in practical applications, one A logic unit can be a physical unit, be also possible to a part of a physical unit, can also be with multiple physics lists The combination of member is realized.In addition, in order to protrude innovative part of the invention, it will not be with solution institute of the present invention in present embodiment The technical issues of proposition, the less close unit of relationship introduced, but this does not indicate that there is no other single in present embodiment Member.
Fifth embodiment of the invention is related to a kind of network equipment, as shown in figure 12, including at least one processor 601; And the memory 602 with the communication connection of at least one processor 601;Wherein, be stored with can be by least one for memory 602 The instruction that processor 601 executes, instruction is executed by least one processor 601, so that at least one processor 601 is able to carry out Above-mentioned gateway current-limiting method.
Wherein, memory 602 is connected with processor 601 using bus mode, and bus may include any number of interconnection Bus and bridge, bus is by one or more processors 601 together with the various circuit connections of memory 602.Bus may be used also With by such as peripheral equipment, voltage-stablizer, together with various other circuit connections of management circuit or the like, these are all It is known in the art, therefore, it will not be further described herein.Bus interface provides between bus and transceiver Interface.Transceiver can be an element, be also possible to multiple element, such as multiple receivers and transmitter, provide for The unit communicated on transmission medium with various other devices.The data handled through processor 601 pass through antenna on the radio medium It is transmitted, further, antenna also receives data and transfers data to processor 601.
Processor 601 is responsible for management bus and common processing, can also provide various functions, including timing, periphery connects Mouthful, voltage adjusting, power management and other control functions.And memory 602 can be used for storage processor 601 and execute Used data when operation.
Sixth embodiment of the invention is related to a kind of gateway current limiting system, connect including database and with database communication N number of gateway as in the 5th embodiment, wherein N is the natural number greater than zero.
Seventh embodiment of the invention is related to a kind of computer readable storage medium, is stored with computer program.Computer Above method embodiment is realized when program is executed by processor.
That is, it will be understood by those skilled in the art that implement the method for the above embodiments be can be with Relevant hardware is instructed to complete by program, which is stored in a storage medium, including some instructions are to make It obtains an equipment (can be single-chip microcontroller, chip etc.) or processor (processor) executes side described in each embodiment of the application The all or part of the steps of method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can store journey The medium of sequence code.
It will be understood by those skilled in the art that the respective embodiments described above are to realize specific embodiments of the present invention, And in practical applications, can to it, various changes can be made in the form and details, without departing from the spirit and scope of the present invention.

Claims (11)

1. a kind of gateway current-limiting method characterized by comprising
The current limliting plug-in unit being locally located is started into list with predetermined period, synchronized update is that the current limliting plug-in unit being arranged in database opens Dynamic list;Wherein, the current limliting plug-in unit starting list is used to indicate each current limliting plug-in unit that need to start, each current limliting plug-in unit difference A corresponding current limliting strategy;
Start list according to the updated current limliting plug-in unit, runs each current limliting plug-in unit that need to start and carry out current limliting.
2. gateway current-limiting method according to claim 1, which is characterized in that described according to the updated current limliting plug-in unit Start list, run each current limliting plug-in unit that need to start and carry out current limliting, specifically include:
If the current limliting plug-in unit before the update starts list, the relatively described updated current limliting plug-in unit starts list, there is missing Current limliting plug-in unit, then obtain and start the current limliting plug-in unit of the missing from the database;
If the current limliting plug-in unit before the update starts list, the relatively described updated current limliting plug-in unit starts list, and there are extra Current limliting plug-in unit, then stop the operation of the extra current limliting plug-in unit.
3. gateway current-limiting method according to claim 2, which is characterized in that the current limliting plug-in unit uploads in the following manner To in the database:
The current limliting plug-in unit that client uploads is obtained, the current limliting plug-in unit of the upload includes plug-in unit starting method predetermined;
Unique identification is carried out to the current limliting plug-in unit of the upload;
By the current limliting plug-in unit after the unique identification, it is uploaded to the database.
4. gateway current-limiting method according to claim 3, which is characterized in that the current limliting plug-in unit to the upload carries out Unique identification specifically includes:
For the current limliting plug-in unit of the upload, timestamp is set.
5. gateway current-limiting method according to claim 3, which is characterized in that described to obtain and start from the database The current limliting plug-in unit of the missing, specifically includes:
The current limliting plug-in unit of the missing is downloaded from the database;
Title variation is carried out to the current limliting plug-in unit of the missing, obtains the starting title of the current limliting plug-in unit of the missing;
Started in the plug-in unit starting method of the current limliting plug-in unit of the missing;
Adjust position of the launching process of the current limliting plug-in unit of the missing in routing stacks.
6. gateway current-limiting method according to any one of claim 1 to 5, which is characterized in that further include:
In response to the current limliting plug-in unit start command that client is sent, the need starting of the current limliting plug-in unit start command instruction is obtained The title of current limliting plug-in unit;
If the current limliting plug-in unit of the need starting of the current limliting plug-in unit start command instruction is the current limliting plug-in unit stored in the database, Then by the title of the current limliting plug-in unit of the need starting of current limliting plug-in unit start command instruction, it is added to and is arranged in the database Current limliting plug-in unit starts in list;
In response to client send current limliting plug-in unit cease and desist order, obtain the current limliting plug-in unit cease and desist order instruction need stop The title of current limliting plug-in unit, and in the current limliting plug-in unit starting list being arranged in the database, delete the current limliting that need to stop The title of plug-in unit.
7. gateway current-limiting method according to any one of claim 1 to 5, which is characterized in that
The database is specially distributed key-value pair storing data library.
8. a kind of gateway current-limiting apparatus characterized by comprising
Start list maintenance module, for the current limliting plug-in unit being locally located to be started list with predetermined period, synchronized update is number Start list according to the current limliting plug-in unit being arranged in library;Wherein, the current limliting plug-in unit starting list is used to indicate each current limliting that need to start Plug-in unit, each current limliting plug-in unit respectively correspond a current limliting strategy;
Current limliting module runs each current limliting plug-in unit that need to start for starting list according to the updated current limliting plug-in unit Carry out current limliting.
9. a kind of gateway characterized by comprising
At least one processor;And
The memory being connect at least one described processor communication;Wherein,
The memory is stored with the instruction that can be executed by least one described processor, and described instruction is by described at least one It manages device to execute, so that at least one described processor is able to carry out the gateway current limliting side as described in any one of claims 1 to 7 Method.
10. a kind of gateway current limiting system characterized by comprising database and the N number of such as power being connect with the database communication Benefit require 9 described in gateway, wherein the N is natural number greater than zero.
11. a kind of computer readable storage medium, is stored with computer program, which is characterized in that the computer program is located Reason device realizes gateway current-limiting method described in any one of claims 1 to 7 when executing.
CN201910613993.2A 2019-07-09 2019-07-09 Gateway current limiting method, device, gateway, system and storage medium Active CN110535776B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910613993.2A CN110535776B (en) 2019-07-09 2019-07-09 Gateway current limiting method, device, gateway, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910613993.2A CN110535776B (en) 2019-07-09 2019-07-09 Gateway current limiting method, device, gateway, system and storage medium

Publications (2)

Publication Number Publication Date
CN110535776A true CN110535776A (en) 2019-12-03
CN110535776B CN110535776B (en) 2022-12-27

Family

ID=68659577

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910613993.2A Active CN110535776B (en) 2019-07-09 2019-07-09 Gateway current limiting method, device, gateway, system and storage medium

Country Status (1)

Country Link
CN (1) CN110535776B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113347041A (en) * 2021-06-21 2021-09-03 深圳壹账通智能科技有限公司 Dynamic current-limiting fusing configuration method, device, equipment and storage medium
CN113452553A (en) * 2021-06-18 2021-09-28 上海艾拉比智能科技有限公司 Content distribution network flow limiting method and system
CN116192758A (en) * 2023-02-07 2023-05-30 浙江九州云信息科技有限公司 Multi-rule combined current-limiting controller based on gateway service Kong
CN117596080A (en) * 2024-01-18 2024-02-23 北京安博通科技股份有限公司 Access control method, equipment, terminal and system for terminal user traffic

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050220034A1 (en) * 2004-03-31 2005-10-06 Siemens Information And Communication Networks Inc. Traffic control in an internet protocol network
CN107404421A (en) * 2017-09-18 2017-11-28 赛尔网络有限公司 Flow monitoring, monitoring and managing method and system
CN108418764A (en) * 2018-02-07 2018-08-17 深圳壹账通智能科技有限公司 Current-limiting method, device, computer equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050220034A1 (en) * 2004-03-31 2005-10-06 Siemens Information And Communication Networks Inc. Traffic control in an internet protocol network
CN107404421A (en) * 2017-09-18 2017-11-28 赛尔网络有限公司 Flow monitoring, monitoring and managing method and system
CN108418764A (en) * 2018-02-07 2018-08-17 深圳壹账通智能科技有限公司 Current-limiting method, device, computer equipment and storage medium

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113452553A (en) * 2021-06-18 2021-09-28 上海艾拉比智能科技有限公司 Content distribution network flow limiting method and system
CN113347041A (en) * 2021-06-21 2021-09-03 深圳壹账通智能科技有限公司 Dynamic current-limiting fusing configuration method, device, equipment and storage medium
CN113347041B (en) * 2021-06-21 2022-03-01 深圳壹账通智能科技有限公司 Dynamic current-limiting fusing configuration method, device, equipment and storage medium
CN116192758A (en) * 2023-02-07 2023-05-30 浙江九州云信息科技有限公司 Multi-rule combined current-limiting controller based on gateway service Kong
CN116192758B (en) * 2023-02-07 2024-03-29 浙江九州未来信息科技有限公司 Multi-rule combined current-limiting controller based on gateway service Kong
CN117596080A (en) * 2024-01-18 2024-02-23 北京安博通科技股份有限公司 Access control method, equipment, terminal and system for terminal user traffic
CN117596080B (en) * 2024-01-18 2024-04-23 北京安博通科技股份有限公司 Access control method, equipment, terminal and system for terminal user traffic

Also Published As

Publication number Publication date
CN110535776B (en) 2022-12-27

Similar Documents

Publication Publication Date Title
CN110535776A (en) Gateway current-limiting method, device, gateway, system and storage medium
US10255102B2 (en) Transaction control arrangement for device management system
CN106445951B (en) File transmission method and device
CN103678319B (en) Resource file update method, device and system and server
CN111294390B (en) Block data rapid synchronization method, device, equipment and storage medium
CN109375933B (en) Method and equipment for upgrading client
US11876676B2 (en) Network node firmware update
CN110417828A (en) A kind of upgrade method and device of internet-of-things terminal
CN111291008A (en) Data processing method, device, system, electronic equipment and computer storage medium
CN113010326A (en) Distributed lock processing method and device, electronic equipment and storage medium
EP4050850A1 (en) Service upgrading method, device and system
CN110362323A (en) Embedded type terminal equipment method for updating program based on distributed ad hoc network
CN110209534B (en) System and method for automatically backing up mysql database
CN116150273A (en) Data processing method, device, computer equipment and storage medium
CN104123160A (en) Element level updating method for navigation equipment
CN106487567A (en) A kind of managed element model management method and device
CN113315801B (en) Method and system for storing block chain data
CN105282204B (en) Tr069 protocol method processing method, device and gateway
US12019774B2 (en) Exclusive control system and exclusive control method
CN113032477A (en) Long-distance data synchronization method and device based on GTID and computing equipment
CN106155709A (en) Plug-in loading method, device and equipment
CN106407320B (en) File processing method, device and system
CN114244744B (en) Node discovery method and device based on Internet of things equipment
CN116166754B (en) Method and device for semi-real-time data batch synchronization and electronic equipment
CN115022175B (en) Synchronization method and device for configuration information

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
GR01 Patent grant
GR01 Patent grant