[go: up one dir, main page]

CN116319810A - Distributed system flow control method, device, equipment, medium and product - Google Patents

Distributed system flow control method, device, equipment, medium and product Download PDF

Info

Publication number
CN116319810A
CN116319810A CN202310215040.7A CN202310215040A CN116319810A CN 116319810 A CN116319810 A CN 116319810A CN 202310215040 A CN202310215040 A CN 202310215040A CN 116319810 A CN116319810 A CN 116319810A
Authority
CN
China
Prior art keywords
concurrency
service
server
service request
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.)
Pending
Application number
CN202310215040.7A
Other languages
Chinese (zh)
Inventor
谢福成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
CCB Finetech Co Ltd
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 CN202310215040.7A priority Critical patent/CN116319810A/en
Publication of CN116319810A publication Critical patent/CN116319810A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1029Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers using data related to the state of servers by a load balancer
    • 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)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

本发明公开了一种分布式系统的流量控制方法、装置、设备、介质及产品。本发明涉及计算机技术、金融科技和信息技术领域。该方法包括:将接收的业务请求分配至所述分布式系统中的目标服务器;根据所述业务请求确定所述目标服务器当前的服务器并发量和/或业务类别并发量;根据所述服务器并发量和/或业务类别并发量对所述目标服务器进行流量控制;若所述目标服务器接受所述业务请求,则根据所述业务请求确定所述分布式系统当前的系统并发量;根据所述系统并发量对所述分布式系统进行流量控制。利用该方法,通过对分布式系统进行双重流量控制,可以有效的对分布式系统内各服务器实现流量控制,保证分布式集群对服务响应地稳定性和高可用性。

Figure 202310215040

The invention discloses a flow control method, device, equipment, medium and product of a distributed system. The present invention relates to the fields of computer technology, financial technology and information technology. The method includes: allocating the received service request to the target server in the distributed system; determining the current server concurrency and/or service category concurrency of the target server according to the service request; and/or the concurrency of the service category to control the flow of the target server; if the target server accepts the service request, then determine the current system concurrency of the distributed system according to the service request; according to the system concurrency The amount controls the flow of the distributed system. By using this method, by performing dual flow control on the distributed system, the flow control of each server in the distributed system can be effectively realized, and the stability and high availability of the distributed cluster's response to the service can be ensured.

Figure 202310215040

Description

分布式系统的流量控制方法、装置、设备、介质及产品Distributed system flow control method, device, equipment, medium and product

技术领域technical field

本发明实施例涉及计算机技术、金融科技和信息技术领域,尤其涉及一种分布式系统的流量控制方法、装置、设备、存储介质及程序产品。Embodiments of the present invention relate to the fields of computer technology, financial technology, and information technology, and in particular, to a flow control method, device, equipment, storage medium, and program product of a distributed system.

背景技术Background technique

高可用的系统一般会提供一些自我保护能力,通常需要通过各种手段来提供系统的可以用性,例如缓存、降级和限流等。在遇到突发的业务流量高峰,系统性能无法支撑的时候,如果没有类似的措施保护系统,整个系统就可能崩溃。在突发高流量场景下,无论如何都不可能短时间的获得特别高的服务能力。所以,不论是系统将近崩溃之前,还是系统崩溃之后需要重新启动的时候,都需要一个流量控制机制来让系统能够服务,或者能够恢复服务。A highly available system generally provides some self-protection capabilities, and usually requires various means to provide system availability, such as caching, downgrading, and current limiting. When encountering a sudden business traffic peak and system performance cannot be supported, if there are no similar measures to protect the system, the entire system may collapse. In a sudden high traffic scenario, it is impossible to obtain a particularly high service capacity in a short period of time anyway. Therefore, whether the system is about to crash or needs to be restarted after the system crashes, a flow control mechanism is needed to enable the system to serve or restore services.

现有的基于redis缓存的流量控制,虽然可以实现流量的全局控制,但在分布式应用服务场景下,外部服务符合全局流量控制,有可能使得服务集中分布在单台或多台服务器,导致这些服务器服务拥堵,而其他服务器相对空闲,进而影响应用对外的整体服务。Although the existing flow control based on redis cache can realize global control of flow, in the distributed application service scenario, external services conform to global flow control, which may make the service distributed in a single or multiple servers, resulting in these The server service is congested, while other servers are relatively idle, which affects the overall external service of the application.

发明内容Contents of the invention

本发明实施例提供一种分布式系统的流量控制方法、装置、设备及存储介质,可以对分布式系统内各服务器实现流量控制,保证分布式集群对服务响应地稳定性和高可用性。Embodiments of the present invention provide a flow control method, device, device, and storage medium for a distributed system, which can implement flow control for each server in the distributed system, and ensure the stability and high availability of the distributed cluster's response to services.

第一方面,本发明实施例提供了一种分布式系统的流量控制方法,包括:In a first aspect, an embodiment of the present invention provides a flow control method for a distributed system, including:

将接收的业务请求分配至所述分布式系统中的目标服务器;Distributing the received service request to the target server in the distributed system;

根据所述业务请求确定所述目标服务器当前的服务器并发量和/或业务类别并发量;其中,所述服务器并发量为所述目标服务器的总业务请求并发量,所述业务类别并发量为属于所述业务请求对应的业务类别的总业务请求并发量;Determine the current server concurrency and/or service category concurrency of the target server according to the service request; wherein, the server concurrency is the total service request concurrency of the target server, and the service category concurrency is the The total concurrent service requests of the service category corresponding to the service request;

根据所述服务器并发量和/或业务类别并发量对所述目标服务器进行流量控制;performing flow control on the target server according to the server concurrency and/or service category concurrency;

若所述目标服务器接受所述业务请求,则根据所述业务请求确定所述分布式系统当前的系统并发量;If the target server accepts the service request, then determine the current system concurrency of the distributed system according to the service request;

根据所述系统并发量对所述分布式系统进行流量控制。Perform flow control on the distributed system according to the system concurrency.

第二方面,本发明实施例还提供了一种分布式系统的流量控制装置,包括:In the second aspect, the embodiment of the present invention also provides a flow control device for a distributed system, including:

业务请求分配模块,用于将接收的业务请求分配至所述分布式系统中的目标服务器;A service request allocation module, configured to allocate received service requests to target servers in the distributed system;

服务器并发量确定模块,用于根据所述业务请求确定所述目标服务器当前的服务器并发量和/或业务类别并发量;其中,所述服务器并发量为所述目标服务器的总业务请求并发量,所述业务类别并发量为属于所述业务请求对应的业务类别的总业务请求并发量;The server concurrency determination module is configured to determine the current server concurrency and/or service category concurrency of the target server according to the service request; wherein the server concurrency is the total service request concurrency of the target server, The concurrent volume of the business category is the total concurrent volume of business requests belonging to the business category corresponding to the business request;

服务器流量控制模块,用于根据所述服务器并发量和/或业务类别并发量对所述目标服务器进行流量控制;A server flow control module, configured to control the flow of the target server according to the concurrent amount of the server and/or the concurrent amount of the business category;

系统并发量确定模块,用于若所述目标服务器接受所述业务请求,则根据所述业务请求确定所述分布式系统当前的系统并发量;A system concurrency determining module, configured to determine the current system concurrency of the distributed system according to the service request if the target server accepts the service request;

系统流量控制模块,用于根据所述系统并发量对所述分布式系统进行流量控制。A system flow control module, configured to control the flow of the distributed system according to the system concurrency.

第三方面,本发明实施例还提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如本发明实施例中任一所述的分布式系统的流量控制方法。In the third aspect, the embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and operable on the processor. When the processor executes the program, the computer program of the present invention is implemented. The flow control method of the distributed system described in any one of the embodiments.

第四方面,本发明实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本发明实施例中任一所述的分布式系统的流量控制方法。In the fourth aspect, the embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the flow of the distributed system as described in any one of the embodiments of the present invention is realized. Control Method.

第五方面,本发明实施例还提供了一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现如本发明实施例中任一所述的分布式系统的流量控制方法。In the fifth aspect, the embodiment of the present invention also provides a computer program product, including a computer program, when the computer program is executed by a processor, it implements the flow control method of a distributed system as described in any one of the embodiments of the present invention .

本发明实施例中,通过将接收的业务请求分配至所述分布式系统中的目标服务器;根据所述业务请求确定所述目标服务器当前的服务器并发量和/或业务类别并发量;根据所述服务器并发量和/或业务类别并发量对所述目标服务器进行流量控制;若所述目标服务器接受所述业务请求,则根据所述业务请求确定所述分布式系统当前的系统并发量;根据所述系统并发量对所述分布式系统进行流量控制。本实施例的技术方案,通过对分布式系统进行双重流量控制,可以有效的对分布式系统内各服务器实现流量控制,保证分布式集群对服务响应地稳定性和高可用性。In the embodiment of the present invention, by allocating the received service request to the target server in the distributed system; determining the current server concurrency and/or service category concurrency of the target server according to the service request; according to the Server concurrency and/or business class concurrency control the flow of the target server; if the target server accepts the service request, then determine the current system concurrency of the distributed system according to the service request; Perform flow control on the distributed system according to the system concurrency. The technical solution of this embodiment can effectively control the flow of each server in the distributed system by performing dual flow control on the distributed system, and ensure the stability and high availability of the distributed cluster's response to services.

附图说明Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本发明的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to illustrate the technical solutions of the embodiments of the present invention more clearly, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention, and thus It should be regarded as a limitation on the scope, and those skilled in the art can also obtain other related drawings based on these drawings without creative work.

图1为本发明实施例提供的一种分布式系统的流量控制方法的流程图;FIG. 1 is a flowchart of a flow control method for a distributed system provided by an embodiment of the present invention;

图2为本发明实施例提供的另一种分布式系统的流量控制方法的流程图;FIG. 2 is a flow chart of another flow control method for a distributed system provided by an embodiment of the present invention;

图3为本发明实施例提供的又一种分布式系统的流量控制方法的流程图;FIG. 3 is a flowchart of another flow control method for a distributed system provided by an embodiment of the present invention;

图4为本发明实施例提供的又一种分布式系统的流量控制方法的流程图;FIG. 4 is a flowchart of another flow control method for a distributed system provided by an embodiment of the present invention;

图5为本发明实施例提供的一种分布式系统的流量控制装置的结构示意图;FIG. 5 is a schematic structural diagram of a flow control device for a distributed system provided by an embodiment of the present invention;

图6为本发明实施例提供的一种电子设备的结构示意图。FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.

具体实施方式Detailed ways

下面结合附图和实施例对本发明作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部结构。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, but not to limit the present invention. In addition, it should be noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings but not all structures.

应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。同时,在本发明的描述中,术语“第一”、“第二”等仅用于区分描述,而不能理解为指示或暗示相对重要性。本申请技术方案中对数据的获取、存储、使用、处理等均符合国家法律法规的相关规定。It should be noted that like numerals and letters denote similar items in the following figures, therefore, once an item is defined in one figure, it does not require further definition and explanation in subsequent figures. Meanwhile, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish descriptions, and cannot be understood as indicating or implying relative importance. The acquisition, storage, use, and processing of data in the technical solution of this application all comply with the relevant provisions of national laws and regulations.

Redis:一种内存数据库,主要用分布式缓存,当服务端为多服务器集群时,Redis可以很好地解决多服务器之间的缓存数据同步问题。Redis: An in-memory database that mainly uses distributed caching. When the server is a multi-server cluster, Redis can well solve the problem of synchronizing cached data between multiple servers.

图1为本发明实施例提供的一种分布式系统的流量控制方法的流程图,本实施例可适用于分布式系统的流量控制的情况,该方法可以由分布式系统的流量控制装置来执行,该分布式系统的流量控制装置可以采用硬件和/或软件的形式实现,该分布式系统的流量控制装置可配置于电子设备中,该电子设备可以是移动终端、PC端或服务器等。如图1所示,该方法包括:Fig. 1 is a flow chart of a flow control method of a distributed system provided by an embodiment of the present invention. This embodiment is applicable to the flow control of a distributed system, and the method can be executed by a flow control device of a distributed system The flow control device of the distributed system can be implemented in the form of hardware and/or software, and the flow control device of the distributed system can be configured in an electronic device, and the electronic device can be a mobile terminal, a PC or a server. As shown in Figure 1, the method includes:

S110、将接收的业务请求分配至分布式系统中的目标服务器。S110. Distributing the received service request to the target server in the distributed system.

其中,业务请求可以是由分布式系统中数据服务总线接收的外部系统的数据服务请求,示例性的,如提供服务寻址服务等。目标服务器可以是分布式系统中已注册服务信息的任意应用服务器。Wherein, the service request may be a data service request of an external system received by the data service bus in the distributed system, for example, providing a service addressing service and the like. The target server can be any application server that has registered service information in the distributed system.

具体的,业务请求分配是随机的,数据服务总线将接收的业务请求随机分配到分布式系统中的目标服务器中。Specifically, the distribution of service requests is random, and the data service bus randomly distributes the received service requests to the target servers in the distributed system.

S120、根据业务请求确定目标服务器当前的服务器并发量和/或业务类别并发量。S120. Determine the current server concurrency and/or service category concurrency of the target server according to the service request.

其中,服务器并发量为目标服务器的总业务请求并发量,业务类别并发量为属于业务请求对应的业务类别的总业务请求并发量。Wherein, the server concurrency is the total service request concurrency of the target server, and the service category concurrency is the total service request concurrency belonging to the service category corresponding to the service request.

具体的,在系统中可以同时支持多种业务类别,例如可以通过在业务请求报文中的呼入码中体现,不同的呼入码对应不同的业务类别。Specifically, multiple service categories can be supported in the system at the same time, for example, it can be reflected in the call-in code in the service request message, and different call-in codes correspond to different service categories.

具体的,系统可以在业务请求接入点实施数据采集,如可以采集包含控制策略逻辑所需的关键特征数据。同时可以根据业务请求确定业务请求的数量,然后系统将服务器并发量累加业务请求的数量,获得目标服务器当前的服务器并发量。根据上述采集的关键特征数据获取业务请求的业务类别标识,然后将业务类别标识对应的业务类别并发量累加业务请求的数量,获得目标服务器当前的业务类别并发量。Specifically, the system can implement data collection at the service request access point, for example, it can collect key characteristic data required by the logic of the control strategy. At the same time, the number of business requests can be determined according to the business requests, and then the system will add the server concurrency to the number of business requests to obtain the current server concurrency of the target server. Obtain the service category identifier of the service request according to the key feature data collected above, and then add the service category concurrency corresponding to the service category identifier to the number of service requests to obtain the current service category concurrency of the target server.

可选的,根据业务请求确定目标服务器当前的服务器并发量和/或业务类别并发量的方式可以是:将服务器并发量累加业务请求的数量,获得目标服务器当前的服务器并发量;获取业务请求的业务类别标识;将业务类别标识对应的业务类别并发量累加业务请求的数量,获得目标服务器当前的业务类别并发量。Optionally, the method of determining the current server concurrency and/or business category concurrency of the target server according to the business request may be: adding the server concurrency to the number of business requests to obtain the current server concurrency of the target server; Business category identifier; add the number of business requests to the concurrent service category corresponding to the service category identifier to obtain the current concurrent service category of the target server.

具体的,业务类别标识可以是业务请求的关键特征数据中标识具体业务类别的数据。示例性的,在业务请求报文中的关键特征数据中呼入码可以作为业务类别标识,根据不同的业务类别标识,来对应不同的业务类别。Specifically, the service category identifier may be data identifying a specific service category in the key characteristic data of the service request. Exemplarily, the call-in code in the key feature data in the service request message may be used as a service category identifier, and different service category identifiers may be used to correspond to different service categories.

具体的,系统可以在业务请求接入点实施数据采集。根据业务请求确定业务请求的数量,然后系统将服务器并发量累加业务请求的数量,获得目标服务器当前的服务器并发量。根据上述采集的关键特征数据获取业务请求的业务类别标识,然后将业务类别标识对应的业务类别并发量累加业务请求的数量,获得目标服务器当前的业务类别并发量。Specifically, the system can implement data collection at the service request access point. The number of business requests is determined according to the business requests, and then the system adds the server concurrency to the number of business requests to obtain the current server concurrency of the target server. Obtain the service category identifier of the service request according to the key feature data collected above, and then add the service category concurrency corresponding to the service category identifier to the number of service requests to obtain the current service category concurrency of the target server.

在本实施例中,通过确定目标服务器当前的服务器并发量和/或业务类别并发量,可以调用相关的流控策略根据并发量的数量进行判断逻辑处理,为后续根据比较结果来决定对访问请求实施放行或拦截操作。In this embodiment, by determining the current server concurrency and/or business category concurrency of the target server, the relevant flow control strategy can be called to perform judgment logic processing according to the number of concurrency, and to determine the access request based on the comparison result in the future. Implement a pass or block operation.

S130、根据服务器并发量和/或业务类别并发量对目标服务器进行流量控制。S130. Perform flow control on the target server according to the server concurrency and/or the service category concurrency.

具体的,流量控制可以是来访服务进行控制,只允许符合要求的服务进入系统,超过的部分将被拒绝、排队或等待、降低等处理。Specifically, flow control can be controlled by visiting services, only allowing services that meet the requirements to enter the system, and the excess will be rejected, queued or waited, reduced, etc.

具体的,首先根据上述确定的服务器并发量和/或业务类别并发量对当前流量状态进行阈值判断,调用设定的相关流控策略判断逻辑进行处理,根据比较结果对目标服务器进行流量控制,即决定是否接受业务请求或拒绝业务请求。Specifically, firstly, according to the above-mentioned determined server concurrency and/or service category concurrency, threshold judgment is made on the current traffic state, and the set related flow control policy judgment logic is invoked for processing, and traffic control is performed on the target server according to the comparison result, that is Decide whether to accept or reject the business request.

可选的,在根据服务器并发量和/或业务类别并发量对目标服务器进行流量控制之前,还包括:配置目标服务器对应的第一设定阈值以及各业务类别对应的第二设定阈值;其中,各业务类别的第二设定阈值总和小于或等于第一设定阈值。Optionally, before performing traffic control on the target server according to the concurrency of the server and/or the concurrency of the service category, it also includes: configuring the first set threshold corresponding to the target server and the second set threshold corresponding to each service category; wherein , the sum of the second set thresholds of each service category is less than or equal to the first set threshold.

具体的,第一设定阈值可以是预先设定的阈值,根据目标服务器的总并发量进行相应的设定。第二设定阈值可以是预先设定的阈值,该设定阈值可以由多个阈值组成,根据目标服务器的业务类别并发量进行对应的设定。即不同的业务类别可以对应一个与该业务类别对应的第二设定阈值,上述阈值设定可以根据实际需要进行设定,在本发明实施例中不做具体限定。其中,各业务类别的第二设定阈值总和小于或等于第一设定阈值。Specifically, the first set threshold may be a preset threshold, which is set accordingly according to the total concurrency of the target server. The second set threshold may be a preset threshold, and the set threshold may be composed of multiple thresholds, which are set correspondingly according to the concurrency of the service category of the target server. That is, different service categories may correspond to a second set threshold corresponding to the service category, and the foregoing threshold setting may be set according to actual needs, and is not specifically limited in this embodiment of the present invention. Wherein, the sum of the second set thresholds of each service category is less than or equal to the first set threshold.

可选的,根据服务器并发量和/或业务类别并发量对目标服务器进行流量控制的方式可以是:若服务器并发量小于第一设定阈值,且业务类别并发量小于业务类别对应的第二设定阈值,则目标服务器接受业务请求;若服务器并发量大于或者等于第一设定阈值,和/或业务类别并发量大于或者等于第二设定阈值,则调用设定流控策略对目标服务器进行流量控制。Optionally, the way to control the flow of the target server according to the concurrency of the server and/or the concurrency of the service category may be: if the concurrency of the server is less than the first set threshold, and the concurrency of the service category is less than the second set threshold corresponding to the service category If the threshold is set, the target server accepts the service request; if the concurrent amount of the server is greater than or equal to the first set threshold, and/or the concurrent amount of the business category is greater than or equal to the second set threshold, then the set flow control policy is invoked to perform traffic control on the target server. flow control.

具体的,设定流控策略可以是一个设定的流量控制的策略,其中,流控策略中可以包括是否立刻接受业务请求或者延时接受该业务请求或者拒绝业务请求。当满足设定条件时,可以调用设定的流控策略进行流量控制,具体的流控策略可以根据实际需要进行设定,在本发明实施例中不做具体限定。Specifically, setting the flow control policy may be a set flow control policy, wherein the flow control policy may include whether to accept the service request immediately, to accept the service request after a delay, or to reject the service request. When the set conditions are met, the set flow control strategy can be invoked to control the flow. The specific flow control strategy can be set according to actual needs, and is not specifically limited in the embodiment of the present invention.

具体的,将服务器并发量与设定的第一设定阈值进行比较,同时将业务类别并发量与该业务类别对应的第二设定阈值进行比较,若服务器并发量小于第一设定阈值,且业务类别并发量小于业务类别对应的第二设定阈值,则目标服务器接受业务请求。若服务器并发量大于或者等于第一设定阈值,和/或业务类别并发量大于或者等于第二设定阈值,则调用设定流控策略对目标服务器进行流量控制。Specifically, compare the concurrent amount of the server with the set first threshold, and compare the concurrent amount of the business category with the second threshold corresponding to the business category. If the concurrent amount of the server is less than the first threshold, And if the concurrent amount of the service category is less than the second set threshold corresponding to the service category, the target server accepts the service request. If the concurrency of the server is greater than or equal to the first set threshold, and/or the concurrency of the service category is greater than or equal to the second set threshold, the set flow control policy is invoked to control the flow of the target server.

可选的,调用设定流控策略对目标服务器进行流量控制的方式可以是:拒绝业务请求。Optionally, the method of invoking the set flow control policy to control the flow of the target server may be: rejecting the service request.

当上述服务器并发量大于或者等于第一设定阈值,和/或业务类别并发量大于或者等于第二设定阈值时,可以直接拒绝该业务请求。When the aforementioned server concurrency is greater than or equal to the first set threshold, and/or the service category concurrency is greater than or equal to the second set threshold, the service request may be directly rejected.

可选的,调用设定流控策略对目标服务器进行流量控制的方式可以是:缓存业务请求设定时长,若在设定时长内目标服务器达到服务器并发量小于第一设定阈值,且业务类别并发量小于业务类别对应的第二设定阈值的状态,则目标服务器接受业务请求;若在设定时长内目标服务器保持在服务器并发量大于或者等于第一设定阈值,和/或业务类别并发量大于或者等于第二设定阈值的状态,则拒绝业务请求。Optionally, the method of invoking the set flow control strategy to control the flow of the target server may be: cache the service request for a set time, if the target server reaches the server concurrency within the set time and is less than the first set threshold, and the business type If the concurrency amount is less than the second set threshold value corresponding to the service category, the target server accepts the service request; if the target server remains in the state where the server concurrency amount is greater than or equal to the first set threshold value within the set time period, and/or the service category concurrency If the amount is greater than or equal to the second set threshold, the service request is rejected.

具体的,当上述服务器并发量大于或者等于第一设定阈值,和/或业务类别并发量大于或者等于第二设定阈值时,可以先将业务请求放入缓存中,若在设定时长内目标服务器达到服务器并发量小于第一设定阈值,且业务类别并发量小于业务类别对应的第二设定阈值的状态,则目标服务器接受业务请求。若在设定时长内目标服务器仍然保持在服务器并发量大于或者等于第一设定阈值,和/或业务类别并发量大于或者等于第二设定阈值的状态,则拒绝业务请求。其中,设定时长可以设定为5秒或者10s等,根据实际需要进行设定,在本发明实施例中不做具体限定。Specifically, when the above-mentioned concurrency of the server is greater than or equal to the first set threshold, and/or the concurrency of the service category is greater than or equal to the second set threshold, the service request can be put into the cache first. When the target server reaches a state where the server concurrency is less than the first set threshold and the service category concurrency is less than the second set threshold corresponding to the service category, the target server accepts the service request. If the target server remains in a state where the server concurrency is greater than or equal to the first set threshold and/or the service category concurrency is greater than or equal to the second set threshold within the set time period, the service request is rejected. Wherein, the set duration can be set to 5 seconds or 10s, etc., which is set according to actual needs, and is not specifically limited in the embodiment of the present invention.

可选的,调用设定流控策略对目标服务器进行流量控制的方式可以是:将业务请求转发至分布式系统中的其他服务器,使得其他服务器对业务请求进行流量控制。Optionally, the method of invoking and setting the flow control policy to control the flow of the target server may be: forwarding the service request to other servers in the distributed system, so that other servers perform flow control on the service request.

具体的,当上述服务器并发量大于或者等于第一设定阈值,和/或业务类别并发量大于或者等于第二设定阈值时,或者若在设定时长内目标服务器仍然保持在服务器并发量大于或者等于第一设定阈值,和/或业务类别并发量大于或者等于第二设定阈值的状态,则可以将业务请求转发至分布式系统中的其他服务器,使得其他服务器对业务请求进行流量控制。其中,其他服务器对业务请求进行流量控制的方式和上述方式相同,此处不再赘述。Specifically, when the above-mentioned server concurrency is greater than or equal to the first set threshold, and/or the service category concurrency is greater than or equal to the second set threshold, or if the target server still maintains the server concurrency greater than or equal to Or it is equal to the first set threshold, and/or the concurrency of the service category is greater than or equal to the second set threshold, then the service request can be forwarded to other servers in the distributed system, so that other servers can control the flow of service requests . Wherein, other servers control the flow of service requests in the same way as the above-mentioned way, and will not be repeated here.

在本实施例中,通过流量控制策略,可以对分布式系统内各服务器实现流量控制,保证分布式集群对服务响应地稳定性和高可用性。In this embodiment, through the flow control policy, the flow control of each server in the distributed system can be implemented, so as to ensure the stability and high availability of the service response of the distributed cluster.

可选的,在拒绝业务请求之后,还包括:根据业务请求的数量更新目标服务器的服务器并发量和/或业务类别并发量。Optionally, after rejecting the service request, the method further includes: updating the server concurrency and/or service category concurrency of the target server according to the number of service requests.

具体的,在上述拒绝业务请求之后,根据目标服务器的服务器并发量和/或业务类别并发量减去上述业务请求的数量,更新目标服务器的服务器并发量和/或业务类别并发量。Specifically, after the service request is rejected, the server concurrency and/or service category concurrency of the target server is updated based on the target server's server concurrency and/or service category concurrency minus the number of service requests.

在本实施例中,通过更新并发量,各服务器后续继续按照上述方法进行实现流量控制,保证流量控制的准确性。In this embodiment, by updating the concurrency amount, each server continues to implement flow control according to the above method to ensure the accuracy of flow control.

S140、若目标服务器接受业务请求,则根据业务请求确定分布式系统当前的系统并发量。S140. If the target server accepts the service request, determine the current system concurrency of the distributed system according to the service request.

具体的,若上述目标服务器接受业务请求,根据获取的上述业务请求的关键信息,确定对应的系统并发量,然后将关键信息对应的系统并发量累加业务请求的数量,获得分布式系统的关键信息的当前的系统并发量。Specifically, if the above-mentioned target server accepts the service request, determine the corresponding system concurrency according to the obtained key information of the above-mentioned service request, and then add the system concurrency corresponding to the key information to the number of business requests to obtain the key information of the distributed system The current system concurrency.

可选的,根据业务请求确定分布式系统的系统并发量的方式可以是:获取业务请求的关键信息;其中,关键信息包括:业务类别、业务子类别及安全节点信息;将关键信息对应的系统并发量累加业务请求的数量,获得分布式系统的关键信息的当前的系统并发量。Optionally, the way to determine the system concurrency of the distributed system according to the business request may be: obtain the key information of the business request; wherein, the key information includes: business category, business subcategory, and security node information; the system corresponding to the key information Concurrency adds up the number of business requests to obtain the current system concurrency of the key information of the distributed system.

具体的,在系统中可以同时支持多种业务类别,获取业务请求的关键信息,其中,关键信息包括:业务类别、业务子类别及安全节点信息。在业务请求报文中的呼入码为A1271D001,A1271D002等,对应不同的业务类别。在每个业务类别下再通过报文中的子服务号定义具体的业务子类别,示例性的,如NEDPCST001,NEDPCST002等,即具体的业务子类别,通过报文中的安全节点信息来对应不同的外呼系统来源。举例来说,A1271D001对应的ORACLE联机实时同步查询,子服务号NEDPCST001表示客户信用等级查询、NEDPCST002表示客户积分查询;安全节点信息10001可以是风险应用系统、10002可以是客户营销系统。最后将根据关键信息确定对应的系统并发量并累加业务请求的数量,获得分布式系统的关键信息的当前的系统并发量。Specifically, the system can support multiple service categories at the same time, and obtain key information of service requests, wherein the key information includes: service category, service subcategory, and security node information. The call-in codes in the service request message are A1271D001, A1271D002, etc., corresponding to different service categories. Under each service category, the specific service subcategory is defined by the sub-service number in the message. For example, such as NEDPCST001, NEDPCST002, etc., that is, the specific service subcategory, which corresponds to different service categories through the security node information in the message. source of the outbound call system. For example, A1271D001 corresponds to ORACLE online real-time synchronous query, sub-service number NEDPCST001 indicates customer credit rating query, NEDPCST002 indicates customer point query; security node information 10001 can be the risk application system, and 10002 can be the customer marketing system. Finally, the corresponding system concurrency will be determined according to the key information and the number of business requests will be accumulated to obtain the current system concurrency of the key information of the distributed system.

S150、根据系统并发量对分布式系统进行流量控制。S150. Perform flow control on the distributed system according to the system concurrency.

具体的,流量控制可以是根据流量、并发线程数、响应时间等指标对来访服务进行控制,只允许符合要求要求的服务进入系统,超过的部分将被拒绝、排队或等待、降低等处理。Specifically, flow control can control incoming services based on indicators such as flow rate, number of concurrent threads, and response time. Only services that meet the requirements are allowed to enter the system, and the excess will be rejected, queued or waited, and reduced.

具体的,首先根据上述确定的系统并发量对当前流量状态进行阈值判断,调用设定的相关流控策略判断逻辑进行处理,根据比较结果对分布式系统进行流量控制,即决定是否接受业务请求或拒绝业务请求。Specifically, first judge the current traffic state based on the threshold of the system concurrency determined above, call the set relevant flow control strategy judgment logic for processing, and control the flow of the distributed system according to the comparison result, that is, decide whether to accept the service request or Deny the business request.

可选的,根据系统并发量对分布式系统进行流量控制的方式可以是:从Redis缓存中获取关键信息对应的第三设定阈值;若系统并发量小于第三设定阈值,则处理业务请求;若系统并发量大于或等于第三设定阈值,则拒绝业务请求。Optionally, the way to control the flow of the distributed system according to the system concurrency can be: obtain the third set threshold corresponding to the key information from the Redis cache; if the system concurrency is less than the third set threshold, process the business request ; If the system concurrency is greater than or equal to the third set threshold, reject the service request.

具体的,第三设定阈值可以是预先设定的阈值,根据Redis缓存中的关键信息进行相应的设定。具体的阈值设定可以根据实际需要进行设定,在本发明实施例中不做具体限定。Specifically, the third set threshold may be a preset threshold, which is set accordingly according to key information in the Redis cache. The specific threshold setting can be set according to actual needs, and is not specifically limited in this embodiment of the present invention.

具体的,从Redis缓存中获取关键信息对应的第三设定阈值。将系统的并发量与第三设定阈值进行比较,若系统并发量小于第三设定阈值,则处理业务请求。若系统并发量大于或等于第三设定阈值,则拒绝业务请求。Specifically, the third set threshold corresponding to the key information is acquired from the Redis cache. The system concurrency is compared with the third set threshold, and if the system concurrency is less than the third set threshold, the service request is processed. If the system concurrency is greater than or equal to the third set threshold, the service request is rejected.

在本实施例中,使用Redis缓存在业务应用请求高并发的情况下,在全局对各类具体业务服务请求,甚至是包括服务请求系统,进行并发控制,这样才保证应用系统根据实际业务需要有效、均衡着控制各类交易的访问,利用redis缓存来实现了全局流控场景。In this embodiment, Redis cache is used to control the concurrency of various specific business service requests globally, even including the service request system, in the case of high concurrency of business application requests, so as to ensure that the application system is effective according to actual business needs. , Balance and control the access of various transactions, and use redis cache to realize the global flow control scenario.

可选的,在拒绝业务请求之后,还包括:根据业务请求的数量更新关键信息对应的系统并发量。Optionally, after rejecting the business request, the method further includes: updating the system concurrency corresponding to the key information according to the number of business requests.

具体的,在上述拒绝业务请求之后,根据分布式系统的系统并发量和/或业务类别并发量减去上述业务请求的数量,更新分布式系统的系统并发量和/或业务类别并发量。Specifically, after the service request is rejected, the system concurrency and/or service category concurrency of the distributed system is updated according to the system concurrency and/or service category concurrency of the distributed system minus the above service request quantity.

本发明实施例中,通过将接收的业务请求分配至分布式系统中的目标服务器;根据业务请求确定目标服务器当前的服务器并发量和/或业务类别并发量;根据服务器并发量和/或业务类别并发量对目标服务器进行流量控制;若目标服务器接受业务请求,则根据业务请求确定分布式系统当前的系统并发量;根据系统并发量对分布式系统进行流量控制。利用该方法,通过对分布式系统进行双重流量控制,可以有效的对分布式系统内各服务器实现流量控制,保证分布式集群对服务响应地稳定性和高可用性。In the embodiment of the present invention, by distributing the received service request to the target server in the distributed system; determining the current server concurrency and/or service category concurrency of the target server according to the service request; according to the server concurrency and/or service category The concurrency is used to control the flow of the target server; if the target server accepts the business request, the current system concurrency of the distributed system is determined according to the business request; the flow of the distributed system is controlled according to the system concurrency. By using this method, by performing dual flow control on the distributed system, the flow control of each server in the distributed system can be effectively realized, and the stability and high availability of the distributed cluster's response to the service can be ensured.

图2为本发明实施例提供的另一种分布式系统的流量控制方法的流程图,本发明实施例是在上述发明实施例基础上的具体化,参见图2,本发明实施例提供的方法具体包括如下步骤:Fig. 2 is a flow chart of another distributed system flow control method provided by the embodiment of the present invention. The embodiment of the present invention is based on the embodiment of the above invention. See Fig. 2, the method provided by the embodiment of the present invention Specifically include the following steps:

S210、将接收的业务请求分配至分布式系统中的目标服务器。S210. Distribute the received service request to the target server in the distributed system.

S220、将服务器并发量累加业务请求的数量,获得目标服务器当前的服务器并发量。S220. Add the server concurrency to the number of service requests to obtain the current server concurrency of the target server.

S230、获取业务请求的业务类别标识。S230. Obtain the service category identifier of the service request.

其中,对于设定规则和交互任务的对应关系可以是一对一、一对多、或多对多的关系。本实施例,在确定出设定规则后,可根据设定规则确定出对应的一个或多个交互任务。Wherein, the corresponding relationship between setting rules and interactive tasks may be one-to-one, one-to-many, or many-to-many. In this embodiment, after the setting rule is determined, one or more corresponding interactive tasks may be determined according to the setting rule.

S240、将业务类别标识对应的业务类别并发量累加业务请求的数量,获得目标服务器当前的业务类别并发量。S240. Accumulate the concurrent amount of the service type corresponding to the service type identifier to the number of service requests to obtain the current concurrent amount of the service type of the target server.

S250、根据服务器并发量和/或业务类别并发量对目标服务器进行流量控制。S250. Perform flow control on the target server according to the concurrency of the server and/or the concurrency of the business category.

S260、根据业务请求确定分布式系统的系统并发量。S260. Determine the system concurrency of the distributed system according to the service request.

S270、根据系统并发量对分布式系统进行流量控制。S270. Perform flow control on the distributed system according to the system concurrency.

图3为本发明实施例提供的又一种分布式系统的流量控制方法的流程图,本发明实施例是在上述发明实施例基础上的具体化,参见图3,本发明实施例提供的方法具体包括如下步骤:Fig. 3 is a flow chart of another distributed system flow control method provided by the embodiment of the present invention. The embodiment of the present invention is based on the embodiment of the above invention. See Fig. 3, the method provided by the embodiment of the present invention Specifically include the following steps:

S310、将接收的业务请求分配至分布式系统中的目标服务器。S310. Distribute the received service request to the target server in the distributed system.

S320、根据业务请求确定目标服务器当前的服务器并发量和/或业务类别并发量。S320. Determine the current server concurrency and/or service category concurrency of the target server according to the service request.

S330、将服务器并发量和业务类别并发量与分别与第一设定阈值和第二设定阈值比较。S330. Compare the concurrency of the server and the concurrency of the service category with the first set threshold and the second set threshold, respectively.

S340、若服务器并发量小于第一设定阈值,且业务类别并发量小于业务类别对应的第二设定阈值,则目标服务器接受业务请求。S340. If the concurrency of the server is less than the first set threshold and the concurrency of the service category is less than the second set threshold corresponding to the service category, the target server accepts the service request.

S350、若服务器并发量大于或者等于第一设定阈值,和/或业务类别并发量大于或者等于第二设定阈值,则调用设定流控策略对目标服务器进行流量控制。S350. If the concurrent amount of the server is greater than or equal to the first set threshold, and/or the concurrent amount of the service category is greater than or equal to the second set threshold, call the set flow control policy to control the flow of the target server.

S360、根据业务请求确定分布式系统的系统并发量。S360. Determine the system concurrency of the distributed system according to the service request.

S370、根据系统并发量对分布式系统进行流量控制。S370. Perform flow control on the distributed system according to the system concurrency.

图4为本发明实施例提供的又一种分布式系统的流量控制方法的流程图。FIG. 4 is a flowchart of another flow control method for a distributed system provided by an embodiment of the present invention.

具体步骤如下:Specific steps are as follows:

S410、将接收的业务请求分配至分布式系统中的目标服务器。S410. Distribute the received service request to the target server in the distributed system.

S420、根据业务请求确定目标服务器当前的服务器并发量和/或业务类别并发量。S420. Determine the current server concurrency and/or service category concurrency of the target server according to the service request.

S430、根据服务器并发量和/或业务类别并发量对目标服务器进行流量控制。S430. Perform flow control on the target server according to the server concurrency and/or the service category concurrency.

S440、获取业务请求的关键信息;其中,关键信息包括:业务类别、业务子类别及安全节点信息。S440. Acquire key information of the service request; wherein, the key information includes: service category, service subcategory, and security node information.

S450、将关键信息对应的系统并发量累加业务请求的数量,获得分布式系统的关键信息的当前的系统并发量。S450. Accumulate the system concurrency amount corresponding to the key information to the number of service requests to obtain the current system concurrency amount of the key information of the distributed system.

S460、从Redis缓存中获取关键信息对应的第三设定阈值。将系统并发量与第三设定阈值进行比较。S460. Obtain a third set threshold corresponding to the key information from the Redis cache. Comparing the system concurrency with the third set threshold.

S470、若系统并发量小于第三设定阈值,则处理业务请求。S470. If the system concurrency is less than the third set threshold, process the service request.

S480、若系统并发量大于或等于第三设定阈值,则拒绝业务请求。S480. If the system concurrency is greater than or equal to the third set threshold, reject the service request.

图5为本发明实施例提供的一种分布式系统的流量控制装置的结构示意图。如图5所示,业务请求分配模块510、服务器并发量确定模块520、服务器流量控制模块530、系统并发量确定模块540及系统流量控制模块550;FIG. 5 is a schematic structural diagram of a flow control device for a distributed system provided by an embodiment of the present invention. As shown in Figure 5, a business request allocation module 510, a server concurrency determination module 520, a server flow control module 530, a system concurrency determination module 540 and a system flow control module 550;

业务请求分配模块510,用于将接收的业务请求分配至所述分布式系统中的目标服务器;A service request allocation module 510, configured to allocate received service requests to target servers in the distributed system;

服务器并发量确定模块520,用于根据所述业务请求确定所述目标服务器当前的服务器并发量和/或业务类别并发量;其中,所述服务器并发量为所述目标服务器的总业务请求并发量,所述业务类别并发量为属于所述业务请求对应的业务类别的总业务请求并发量;The server concurrency determination module 520 is configured to determine the current server concurrency and/or service category concurrency of the target server according to the service request; wherein, the server concurrency is the total service request concurrency of the target server , the concurrent volume of the business category is the total concurrent volume of business requests belonging to the business category corresponding to the business request;

服务器流量控制模块530,用于根据所述服务器并发量和/或业务类别并发量对所述目标服务器进行流量控制;The server flow control module 530 is configured to control the flow of the target server according to the concurrent amount of the server and/or the concurrent amount of the service category;

系统并发量确定模块540,用于若所述目标服务器接受所述业务请求,则根据所述业务请求确定所述分布式系统当前的系统并发量;A system concurrency determination module 540, configured to determine the current system concurrency of the distributed system according to the service request if the target server accepts the service request;

系统流量控制模块550,用于根据所述系统并发量对所述分布式系统进行流量控制。The system flow control module 550 is configured to control the flow of the distributed system according to the system concurrency.

本发明实施例中,通过将接收的业务请求分配至所述分布式系统中的目标服务器;根据所述业务请求确定所述目标服务器当前的服务器并发量和/或业务类别并发量;根据所述服务器并发量和/或业务类别并发量对所述目标服务器进行流量控制;若所述目标服务器接受所述业务请求,则根据所述业务请求确定所述分布式系统当前的系统并发量;根据所述系统并发量对所述分布式系统进行流量控制。利用该方法,通过对分布式系统进行双重流量控制,可以有效的对分布式系统内各服务器实现流量控制,保证分布式集群对服务响应地稳定性和高可用性。In the embodiment of the present invention, by allocating the received service request to the target server in the distributed system; determining the current server concurrency and/or service category concurrency of the target server according to the service request; according to the Server concurrency and/or business class concurrency control the flow of the target server; if the target server accepts the service request, then determine the current system concurrency of the distributed system according to the service request; Perform flow control on the distributed system according to the system concurrency. By using this method, by performing dual flow control on the distributed system, the flow control of each server in the distributed system can be effectively realized, and the stability and high availability of the distributed cluster's response to services can be ensured.

可选的,服务器并发量确定模块520可以具体用于:Optionally, the server concurrency determining module 520 can be specifically used for:

将所述服务器并发量累加所述业务请求的数量,获得所述目标服务器当前的服务器并发量;adding the server concurrency to the number of business requests to obtain the current server concurrency of the target server;

获取所述业务请求的业务类别标识;Obtain the service category identifier of the service request;

将所述业务类别标识对应的业务类别并发量累加所述业务请求的数量,获得所述目标服务器当前的业务类别并发量。Adding the service class concurrency corresponding to the service class identifier to the number of service requests to obtain the current service class concurrency of the target server.

可选的,服务器流量控制模块530可以具体用于:Optionally, the server flow control module 530 may be specifically used for:

若所述服务器并发量小于第一设定阈值,且所述业务类别并发量小于所述业务类别对应的第二设定阈值,则所述目标服务器接受所述业务请求;If the server concurrency is less than a first set threshold, and the service category concurrency is less than a second set threshold corresponding to the service category, then the target server accepts the service request;

若所述服务器并发量大于或者等于所述第一设定阈值,和/或所述业务类别并发量大于或者等于所述第二设定阈值,则调用设定流控策略对所述目标服务器进行流量控制。If the concurrency of the server is greater than or equal to the first set threshold, and/or the concurrency of the service category is greater than or equal to the second set threshold, call the set flow control policy to perform the target server flow control.

可选的,服务器流量控制模块530可以具体用于:Optionally, the server flow control module 530 may be specifically used for:

拒绝所述业务请求。The service request is rejected.

可选的,服务器流量控制模块530可以具体用于:Optionally, the server flow control module 530 may be specifically used for:

缓存所述业务请求设定时长,若在所述设定时长内所述目标服务器达到所述服务器并发量小于第一设定阈值,且所述业务类别并发量小于所述业务类别对应的第二设定阈值的状态,则所述目标服务器接受所述业务请求;Cache the service request for a set duration, if within the set duration, the target server achieves that the server concurrency is less than the first set threshold, and the service category concurrency is less than the second threshold corresponding to the service category If the state of the threshold is set, the target server accepts the service request;

若在所述设定时长内所述目标服务器保持在所述服务器并发量大于或者等于所述第一设定阈值,和/或所述业务类别并发量大于或者等于所述第二设定阈值的状态,则拒绝所述业务请求。If the target server remains within the set time period, the concurrency of the server is greater than or equal to the first set threshold, and/or the concurrency of the service category is greater than or equal to the second set threshold state, the service request is rejected.

可选的,服务器流量控制模块530可以具体用于:Optionally, the server flow control module 530 may be specifically used for:

将所述业务请求转发至所述分布式系统中的其他服务器,使得其他服务器对所述业务请求进行流量控制。Forwarding the service request to other servers in the distributed system, so that other servers perform flow control on the service request.

可选的,在拒绝所述业务请求之后,装置还可以具体用于:Optionally, after rejecting the service request, the device may also be specifically used to:

根据所述业务请求的数量更新所述目标服务器的服务器并发量和/或业务类别并发量。Updating the server concurrency and/or service category concurrency of the target server according to the number of service requests.

可选的,在根据所述服务器并发量和/或业务类别并发量对所述目标服务器进行流量控制之前,装置还可以具体用于:Optionally, before performing flow control on the target server according to the server concurrency and/or service category concurrency, the device may also be specifically used for:

配置所述目标服务器对应的第一设定阈值以及各业务类别对应的第二设定阈值;其中,所述各业务类别的第二设定阈值总和小于或等于所述第一设定阈值。Configuring a first set threshold corresponding to the target server and a second set threshold corresponding to each service category; wherein, the sum of the second set thresholds of each service category is less than or equal to the first set threshold.

可选的,系统并发量确定模块540可以具体用于:Optionally, the system concurrency determination module 540 can be specifically used for:

获取所述业务请求的关键信息;其中,所述关键信息包括:业务类别、业务子类别及安全节点信息;Obtain key information of the service request; wherein, the key information includes: service category, service subcategory, and security node information;

将所述关键信息对应的系统并发量累加所述业务请求的数量,获得所述分布式系统的所述关键信息的当前的系统并发量。The system concurrency corresponding to the key information is added to the number of service requests to obtain the current system concurrency of the key information of the distributed system.

可选的,系统流量控制模块550可以具体用于:Optionally, the system flow control module 550 may be specifically used for:

从Redis缓存中获取所述关键信息对应的第三设定阈值;Obtaining the third set threshold corresponding to the key information from the Redis cache;

若所述系统并发量小于所述第三设定阈值,则处理所述业务请求;If the system concurrency is less than the third set threshold, process the service request;

若所述系统并发量大于或等于所述第三设定阈值,则拒绝所述业务请求。If the system concurrency is greater than or equal to the third set threshold, reject the service request.

可选的,在拒绝所述业务请求之后,装置还可以具体用于:Optionally, after rejecting the service request, the device may also be specifically used to:

根据所述业务请求的数量更新所述关键信息对应的系统并发量。The system concurrency corresponding to the key information is updated according to the number of service requests.

本发明实施例所提供的分布式系统的流量控制装置可执行本发明任意实施例所提供的分布式系统的流量控制方法,具备执行方法相应的功能模块和有益效果。The flow control device of the distributed system provided by the embodiment of the present invention can execute the flow control method of the distributed system provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.

图6为本发明实施例提供的一种电子设备的结构示意图。图6示出了适于用来实现本发明实施方式的电子设备12的框图。图6显示的电子设备12仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。设备12是典型的实现分布式系统的流量控制的电子设备。FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. Figure 6 shows a block diagram of an electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in FIG. 6 is only an example, and should not limit the functions and scope of use of this embodiment of the present invention. Device 12 is typically an electronic device for implementing flow control in a distributed system.

如图6所示,电子设备12以通用计算设备的形式表现。电子设备12的组件可以包括但不限于:一个或者多个处理器16,存储器28,连接不同系统组件(包括存储器28和处理器16)的总线18。As shown in FIG. 6, electronic device 12 takes the form of a general-purpose computing device. Components of electronic device 12 may include, but are not limited to: one or more processors 16, memory 28, bus 18 connecting various system components (including memory 28 and processor 16).

总线18表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(Industry StandardArchitecture,ISA)总线,微通道体系结构(Micro Channel Architecture,MCA)总线,增强型ISA总线、视频电子标准协会(Video Electronics Standards Association,VESA)局域总线以及外围组件互连(Peripheral Component Interconnect,PCI)总线。Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (Industry Standard Architecture, ISA) bus, Micro Channel Architecture (Micro Channel Architecture, MCA) bus, Enhanced ISA bus, Video Electronics Standards Association (Video Electronics Standards Association , VESA) local bus and peripheral component interconnect (Peripheral Component Interconnect, PCI) bus.

电子设备12典型地包括多种计算机系统可读介质。这些介质可以是任何能够被电子设备12访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。Electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 12 and include both volatile and nonvolatile media, removable and non-removable media.

存储器28可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(Random Access Memory,RAM)30和/或高速缓存存储器32。电子设备12可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统34可以用于读写不可移动的、非易失性磁介质(图6未显示,通常称为“硬盘驱动器”)。尽管图6中未示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如只读光盘(Compact Disc-Read Only Memory,CD-ROM)、数字视盘(Digital Video Disc-Read Only Memory,DVD-ROM)或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线18相连。存储器28可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本发明各实施例的功能。Memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (Random Access Memory, RAM) 30 and/or cache memory 32 . The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read and write to non-removable, non-volatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard drive"). Although not shown in FIG. 6, a disk drive for reading and writing to a removable non-volatile disk (such as a "floppy disk") may be provided, as well as a removable non-volatile disk (such as a Compact Disc- Read Only Memory, CD-ROM), Digital Video Disc (Digital Video Disc-Read Only Memory, DVD-ROM) or other optical media) CD-ROM drive. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (eg, at least one) of program modules configured to perform the functions of various embodiments of the present invention.

具有一组(至少一个)程序模块26的程序36,可以存储在例如存储28中,这样的程序模块26包括但不限于操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块26通常执行本发明所描述的实施例中的功能和/或方法。A program 36 having a set (at least one) of program modules 26, such as but not limited to, an operating system, one or more application programs, other program modules, and program data, may be stored, for example, in storage 28. Each or some combination of these may include implementations of network environments. Program modules 26 generally perform the functions and/or methodologies of the described embodiments of the invention.

电子设备12也可以与一个或多个外部设备14(例如键盘、指向设备、摄像头、显示器24等)通信,还可与一个或者多个使得用户能与该电子设备12交互的设备通信,和/或与使得该电子设备12能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口22进行。并且,电子设备12还可以通过网络适配器20与一个或者多个网络(例如局域网(Local Area Network,LAN),广域网Wide Area Network,WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器20通过总线18与电子设备12的其它模块通信。应当明白,尽管图中未示出,可以结合电子设备12使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、磁盘阵列(Redundant Arrays of Independent Disks,RAID)系统、磁带驱动器以及数据备份存储系统等。The electronic device 12 can also communicate with one or more external devices 14 (such as keyboards, pointing devices, cameras, displays 24, etc.), and can also communicate with one or more devices that enable the user to interact with the electronic device 12, and/or Or communicate with any device (eg, network card, modem, etc.) that enables the electronic device 12 to communicate with one or more other computing devices. Such communication may occur through input/output (I/O) interface 22 . Moreover, the electronic device 12 can also communicate with one or more networks (such as a local area network (Local Area Network, LAN), wide area network, Wide Area Network, WAN) and/or public networks, such as the Internet) through the network adapter 20 . As shown, network adapter 20 communicates with other modules of electronic device 12 via bus 18 . It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, disk arrays (Redundant Arrays) of Independent Disks, RAID) systems, tape drives, and data backup storage systems.

处理器16通过运行存储在存储器28中的程序,从而执行各种功能应用以及数据处理,例如实现本发明上述实施例所提供的分布式系统的流量控制方法。The processor 16 executes various functional applications and data processing by running the programs stored in the memory 28, for example, realizing the flow control method of the distributed system provided by the above-mentioned embodiments of the present invention.

本发明实施例提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该程序被处理装置执行时实现如本发明实施例中的分布式系统的流量控制方法。本发明上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。An embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the program is executed by a processing device, the flow control method of a distributed system as in the embodiment of the present invention is implemented. The computer-readable medium mentioned above in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. A computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText TransferProtocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。In some embodiments, the client and the server can communicate using any currently known or future-developed network protocols such as HTTP (HyperText Transfer Protocol, Hypertext Transfer Protocol), and can communicate with digital data in any form or medium (eg, communication network) interconnections. Examples of communication networks include local area networks ("LANs"), wide area networks ("WANs"), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network of.

上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.

上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:当目标用户触发智能客服服务时,获取所述目标用户的用户标识;根据所述用户标识确定至少一个交互任务;其中所述交互任务包括多个任务要素;根据所述任务要素从所述至少一个交互任务中确定目标交互任务;执行所述目标交互任务以与所述目标用户进行交互。The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: when the target user triggers the intelligent customer service service, acquires the user identification of the target user; Determine at least one interactive task according to the user identification; wherein the interactive task includes a plurality of task elements; determine a target interactive task from the at least one interactive task according to the task elements; execute the target interactive task to interact with the target users to interact with.

可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, or combinations thereof, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and Includes conventional procedural programming languages - such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through an Internet service provider). Internet connection).

附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.

描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定。The units involved in the embodiments described in the present disclosure may be implemented by software or by hardware. Wherein, the name of a unit does not constitute a limitation of the unit itself under certain circumstances.

本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。The functions described herein above may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), System on Chips (SOCs), Complex Programmable Logical device (CPLD) and so on.

在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.

本发明实施例还提供了一种计算机程序产品,包括计算机程序,该计算机程序在被处理器执行时实现如本申请任一实施例所提供的分布式系统的流量控制方法。An embodiment of the present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, the flow control method of a distributed system as provided in any embodiment of the present application is implemented.

计算机程序产品在实现的过程中,可以以一种或多种程序设计语言或其组合来编写用于执行本发明操作的计算机程序代码,程序设计语言包括面向对象的程序设计语言,诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言,诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。During the implementation of the computer program product, the computer program code for performing the operation of the present invention can be written in one or more programming languages or a combination thereof, and the programming language includes an object-oriented programming language, such as Java, Smalltalk , C++, and also conventional procedural programming languages such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through an Internet service provider). Internet connection).

注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments of the present invention and applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present invention, and the present invention The scope is determined by the scope of the appended claims.

Claims (15)

1.一种分布式系统的流量控制方法,其特征在于,所述分布式系统包括多个服务器;包括:1. A flow control method of a distributed system, characterized in that, the distributed system includes a plurality of servers; comprising: 将接收的业务请求分配至所述分布式系统中的目标服务器;Distributing the received service request to the target server in the distributed system; 根据所述业务请求确定所述目标服务器当前的服务器并发量和/或业务类别并发量;其中,所述服务器并发量为所述目标服务器的总业务请求并发量,所述业务类别并发量为属于所述业务请求对应的业务类别的总业务请求并发量;Determine the current server concurrency and/or service category concurrency of the target server according to the service request; wherein, the server concurrency is the total service request concurrency of the target server, and the service category concurrency is the The total concurrent service requests of the service category corresponding to the service request; 根据所述服务器并发量和/或业务类别并发量对所述目标服务器进行流量控制;performing flow control on the target server according to the server concurrency and/or service category concurrency; 若所述目标服务器接受所述业务请求,则根据所述业务请求确定所述分布式系统当前的系统并发量;If the target server accepts the service request, then determine the current system concurrency of the distributed system according to the service request; 根据所述系统并发量对所述分布式系统进行流量控制。Perform flow control on the distributed system according to the system concurrency. 2.根据权利要求1所述的方法,其特征在于,根据所述业务请求确定所述目标服务器当前的服务器并发量和/或业务类别并发量,包括:2. The method according to claim 1, wherein determining the current server concurrency and/or service category concurrency of the target server according to the service request includes: 将所述服务器并发量累加所述业务请求的数量,获得所述目标服务器当前的服务器并发量;adding the server concurrency to the number of business requests to obtain the current server concurrency of the target server; 获取所述业务请求的业务类别标识;Obtain the service category identifier of the service request; 将所述业务类别标识对应的业务类别并发量累加所述业务请求的数量,获得所述目标服务器当前的业务类别并发量。Adding the service class concurrency corresponding to the service class identifier to the number of service requests to obtain the current service class concurrency of the target server. 3.根据权利要求1所述的方法,其特征在于,根据所述服务器并发量和/或业务类别并发量对所述目标服务器进行流量控制,包括:3. The method according to claim 1, characterized in that, performing flow control on the target server according to the concurrent amount of the server and/or the concurrent amount of the service category comprises: 若所述服务器并发量小于第一设定阈值,且所述业务类别并发量小于所述业务类别对应的第二设定阈值,则所述目标服务器接受所述业务请求;If the server concurrency is less than a first set threshold, and the service category concurrency is less than a second set threshold corresponding to the service category, then the target server accepts the service request; 若所述服务器并发量大于或者等于所述第一设定阈值,和/或所述业务类别并发量大于或者等于所述第二设定阈值,则调用设定流控策略对所述目标服务器进行流量控制。If the concurrency of the server is greater than or equal to the first set threshold, and/or the concurrency of the service category is greater than or equal to the second set threshold, call the set flow control policy to perform the target server flow control. 4.根据权利要求3所述的方法,其特征在于,调用设定流控策略对所述目标服务器进行流量控制,包括:4. The method according to claim 3, wherein calling a set flow control policy to control the flow of the target server comprises: 拒绝所述业务请求。The service request is rejected. 5.根据权利要求3所述的方法,其特征在于,调用设定流控策略对所述目标服务器进行流量控制,包括:5. The method according to claim 3, wherein calling a set flow control policy to control the flow of the target server comprises: 缓存所述业务请求设定时长,若在所述设定时长内所述目标服务器达到所述服务器并发量小于第一设定阈值,且所述业务类别并发量小于所述业务类别对应的第二设定阈值的状态,则所述目标服务器接受所述业务请求;Cache the service request for a set duration, if within the set duration, the target server achieves that the server concurrency is less than the first set threshold, and the service category concurrency is less than the second threshold corresponding to the service category If the state of the threshold is set, the target server accepts the service request; 若在所述设定时长内所述目标服务器保持在所述服务器并发量大于或者等于所述第一设定阈值,和/或所述业务类别并发量大于或者等于所述第二设定阈值的状态,则拒绝所述业务请求。If the target server remains within the set time period, the concurrency of the server is greater than or equal to the first set threshold, and/or the concurrency of the service category is greater than or equal to the second set threshold state, the service request is rejected. 6.根据权利要求3所述的方法,其特征在于,调用设定流控策略对所述目标服务器进行流量控制,包括:6. The method according to claim 3, wherein calling a set flow control policy to control the flow of the target server comprises: 将所述业务请求转发至所述分布式系统中的其他服务器,使得其他服务器对所述业务请求进行流量控制。Forwarding the service request to other servers in the distributed system, so that other servers perform flow control on the service request. 7.根据权利要求4或5所述的方法,其特征在于,在拒绝所述业务请求之后,还包括:7. The method according to claim 4 or 5, characterized in that, after rejecting the service request, further comprising: 根据所述业务请求的数量更新所述目标服务器的服务器并发量和/或业务类别并发量。Updating the server concurrency and/or service category concurrency of the target server according to the number of service requests. 8.根据权利要求3所述的方法,其特征在于,在根据所述服务器并发量和/或业务类别并发量对所述目标服务器进行流量控制之前,还包括:8. The method according to claim 3, further comprising: before performing flow control on the target server according to the concurrent amount of the server and/or the concurrent amount of the service category: 配置所述目标服务器对应的第一设定阈值以及各业务类别对应的第二设定阈值;其中,所述各业务类别的第二设定阈值总和小于或等于所述第一设定阈值。Configuring a first set threshold corresponding to the target server and a second set threshold corresponding to each service category; wherein, the sum of the second set thresholds of each service category is less than or equal to the first set threshold. 9.根据权利要求1所述的方法,其特征在于,根据所述业务请求确定所述分布式系统的系统并发量,包括:9. The method according to claim 1, wherein determining the system concurrency of the distributed system according to the service request comprises: 获取所述业务请求的关键信息;其中,所述关键信息包括:业务类别、业务子类别及安全节点信息;Obtain key information of the service request; wherein, the key information includes: service category, service subcategory, and security node information; 将所述关键信息对应的系统并发量累加所述业务请求的数量,获得所述分布式系统的所述关键信息的当前的系统并发量。The system concurrency corresponding to the key information is added to the number of service requests to obtain the current system concurrency of the key information of the distributed system. 10.根据权利要求9所述的方法,其特征在于,根据所述系统并发量对所述分布式系统进行流量控制,包括:10. The method according to claim 9, wherein the flow control of the distributed system according to the system concurrency includes: 从Redis缓存中获取所述关键信息对应的第三设定阈值;Obtaining the third set threshold corresponding to the key information from the Redis cache; 若所述系统并发量小于所述第三设定阈值,则处理所述业务请求;If the system concurrency is less than the third set threshold, process the service request; 若所述系统并发量大于或等于所述第三设定阈值,则拒绝所述业务请求。If the system concurrency is greater than or equal to the third set threshold, reject the service request. 11.根据权利要求10所述的方法,其特征在于,在拒绝所述业务请求之后,还包括:11. The method according to claim 10, further comprising: after rejecting the service request: 根据所述业务请求的数量更新所述关键信息对应的系统并发量。The system concurrency corresponding to the key information is updated according to the number of service requests. 12.一种分布式系统的流量控制装置,其特征在于,包括:12. A flow control device for a distributed system, comprising: 业务请求分配模块,用于将接收的业务请求分配至所述分布式系统中的目标服务器;A service request allocation module, configured to allocate received service requests to target servers in the distributed system; 服务器并发量确定模块,用于根据所述业务请求确定所述目标服务器当前的服务器并发量和/或业务类别并发量;其中,所述服务器并发量为所述目标服务器的总业务请求并发量,所述业务类别并发量为属于所述业务请求对应的业务类别的总业务请求并发量;The server concurrency determination module is configured to determine the current server concurrency and/or service category concurrency of the target server according to the service request; wherein the server concurrency is the total service request concurrency of the target server, The concurrent volume of the business category is the total concurrent volume of business requests belonging to the business category corresponding to the business request; 服务器流量控制模块,用于根据所述服务器并发量和/或业务类别并发量对所述目标服务器进行流量控制;A server flow control module, configured to control the flow of the target server according to the concurrent amount of the server and/or the concurrent amount of the business category; 系统并发量确定模块,用于若所述目标服务器接受所述业务请求,则根据所述业务请求确定所述分布式系统当前的系统并发量;A system concurrency determining module, configured to determine the current system concurrency of the distributed system according to the service request if the target server accepts the service request; 系统流量控制模块,用于根据所述系统并发量对所述分布式系统进行流量控制。A system flow control module, configured to control the flow of the distributed system according to the system concurrency. 13.一种电子设备,其特征在于,包括存储器,处理器及存储在存储器上并可在处理器运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1-11中任一项所述的分布式系统的流量控制方法。13. An electronic device, characterized in that it includes a memory, a processor, and a computer program stored on the memory and that can be run on the processor, wherein the computer program according to claim 1 is implemented when the processor executes the computer program. - The flow control method of the distributed system described in any one of 11. 14.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1-11中任一所述的分布式系统的流量控制方法。14. A computer-readable storage medium, on which a computer program is stored, wherein when the program is executed by a processor, the flow control method for a distributed system according to any one of claims 1-11 is implemented. 15.一种计算机程序产品,包括计算机程序,其特征在于,所述计算机程序在被处理器执行时实现如权利要求1-11中任一项所述的分布式系统的流量控制方法。15. A computer program product, comprising a computer program, characterized in that, when the computer program is executed by a processor, the flow control method for a distributed system according to any one of claims 1-11 is implemented.
CN202310215040.7A 2023-02-28 2023-02-28 Distributed system flow control method, device, equipment, medium and product Pending CN116319810A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310215040.7A CN116319810A (en) 2023-02-28 2023-02-28 Distributed system flow control method, device, equipment, medium and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310215040.7A CN116319810A (en) 2023-02-28 2023-02-28 Distributed system flow control method, device, equipment, medium and product

Publications (1)

Publication Number Publication Date
CN116319810A true CN116319810A (en) 2023-06-23

Family

ID=86814457

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310215040.7A Pending CN116319810A (en) 2023-02-28 2023-02-28 Distributed system flow control method, device, equipment, medium and product

Country Status (1)

Country Link
CN (1) CN116319810A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116668372A (en) * 2023-08-01 2023-08-29 腾讯科技(深圳)有限公司 Flow control method and related device
CN118827550A (en) * 2024-06-25 2024-10-22 中国建设银行股份有限公司 Flow control method, device, server, storage medium and program product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104090823A (en) * 2014-06-09 2014-10-08 中国建设银行股份有限公司 Flow control method and device for computer system
CN109660400A (en) * 2018-12-24 2019-04-19 苏州思必驰信息科技有限公司 Flow control configuration method and system
CN112307338A (en) * 2020-10-30 2021-02-02 中国民航信息网络股份有限公司 Flow control method, device, device and storage medium of freight rate search system
CN112437018A (en) * 2020-11-19 2021-03-02 百度在线网络技术(北京)有限公司 Flow control method, device, equipment and storage medium for distributed cluster
CN114928572A (en) * 2022-02-28 2022-08-19 中国农业银行股份有限公司 Flow control method, device, medium and equipment of distributed system
CA3184580A1 (en) * 2021-12-24 2023-06-24 10353744 Canada Ltd. Interface dynamic flow control method and device, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104090823A (en) * 2014-06-09 2014-10-08 中国建设银行股份有限公司 Flow control method and device for computer system
CN109660400A (en) * 2018-12-24 2019-04-19 苏州思必驰信息科技有限公司 Flow control configuration method and system
CN112307338A (en) * 2020-10-30 2021-02-02 中国民航信息网络股份有限公司 Flow control method, device, device and storage medium of freight rate search system
CN112437018A (en) * 2020-11-19 2021-03-02 百度在线网络技术(北京)有限公司 Flow control method, device, equipment and storage medium for distributed cluster
CA3184580A1 (en) * 2021-12-24 2023-06-24 10353744 Canada Ltd. Interface dynamic flow control method and device, computer equipment and storage medium
CN114928572A (en) * 2022-02-28 2022-08-19 中国农业银行股份有限公司 Flow control method, device, medium and equipment of distributed system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116668372A (en) * 2023-08-01 2023-08-29 腾讯科技(深圳)有限公司 Flow control method and related device
CN116668372B (en) * 2023-08-01 2023-11-03 腾讯科技(深圳)有限公司 Flow control method and related device
CN118827550A (en) * 2024-06-25 2024-10-22 中国建设银行股份有限公司 Flow control method, device, server, storage medium and program product
CN118827550B (en) * 2024-06-25 2025-11-14 中国建设银行股份有限公司 Flow control methods, devices, servers, storage media, and software products

Similar Documents

Publication Publication Date Title
CN113256355B (en) Method, device, medium, equipment and system for determining integral rights and interests in real time
CN114172966B (en) Service calling method, service processing method and device under unitized architecture
CN111949402A (en) Database request processing method and device, computer equipment and storage medium
CN111127181B (en) Voucher accounting method and device
CN113590437B (en) Alarm information processing method, device, equipment and medium
CN110795446A (en) List updating method and device, readable medium and electronic equipment
CN116319810A (en) Distributed system flow control method, device, equipment, medium and product
CN112686528B (en) Method, device, server and medium for distributing customer service resources
CN110727507A (en) Message processing method and device, computer equipment and storage medium
CN111538572A (en) Task processing method, device, scheduling server and medium
CN108337301A (en) Network request processing method, device, server and the storage medium of application program
CN114760233B (en) Service processing method, device, electronic equipment and storage medium
CN116192752A (en) Service flow control method, device, electronic equipment and storage medium
US8903871B2 (en) Dynamic management of log persistence
CN112035460A (en) An identification distribution method, apparatus, device and storage medium
US20190281134A1 (en) Sandboxing requests for web services
CN108924128A (en) A kind of mobile terminal and its method for limiting, the storage medium of interprocess communication
CN113760178A (en) Cache data processing method and device, electronic equipment and computer readable medium
CN111104528B (en) Picture acquisition method and device and client
CN117972096A (en) A method and system for processing interactive messages on a social platform
CN118250206A (en) High concurrency pressure testing method and related device based on flow playback
CN116382899A (en) A system resource allocation method and device
CN115426414A (en) A method and system for monitoring and counting indicators of server interface calls
CN112785323B (en) Resource allocation method, device and electronic equipment
CN111258775A (en) Message processing method, device, equipment and storage medium

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