CN111262794A - Gateway flow control method and device - Google Patents

Gateway flow control method and device Download PDF

Info

Publication number
CN111262794A
CN111262794A CN202010260579.0A CN202010260579A CN111262794A CN 111262794 A CN111262794 A CN 111262794A CN 202010260579 A CN202010260579 A CN 202010260579A CN 111262794 A CN111262794 A CN 111262794A
Authority
CN
China
Prior art keywords
target service
service field
concurrency number
gateway
flow control
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
CN202010260579.0A
Other languages
Chinese (zh)
Other versions
CN111262794B (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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
CCB Finetech 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 China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202010260579.0A priority Critical patent/CN111262794B/en
Publication of CN111262794A publication Critical patent/CN111262794A/en
Application granted granted Critical
Publication of CN111262794B publication Critical patent/CN111262794B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/29Flow control; Congestion control using a combination of thresholds
    • 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
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a method and a device for controlling the flow of a gateway, wherein the method comprises the following steps: counting a target service field in the message and determining a concurrency number corresponding to the target service field; and if the concurrency number corresponding to the target service field is determined to be larger than a preset first concurrency number threshold, rejecting the transaction request corresponding to the target service field until the concurrency number corresponding to the target service field is smaller than or equal to the preset first concurrency number threshold. The invention can support the flow control aiming at the service field, improves the flexibility of the flow control parameter setting system, and enables the gateway to carry out differentiated flow control parameter setting aiming at the application characteristics, thereby meeting the differentiated requirements of different applications.

Description

Gateway flow control method and device
Technical Field
The present invention relates to the technical field of data services, and in particular, to a method and an apparatus for controlling a flow of a gateway.
Background
The flow control function of the enterprise gateway generally performs flow control for the HTTP protocol, the access IP address, the protocol header, and the like, and only performing flow control for the HTTP protocol, the protocol header, and the like cannot meet the service requirement, and needs to perform finer-grained flow control, for example, performing finer-grained flow control for a certain transaction channel, a certain organization, and the like, or customizing a flow control rule.
The flow control function of the existing gateway basically controls flow according to information such as an HTTP protocol and an access IP address, cannot control flow according to a service field or a custom flow control rule, and does not support application expansion when a flow control triggering condition is not supported.
Therefore, an implementation scheme capable of performing flow control on the service field and the composite service field is needed.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a method and a device for controlling the flow of a gateway, which can support the flow control of a service field and a composite service field and can support the flow control rule to be customized for flow control.
In order to solve the technical problems, the invention provides the following technical scheme:
in a first aspect, the present invention provides a method for controlling a flow of a gateway, including:
counting a target service field in the message and determining a concurrency number corresponding to the target service field;
and if the concurrency number corresponding to the target service field is determined to be larger than a preset first concurrency number threshold, rejecting the transaction request corresponding to the target service field until the concurrency number corresponding to the target service field is smaller than or equal to the preset first concurrency number threshold.
Further, before counting a target service field in the message and determining a concurrency number corresponding to the target service field, the method further includes:
and loading a predefined configuration file and carrying out configuration analysis processing on the configuration file to obtain a target service field and a concurrency number corresponding to the target service field.
Further, before the loading a predefined configuration file and performing configuration parsing on the configuration file, the method further includes:
and counting the global concurrency number of the gateway and determining that the global concurrency number of the gateway is smaller than a preset second concurrency number threshold, and executing loading of a predefined configuration file.
Wherein, the counting the target service field in the message and determining the concurrency number corresponding to the target service field includes:
detecting the content of the message, and if a target service field exists in the message, adding one to the concurrent number corresponding to the target service field;
detecting a transaction request corresponding to the target service field, and if the transaction request corresponding to the target service field is in a transaction completion state, reducing the concurrency number corresponding to the target service field by one;
and determining the concurrency number corresponding to the target service field according to the accumulation result of the concurrency number corresponding to the target service field.
In a second aspect, the present invention provides a flow control apparatus for a gateway, including:
the statistical unit is used for counting the target service field in the message and determining the concurrency number corresponding to the target service field;
and the flow control unit is used for determining that the concurrency number corresponding to the target service field is greater than a preset first concurrency number threshold value, and rejecting the transaction request corresponding to the target service field until the concurrency number corresponding to the target service field is less than or equal to the preset first concurrency number threshold value.
Further, the method also comprises the following steps:
and the loading unit is used for loading a predefined configuration file and carrying out configuration analysis processing on the configuration file to obtain a target service field and a concurrency number corresponding to the target service field.
Further, the method also comprises the following steps:
and the global control unit is used for counting the global concurrency number of the gateway and executing loading of a predefined configuration file if the global concurrency number of the gateway is determined to be smaller than a preset second concurrency number threshold.
Wherein the statistical unit includes:
the accumulation subunit is used for detecting the content of the message, and if the message has a target service field, the concurrency number corresponding to the target service field is increased by one;
the accumulation and subtraction subunit is used for detecting the transaction request corresponding to the target service field, and if the transaction request corresponding to the target service field is in a transaction completion state, the concurrency number corresponding to the target service field is subtracted by one;
and the concurrency number subunit is used for determining the concurrency number corresponding to the target service field according to the accumulation result of the concurrency number corresponding to the target service field.
In a third aspect, the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for controlling traffic of a gateway when executing the program.
In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the flow control method of the gateway.
According to the technical scheme, the invention provides a method and a device for controlling the flow of a gateway, which are used for determining the concurrency number corresponding to a target service field by counting the target service field in a message; and if the concurrency number corresponding to the target service field is determined to be greater than a preset first concurrency number threshold, rejecting the transaction request corresponding to the target service field until the concurrency number corresponding to the target service field is less than or equal to the preset first concurrency number threshold, so that flow control can be carried out on the service field, the flexibility of a flow control parameter setting system is improved, and the gateway can carry out differentiated flow control parameter setting according to application characteristics, thereby meeting the differentiated requirements of different applications.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a first flowchart of a flow control method of a gateway in an embodiment of the present invention.
Fig. 2 is a second flowchart of a flow control method of a gateway in an embodiment of the present invention.
Fig. 3 is a third flow chart of the flow control method of the gateway in the embodiment of the present invention.
Fig. 4 is a flowchart illustrating step S101 in a flow control method of a gateway in an embodiment of the present invention.
Fig. 5 is a schematic diagram of a first structure of a flow control device of a gateway in an embodiment of the present invention.
Fig. 6 is a schematic diagram of a second structure of a flow control device of a gateway in an embodiment of the present invention.
Fig. 7 is a schematic diagram of a third structure of a flow control device of a gateway in an embodiment of the present invention.
Fig. 8 is a schematic structural diagram of an electronic device in an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The present invention provides an embodiment of a method for controlling a flow of a gateway, and referring to fig. 1, the method for controlling a flow of a gateway specifically includes the following contents:
s101: counting a target service field in the message and determining a concurrency number corresponding to the target service field;
in this step, the target service field is set according to the control requirement, and when the target service field is set, the target service field may be a complete field or a part of a complete field, such as: the first five digits of the transaction code are A0058, and the concurrent number is 200; or may be a combined type service field, such as: the transaction code is the first three digits A02, and the concurrency number is 150 when the transaction channel is an electronic channel.
The concurrency number is set according to the control requirement, and when the concurrency number is set, self-adaption setting is needed according to the processing capacity of an actual application system.
By customizing the target service field and the concurrency number, the flow control rule is customized, and the personalized requirement of flow monitoring is met.
It should be noted that the flow control refers to collecting and analyzing the resource usage of the application system, and determining whether to perform active control on the subsequent processing according to the analysis result. In the embodiment, the target of flow control is mainly access transaction request, and the metric index is mainly concurrency.
The resource is an object that can be identified and counted, for example, the system global, a certain channel, a certain organization and a certain transaction are all resources. The composition of the resource can be a single condition or a composite condition, for example, the information collection and statistics of the resource can be carried out according to two conditions of a channel and an organization.
S102: and if the concurrency number corresponding to the target service field is determined to be larger than a preset first concurrency number threshold, rejecting the transaction request corresponding to the target service field until the concurrency number corresponding to the target service field is smaller than or equal to the preset first concurrency number threshold.
In this step, according to the step S101, it is able to determine the concurrency number corresponding to the target service field, and check whether the concurrency number meets the condition of flow control configuration, that is, determine whether the concurrency number corresponding to the target service field is greater than a preset first concurrency number threshold. In this embodiment, if the concurrency number corresponding to the target service field is greater than a preset first concurrency number threshold, a correspondingly configured flow control policy is invoked, where the flow control policy is: and rejecting the transaction request corresponding to the target service field. And if the concurrency number corresponding to the target business field is less than or equal to the preset first concurrency number threshold, allowing the transaction request corresponding to the target business field to perform normal logic processing.
Further, after the transaction request corresponding to the target service field is rejected, the current concurrency number is prompted to exceed a first concurrency number threshold value.
As can be seen from the above description, in the flow control method for a gateway provided in the embodiment of the present invention, the target service field in the message is counted, and the concurrency number corresponding to the target service field is determined; and if the concurrency number corresponding to the target service field is determined to be greater than a preset first concurrency number threshold, rejecting the transaction request corresponding to the target service field until the concurrency number corresponding to the target service field is less than or equal to the preset first concurrency number threshold, so that flow control can be carried out on the service field, the flexibility of a flow control parameter setting system is improved, and the gateway can carry out differentiated flow control parameter setting according to application characteristics, thereby meeting the differentiated requirements of different applications.
In an embodiment of the present invention, referring to fig. 2, step S101 of the flow control method of the gateway further includes step S100, which specifically includes the following contents:
s100: and loading a predefined configuration file and carrying out configuration analysis processing on the configuration file to obtain a target service field and a concurrency number corresponding to the target service field.
In this embodiment, at the time of the gateway startup, a predefined configuration file for the traffic control policy for the service is loaded, and the configuration file may be defined as: the global flow control concurrency number may also be defined as: according to the definition of the business rule, after the configuration file is analyzed and processed, the configuration file is loaded into an object corresponding to the flow control resource register, namely, the configuration file sequence is converted into an object and loaded into the memory, and meanwhile, the flow control strategy corresponding to the flow control resource is stored.
Further, a configuration file for flow control is explained in detail, and the configuration file specifically includes:
1. configuration of flow control function switch:
and if the value of the character corresponding to the flow control function switch is 1, the flow control function is started, and if the value of the character is 0, the flow control function is closed, and the flow control function is not effective.
2. Configuration of flow control access point in flow control:
the character corresponding to the flow control access point is assigned with a corresponding number (for example, 1,2,3, etc.) to indicate that the flow control is carried out when the access is requested, and the number indicates that the flow control strategy corresponding to the number is used for carrying out the control. For example: the character corresponding to the flow control access point is assigned with '2, 3,4,5, 6', which indicates that the flow control is performed by using resource groups with resource group ids respectively equal to 2,3,4,5 and 6.
3. Configuration of global concurrency number:
and assigning the characters corresponding to the global concurrency number as corresponding numbers to represent the upper limit of the concurrency number. It should be noted that the assignment of the characters corresponding to the global concurrency number as the corresponding number is the second concurrency number threshold.
4. The configuration of flow control resource group id 2 is as follows:
performing flow control configuration according to a transaction code of the transaction, wherein when the transaction code is ParamService, the allowed maximum concurrency is 1, and when the concurrency number exceeds the set maximum value 1, the transaction is directly refused; when the transaction code is a05817103, the maximum allowed concurrency is 100, and when the number of concurrency exceeds the set maximum value of 100, the transaction is directly rejected.
5. The configuration of flow control resource group id 3 is as follows:
and flow control is carried out according to the order number field in the message entity domain. The orderId in the configuration is an attribute name of class a05817103 InVo. Type in the configuration is "booth", which indicates a configuration in which both the percentage configuration and the absolute value are adopted, and the minimum value calculated is used as the final threshold value. In the configuration, when the order number is order01, the total percentage% is 100% 90%, and the configuration is 10 in terms of absolute value, the minimum value of 90 and 10 is 10, and the maximum allowed concurrency number is 10; when the order number is param99, the maximum allowable concurrency is min (20,100 x 10%) -10.
It should be noted that the order number is only an example, and the specific control field needs to be changed according to the entity class of the application.
In an embodiment of the present invention, referring to fig. 3, step S103 is further included before step S100 of the flow control method of the gateway, and specifically includes the following steps:
s103: and counting the global concurrency number of the gateway and determining that the global concurrency number of the gateway is smaller than a preset second concurrency number threshold, and executing loading of a predefined configuration file.
In this step, before flow control is performed, flow control detection is performed based on the globally set concurrency number. When the transaction enters a global flow control check area (all the transactions are required to enter by default), checking a global concurrency number, judging whether the global concurrency number is larger than or equal to a second concurrency number threshold set by the global concurrency, and if the global concurrency number is larger than or equal to the second concurrency number threshold set by the global concurrency, calling a global flow control strategy and rejecting the transaction request. And if the global concurrency number is judged to be smaller than a second concurrency number threshold value set by the global concurrency, checking the common flow control configuration.
Checking of generic flow control configuration: it is checked whether the transaction satisfies the conditions of the general flow control configuration, i.e. step S100, step S101 and step S102 are performed.
In an embodiment of the present invention, referring to fig. 4, step S101 of the flow control method of the gateway specifically includes the following contents:
s1011: detecting the content of the message, and if a target service field exists in the message, adding one to the concurrent number corresponding to the target service field;
in this step, the content of the message passing through the gateway is detected, the detection is to determine whether a target service field exists in the message, and if the target service field exists in the message, the concurrency number corresponding to the target service field is increased by one.
S1012: detecting a transaction request corresponding to the target service field, and if the transaction request corresponding to the target service field is in a transaction completion state, reducing the concurrency number corresponding to the target service field by one;
in this step, the transaction request corresponding to the target service field is detected, and after the message corresponding to the transaction request executes the service logic, that is, the transaction request corresponding to the target service field is in a transaction completion state, the concurrency number corresponding to the target service field is decreased by one.
S1013: and determining the concurrency number corresponding to the target service field according to the accumulation result of the concurrency number corresponding to the target service field.
In this embodiment, the accumulated result of the concurrency numbers corresponding to the target service field, that is, the number of the transaction requests that have not been processed, determines the number of the transaction requests that have been processed as the concurrency number corresponding to the target service field.
For example: after the gateway is started, when the first five bits of the transaction code configured in the flow control strategy are A0058, the maximum concurrency number is 200. Then when the requested transaction is received, the content of the requested transaction is detected, when the first five digits of the transaction code in the request parameter are detected to be A0058, the number of the corresponding transactions of the flow control resource register is increased by one, the transaction is reduced by one when the transaction is completed, and if the unprocessed transaction reaches 200 at a certain moment, the flow control strategy is called to reject the transaction.
As can be seen from the above description, the flow control method for a gateway provided in the embodiment of the present invention needs to support flow control for a service field and a composite service field, and support a customized flow control rule to perform flow control, so that the gateway can perform differentiated flow control parameter setting for application characteristics, and meet differentiated requirements of different applications. Meanwhile, when the flow control condition is triggered, the flow control strategy is supported to be customized by the application, and an extensible method is provided for the application.
An embodiment of the present invention provides a specific implementation manner of a flow control device of a gateway, which is capable of implementing all contents in a flow control method of the gateway, and referring to fig. 5, the flow control device of the gateway specifically includes the following contents:
a counting unit 10, configured to count a target service field in a message and determine a concurrency number corresponding to the target service field;
and the flow control unit 20 is configured to determine that the concurrency number corresponding to the target service field is greater than a preset first concurrency number threshold, and reject the transaction request corresponding to the target service field until the concurrency number corresponding to the target service field is less than or equal to the preset first concurrency number threshold.
Wherein, the statistical unit 10 includes:
the accumulation subunit is used for detecting the content of the message, and if the message has a target service field, the concurrency number corresponding to the target service field is increased by one;
the accumulation and subtraction subunit is used for detecting the transaction request corresponding to the target service field, and if the transaction request corresponding to the target service field is in a transaction completion state, the concurrency number corresponding to the target service field is subtracted by one;
and the concurrency number subunit is used for determining the concurrency number corresponding to the target service field according to the accumulation result of the concurrency number corresponding to the target service field.
In an embodiment of the present invention, referring to fig. 6, the flow control device of the gateway further includes:
the loading unit 30 is configured to load a predefined configuration file and perform configuration analysis processing on the configuration file to obtain a target service field and a concurrency number corresponding to the target service field.
In an embodiment of the present invention, referring to fig. 7, the flow control device of the gateway further includes:
and the global control unit 40 is configured to count a global concurrency number of the gateway and execute loading of a predefined configuration file if the global concurrency number of the gateway is determined to be smaller than a preset second concurrency number threshold.
The embodiment of the flow control apparatus of the gateway provided by the present invention may be specifically configured to execute the processing procedure of the embodiment of the flow control method of the gateway in the foregoing embodiment, and the functions of the embodiment are not described herein again, and refer to the detailed description of the embodiment of the method.
As can be seen from the above description, the flow control apparatus of the gateway provided in the embodiment of the present invention determines the concurrency number corresponding to the target service field by counting the target service field in the message; and if the concurrency number corresponding to the target service field is determined to be greater than a preset first concurrency number threshold, rejecting the transaction request corresponding to the target service field until the concurrency number corresponding to the target service field is less than or equal to the preset first concurrency number threshold, so that flow control can be carried out on the service field, the flexibility of a flow control parameter setting system is improved, and the gateway can carry out differentiated flow control parameter setting according to application characteristics, thereby meeting the differentiated requirements of different applications.
The present application provides an embodiment of an electronic device for implementing all or part of contents in a flow control method of a gateway, where the electronic device specifically includes the following contents:
a processor (processor), a memory (memory), a communication Interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete mutual communication through the bus; the communication interface is used for realizing information transmission between related devices; the electronic device may be a desktop computer, a tablet computer, a mobile terminal, and the like, but the embodiment is not limited thereto. In this embodiment, the electronic device may be implemented with reference to an embodiment of a flow control method for implementing the gateway and an embodiment of a flow control device for implementing the gateway in the embodiments, and the contents of the embodiments are incorporated herein, and repeated details are not repeated.
Fig. 8 is a schematic block diagram of a system configuration of an electronic device 9600 according to an embodiment of the present application. As shown in fig. 8, the electronic device 9600 can include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, this FIG. 8 is exemplary; other types of structures may also be used in addition to or in place of the structure to implement telecommunications or other functions.
In one embodiment, the flow control function of the gateway may be integrated into the central processor 9100. The central processor 9100 may be configured to control as follows:
counting a target service field in the message and determining a concurrency number corresponding to the target service field; and if the concurrency number corresponding to the target service field is determined to be larger than a preset first concurrency number threshold, rejecting the transaction request corresponding to the target service field until the concurrency number corresponding to the target service field is smaller than or equal to the preset first concurrency number threshold.
As can be seen from the above description, in the electronic device provided in the embodiment of the present application, the target service field in the message is counted, and the concurrency number corresponding to the target service field is determined; and if the concurrency number corresponding to the target service field is determined to be greater than a preset first concurrency number threshold, rejecting the transaction request corresponding to the target service field until the concurrency number corresponding to the target service field is less than or equal to the preset first concurrency number threshold, so that flow control can be carried out on the service field, the flexibility of a flow control parameter setting system is improved, and the gateway can carry out differentiated flow control parameter setting according to application characteristics, thereby meeting the differentiated requirements of different applications.
In another embodiment, the flow control device of the gateway may be configured separately from the central processor 9100, for example, the flow control device of the gateway may be configured as a chip connected to the central processor 9100, and the flow control function of the gateway is realized by the control of the central processor.
As shown in fig. 8, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 also does not necessarily include all of the components shown in fig. 8; further, the electronic device 9600 may further include components not shown in fig. 8, which may be referred to in the art.
As shown in fig. 8, a central processor 9100, sometimes referred to as a controller or operational control, can include a microprocessor or other processor device and/or logic device, which central processor 9100 receives input and controls the operation of the various components of the electronic device 9600.
The memory 9140 can be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information relating to the failure may be stored, and a program for executing the information may be stored. And the central processing unit 9100 can execute the program stored in the memory 9140 to realize information storage or processing, or the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. Power supply 9170 is used to provide power to electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, an LCD display, but is not limited thereto.
The memory 9140 can be a solid state memory, e.g., Read Only Memory (ROM), Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes called an EPROM or the like. The memory 9140 could also be some other type of device. Memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 being used for storing application programs and function programs or for executing a flow of operations of the electronic device 9600 by the central processor 9100.
The memory 9140 can also include a data store 9143, the data store 9143 being used to store data, such as contacts, digital data, pictures, sounds, and/or any other data used by an electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers for the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, contact book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. The communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, may be provided in the same electronic device. The communication module (transmitter/receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby implementing ordinary telecommunications functions. The audio processor 9130 may include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100, thereby enabling recording locally through the microphone 9132 and enabling locally stored sounds to be played through the speaker 9131.
An embodiment of the present invention further provides a computer-readable storage medium capable of implementing all the steps in the flow control method of the gateway in the foregoing embodiments, where the computer-readable storage medium stores a computer program, and the computer program implements all the steps of the flow control method of the gateway in the foregoing embodiments when executed by a processor, for example, the processor implements the following steps when executing the computer program:
counting a target service field in the message and determining a concurrency number corresponding to the target service field; and if the concurrency number corresponding to the target service field is determined to be larger than a preset first concurrency number threshold, rejecting the transaction request corresponding to the target service field until the concurrency number corresponding to the target service field is smaller than or equal to the preset first concurrency number threshold.
As can be seen from the above description, the computer-readable storage medium provided in the embodiment of the present invention determines the concurrency number corresponding to the target service field by counting the target service field in the message; and if the concurrency number corresponding to the target service field is determined to be greater than a preset first concurrency number threshold, rejecting the transaction request corresponding to the target service field until the concurrency number corresponding to the target service field is less than or equal to the preset first concurrency number threshold, so that flow control can be carried out on the service field, the flexibility of a flow control parameter setting system is improved, and the gateway can carry out differentiated flow control parameter setting according to application characteristics, thereby meeting the differentiated requirements of different applications.
Although the present invention provides method steps as described in the examples or flowcharts, more or fewer steps may be included based on routine or non-inventive labor. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an actual apparatus or client product executes, it may execute sequentially or in parallel (e.g., in the context of parallel processors or multi-threaded processing) according to the embodiments or methods shown in the figures.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, apparatus (system) or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment. In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations. It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict. The present invention is not limited to any single aspect, nor is it limited to any single embodiment, nor is it limited to any combination and/or permutation of these aspects and/or embodiments. Moreover, each aspect and/or embodiment of the present invention may be utilized alone or in combination with one or more other aspects and/or embodiments thereof.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the present invention, and they should be construed as being included in the following claims and description.

Claims (10)

1. A method for controlling flow of a gateway is characterized by comprising the following steps:
counting a target service field in the message and determining a concurrency number corresponding to the target service field;
and if the concurrency number corresponding to the target service field is determined to be larger than a preset first concurrency number threshold, rejecting the transaction request corresponding to the target service field until the concurrency number corresponding to the target service field is smaller than or equal to the preset first concurrency number threshold.
2. The method for controlling flow of gateway according to claim 1, wherein before counting a target service field in the message and determining a concurrency number corresponding to the target service field, the method further comprises:
and loading a predefined configuration file and carrying out configuration analysis processing on the configuration file to obtain a target service field and a concurrency number corresponding to the target service field.
3. The method for controlling traffic of a gateway according to claim 2, wherein before the loading a predefined configuration file and performing configuration parsing on the configuration file, the method further comprises:
and counting the global concurrency number of the gateway and determining that the global concurrency number of the gateway is smaller than a preset second concurrency number threshold, and executing loading of a predefined configuration file.
4. The method of claim 1, wherein counting the target service field in the message and determining the concurrency number corresponding to the target service field comprises:
detecting the content of the message, and if a target service field exists in the message, adding one to the concurrent number corresponding to the target service field;
detecting a transaction request corresponding to the target service field, and if the transaction request corresponding to the target service field is in a transaction completion state, reducing the concurrency number corresponding to the target service field by one;
and determining the concurrency number corresponding to the target service field according to the accumulation result of the concurrency number corresponding to the target service field.
5. A flow control device of a gateway, comprising:
the statistical unit is used for counting the target service field in the message and determining the concurrency number corresponding to the target service field;
and the flow control unit is used for determining that the concurrency number corresponding to the target service field is greater than a preset first concurrency number threshold value, and rejecting the transaction request corresponding to the target service field until the concurrency number corresponding to the target service field is less than or equal to the preset first concurrency number threshold value.
6. The gateway flow control apparatus according to claim 5, further comprising:
and the loading unit is used for loading a predefined configuration file and carrying out configuration analysis processing on the configuration file to obtain a target service field and a concurrency number corresponding to the target service field.
7. The gateway flow control apparatus of claim 6, further comprising:
and the global control unit is used for counting the global concurrency number of the gateway and executing loading of a predefined configuration file if the global concurrency number of the gateway is determined to be smaller than a preset second concurrency number threshold.
8. The gateway traffic control apparatus according to claim 5, wherein the statistical unit comprises:
the accumulation subunit is used for detecting the content of the message, and if the message has a target service field, the concurrency number corresponding to the target service field is increased by one;
the accumulation and subtraction subunit is used for detecting the transaction request corresponding to the target service field, and if the transaction request corresponding to the target service field is in a transaction completion state, the concurrency number corresponding to the target service field is subtracted by one;
and the concurrency number subunit is used for determining the concurrency number corresponding to the target service field according to the accumulation result of the concurrency number corresponding to the target service field.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the flow control method of the gateway according to any one of claims 1 to 4 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the flow control method of the gateway according to any one of claims 1 to 4.
CN202010260579.0A 2020-04-03 2020-04-03 Gateway flow control method and device Active CN111262794B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010260579.0A CN111262794B (en) 2020-04-03 2020-04-03 Gateway flow control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010260579.0A CN111262794B (en) 2020-04-03 2020-04-03 Gateway flow control method and device

Publications (2)

Publication Number Publication Date
CN111262794A true CN111262794A (en) 2020-06-09
CN111262794B CN111262794B (en) 2022-11-15

Family

ID=70949945

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010260579.0A Active CN111262794B (en) 2020-04-03 2020-04-03 Gateway flow control method and device

Country Status (1)

Country Link
CN (1) CN111262794B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114257653A (en) * 2021-12-24 2022-03-29 中国工商银行股份有限公司 Flow data processing method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130262376A1 (en) * 2012-03-29 2013-10-03 Tracelink, Inc. Methods and systems for managing distributed concurrent data updates of business objects
CN108683604A (en) * 2018-04-03 2018-10-19 平安科技(深圳)有限公司 concurrent access control method, terminal device and medium
US20190332286A1 (en) * 2018-04-28 2019-10-31 EMC IP Holding Company LLC Method, apparatus and computer program product for managing storage system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130262376A1 (en) * 2012-03-29 2013-10-03 Tracelink, Inc. Methods and systems for managing distributed concurrent data updates of business objects
CN108683604A (en) * 2018-04-03 2018-10-19 平安科技(深圳)有限公司 concurrent access control method, terminal device and medium
US20190332286A1 (en) * 2018-04-28 2019-10-31 EMC IP Holding Company LLC Method, apparatus and computer program product for managing storage system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114257653A (en) * 2021-12-24 2022-03-29 中国工商银行股份有限公司 Flow data processing method and system

Also Published As

Publication number Publication date
CN111262794B (en) 2022-11-15

Similar Documents

Publication Publication Date Title
EP3117317B1 (en) Resource management based on device-specific or user-specific resource usage profiles
US9678797B2 (en) Dynamic resource management for multi-process applications
CN111625320A (en) Mirror image management method, system, device and medium
CN111262794B (en) Gateway flow control method and device
CN111858050A (en) Server cluster mixed deployment method, cluster management node and related system
CA2628815C (en) System and method for correlating messages within a wireless transaction
CN111352719B (en) Transaction bookkeeping service data processing method, device and system
CN112468574A (en) Processing method, device and system for application service publishing and subscribing mechanism
CN111782260A (en) Gray scale distribution method and gray scale distribution device
CN111475230A (en) Application function configuration method and device and electronic equipment
CN111796935A (en) Consumption instance distribution method and system for calling log information
CN108984238B (en) Gesture processing method and device of application program and electronic equipment
CN107679871B (en) List management method, device, system and computer readable storage medium
CN110673970A (en) Cross-process calling system and method based on web application
CN113271228B (en) Bandwidth resource scheduling method, device, equipment and computer readable storage medium
US8260293B2 (en) Devices and methods for placing a call on a selected communication line
CN112616143B (en) Method and device for distributing communication numbers, electronic equipment and storage medium
CN111459653B (en) Cluster scheduling method, device and system and electronic equipment
US10783020B2 (en) Method for invoking component, and terminal
CN107861853A (en) Progress prompt method, terminal and computer-readable medium
CN111049981A (en) Message identification method, device, user equipment and computer readable storage medium
CN114938353B (en) Asynchronous notification current limiting method and system based on stream computing
CN109194734A (en) Information push method, device, server and readable storage medium storing program for executing
CN112766698B (en) Application service pressure determining method and device
CN113709710B (en) Interface management method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20221008

Address after: 25 Financial Street, Xicheng District, Beijing 100033

Applicant after: CHINA CONSTRUCTION BANK Corp.

Address before: 25 Financial Street, Xicheng District, Beijing 100033

Applicant before: CHINA CONSTRUCTION BANK Corp.

Applicant before: Jianxin Financial Science and Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant