CN114124968B - Load balancing method, device, equipment and medium based on market data - Google Patents
Load balancing method, device, equipment and medium based on market data Download PDFInfo
- Publication number
- CN114124968B CN114124968B CN202210097246.XA CN202210097246A CN114124968B CN 114124968 B CN114124968 B CN 114124968B CN 202210097246 A CN202210097246 A CN 202210097246A CN 114124968 B CN114124968 B CN 114124968B
- Authority
- CN
- China
- Prior art keywords
- server
- bandwidth
- client
- target
- occupied
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 41
- 230000001960 triggered effect Effects 0.000 claims description 10
- 230000004044 response Effects 0.000 claims description 7
- 230000001174 ascending effect Effects 0.000 claims description 4
- 238000004364 calculation method Methods 0.000 claims description 4
- 238000013468 resource allocation Methods 0.000 abstract 1
- 238000004590 computer program Methods 0.000 description 12
- 238000005516 engineering process Methods 0.000 description 12
- 230000006870 function Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 5
- 238000007726 management method Methods 0.000 description 5
- 238000013473 artificial intelligence Methods 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 3
- 238000003491 array Methods 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 235000019800 disodium phosphate Nutrition 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003058 natural language processing Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
Description
技术领域technical field
本发明涉及互联网技术领域,尤其涉及一种基于行情数据的负载均衡方法、装置、设备及介质。The present invention relates to the field of Internet technologies, and in particular, to a method, device, device and medium for load balancing based on market data.
背景技术Background technique
在金融行情领域内,通常采用TCP(Transmission Control Protocol,传输控制协议)长连接的方式下发互联网客户端订阅的行情,为了保证服务端与客户端之间的数据传输更加高效、准确,互联网行情订阅推送业务需要通过负载均衡技术保证资源利用最大化。In the field of financial quotations, TCP (Transmission Control Protocol, Transmission Control Protocol) long connection is usually used to issue quotations subscribed by Internet clients. In order to ensure more efficient and accurate data transmission between the server and the client, the Internet quotation The subscription push business needs to use load balancing technology to ensure maximum resource utilization.
在金融行情领域内,由于不同客户端订阅行情数目是动态变化的,且幅度较大,因此占用资源的变化也较大,而现有技术中,通用的负载均衡策略或者只基于一个维度,或者无法适用于动态行情订阅的场景,导致负载均衡效果欠佳。In the field of financial quotations, since the number of quotations subscribed by different clients is dynamically changed, and the magnitude is large, the changes in the occupied resources are also large. In the prior art, the general load balancing strategy is either based on only one dimension, or It cannot be applied to the scenario of dynamic market subscription, resulting in poor load balancing effect.
发明内容SUMMARY OF THE INVENTION
鉴于以上内容,有必要提供一种基于行情数据的负载均衡方法、装置、设备及介质,旨在解决针对行情数据的负载均衡问题。In view of the above content, it is necessary to provide a load balancing method, device, device and medium based on market data, aiming at solving the problem of load balancing for market data.
一种基于行情数据的负载均衡方法,所述基于行情数据的负载均衡方法包括:A load balancing method based on market data, the load balancing method based on market data comprising:
响应于目标客户端触发的接入请求,计算所述目标客户端的预请求带宽;In response to the access request triggered by the target client, calculating the pre-requested bandwidth of the target client;
采集服务端集群中每个服务端的资源信息,并根据每个服务端的资源信息确定每个服务端的当前预占用带宽;Collect resource information of each server in the server cluster, and determine the current pre-occupied bandwidth of each server according to the resource information of each server;
分别计算每个服务端的当前预占用带宽与所述目标客户端的预请求带宽的和,得到每个服务端的目标预占用带宽;Calculate the sum of the current pre-occupied bandwidth of each server and the pre-requested bandwidth of the target client respectively, and obtain the target pre-occupied bandwidth of each server;
获取预先配置的带宽阈值,从每个服务端中获取所述目标预占用带宽小于所述带宽阈值的服务端作为候选服务端;Obtaining a preconfigured bandwidth threshold, and obtaining a server whose target pre-occupied bandwidth is less than the bandwidth threshold from each server as a candidate server;
获取所述目标客户端对应的客户类型,根据所述客户类型从所述候选服务端中选择目标服务端;Obtain the client type corresponding to the target client, and select a target server from the candidate servers according to the client type;
将所述目标客户端接入所述目标服务端。Connect the target client to the target server.
根据本发明优选实施例,所述计算所述目标客户端的预请求带宽包括:According to a preferred embodiment of the present invention, the calculating the pre-requested bandwidth of the target client includes:
获取所述目标客户端订阅的每只快照行情代码占用带宽、订阅的快照行情代码的数目、订阅的每只逐笔委托行情代码占用带宽、订阅的逐笔委托行情代码的数目、订阅的每只逐笔成交行情代码占用带宽、订阅的逐笔成交行情代码的数目,及获取所述目标客户端的流控值;Obtain the bandwidth occupied by each snapshot quotation code subscribed by the target client, the number of subscribed snapshot quotation codes, the bandwidth occupied by each entrusted quotation code of each subscription, the number of subscribed entrusted quotation codes, each subscribed quotation code The bandwidth occupied by the tick-by-ticket quotation codes, the number of subscribed tick-by-tick quotation codes, and the flow control value obtained from the target client;
计算每只快照行情代码占用带宽与所述快照行情代码的数目的乘积,得到第一数值;Calculate the product of the bandwidth occupied by each snapshot quotation code and the number of the snapshot quotation code to obtain the first value;
计算每只逐笔委托行情代码占用带宽与所述逐笔委托行情代码的数目的乘积,得到第二数值;Calculate the product of the bandwidth occupied by each entrusted quotation code and the number of the entrusted quotation codes to obtain the second value;
计算每只逐笔成交行情代码占用带宽与所述逐笔成交行情代码的数目的乘积,得到第三数值;Calculate the product of the bandwidth occupied by each tick-by-tick quotation code and the number of the tick-by-tick quotation codes to obtain a third value;
计算所述第一数值、所述第二数值与所述第三数值的和,得到所述目标客户端的预使用带宽;calculating the sum of the first numerical value, the second numerical value and the third numerical value to obtain the pre-used bandwidth of the target client;
比较所述流控值与所述预使用带宽的大小,并将较小的值确定为所述预请求带宽。The flow control value is compared with the size of the pre-used bandwidth, and the smaller value is determined as the pre-requested bandwidth.
根据本发明优选实施例,所述根据每个服务端的资源信息确定每个服务端的当前预占用带宽包括:According to a preferred embodiment of the present invention, the determining of the current pre-occupied bandwidth of each server according to the resource information of each server includes:
根据每个服务端的资源信息确定当前连接于每个服务端的客户端;Determine the client currently connected to each server according to the resource information of each server;
获取每个客户端的预请求带宽;Get the pre-requested bandwidth for each client;
计算当前连接于每个服务端的客户端的预请求带宽的和,得到每个服务端的当前预占用带宽。Calculate the sum of the pre-requested bandwidths of the clients currently connected to each server to obtain the current pre-occupied bandwidth of each server.
根据本发明优选实施例,所述根据所述客户类型从所述候选服务端中选择目标服务端包括:According to a preferred embodiment of the present invention, the selecting a target server from the candidate servers according to the client type includes:
当所述客户类型为第一类型时,按照由小到大的顺序,根据每个候选服务端的目标预占用带宽对每个候选服务端进行排序,得到目标序列;When the client type is the first type, in order from small to large, sort each candidate server according to the target pre-occupied bandwidth of each candidate server to obtain a target sequence;
从所述目标序列中提取排在首位的候选服务端作为所述目标服务端。The first candidate server is extracted from the target sequence as the target server.
根据本发明优选实施例,所述根据所述客户类型从所述候选服务端中选择目标服务端还包括:According to a preferred embodiment of the present invention, the selecting a target server from the candidate servers according to the client type further includes:
当所述客户类型为第二类型时,获取当前连接于每个候选服务端的客户端;When the client type is the second type, obtain the client currently connected to each candidate server;
确定所述当前连接于每个候选服务端的客户端的客户类型;determining the client type of the client currently connected to each candidate server;
获取所述当前连接于每个候选服务端的客户端的客户类型为所述第二类型的客户端,并作为每个候选服务端对应的第一客户端;Obtaining the client type of the client currently connected to each candidate server is the client of the second type, and as the first client corresponding to each candidate server;
分别计算每个候选服务端对应的第一客户端的数量,得到每个候选服务端对应的第一数量;Calculate the number of first clients corresponding to each candidate server respectively, and obtain the first number corresponding to each candidate server;
按照所述第一数量由小到大的顺序对每个候选服务端进行排序;Sort each candidate server according to the first quantity in ascending order;
获取排在首位的候选服务端作为所述目标服务端。The first candidate server is obtained as the target server.
根据本发明优选实施例,所述方法还包括:According to a preferred embodiment of the present invention, the method further includes:
当所述客户类型为所述第二类型,且从每个服务端中没有获取到所述目标预占用带宽小于所述带宽阈值的服务端作为所述候选服务端时,确定当前连接于每个服务端的客户端的客户类型;When the client type is the second type, and no server with the target pre-occupied bandwidth less than the bandwidth threshold is obtained from each server as the candidate server, it is determined that the client is currently connected to each server. The client type of the client on the server side;
获取所述当前连接于每个服务端的客户端的客户类型为所述第一类型的客户端,并作为每个服务端对应的第二客户端;Obtaining the client type of the client currently connected to each server is the client of the first type, and as the second client corresponding to each server;
获取每个服务端对应的第二客户端的占用带宽;Obtain the occupied bandwidth of the second client corresponding to each server;
分别计算每个服务端对应的第二客户端的占用带宽的和,并作为每个服务端的可释放带宽;Calculate the sum of the occupied bandwidth of the second client corresponding to each server respectively, and use it as the releasable bandwidth of each server;
从每个服务端中选择所述可释放带宽大于或者等于所述目标客户端的预请求带宽的服务端,并作为至少一个备选服务端;Select a server whose releasable bandwidth is greater than or equal to the pre-requested bandwidth of the target client from each server as at least one candidate server;
获取所述至少一个备选服务端中每个备选服务端的当前预占用带宽;Obtain the currently pre-occupied bandwidth of each alternative server in the at least one alternative server;
按照每个备选服务端的当前预占用带宽由大到小的顺序对每个备选服务端进行排序;Sort each candidate server according to the current pre-occupied bandwidth of each candidate server in descending order;
获取排在首位的备选服务端作为待处理服务端;Get the top-ranked alternative server as the pending server;
控制所述待处理服务端断开与预设数量的所述第二客户端的连接,并将所述目标客户端接入所述待处理服务端;Controlling the to-be-processed server to disconnect from a preset number of the second clients, and to connect the target client to the to-be-processed server;
其中,所述预设数量为使断开连接的所述第二客户端的占用带宽的和大于或者等于所述目标客户端的预请求带宽时,所述断开连接的所述第二客户端的数量的最小值。The preset number is the number of disconnected second clients when the sum of the occupied bandwidth of the disconnected second clients is greater than or equal to the pre-requested bandwidth of the target client. minimum value.
根据本发明优选实施例,所述方法还包括:According to a preferred embodiment of the present invention, the method further includes:
当没有从每个服务端中选择出所述可释放带宽大于或者等于所述目标客户端的预请求带宽的服务端时,发出用于提示所述服务端集群满载的告警信息,及发出对所述服务端集群的扩容请求。When a server whose releasable bandwidth is greater than or equal to the pre-requested bandwidth of the target client is not selected from each server, an alarm message for prompting the server cluster to be fully loaded is sent, and an alarm message is sent to the A request for expansion of the server cluster.
一种基于行情数据的负载均衡装置,所述基于行情数据的负载均衡装置包括:A load balancing device based on market data, the load balancing device based on market data comprising:
计算单元,用于响应于目标客户端触发的接入请求,计算所述目标客户端的预请求带宽;a computing unit, configured to calculate the pre-requested bandwidth of the target client in response to the access request triggered by the target client;
确定单元,用于采集服务端集群中每个服务端的资源信息,并根据每个服务端的资源信息确定每个服务端的当前预占用带宽;a determining unit, configured to collect resource information of each server in the server cluster, and determine the current pre-occupied bandwidth of each server according to the resource information of each server;
所述计算单元,还用于分别计算每个服务端的当前预占用带宽与所述目标客户端的预请求带宽的和,得到每个服务端的目标预占用带宽;The computing unit is further configured to calculate the sum of the current pre-occupied bandwidth of each server and the pre-requested bandwidth of the target client, and obtain the target pre-occupied bandwidth of each server;
获取单元,用于获取预先配置的带宽阈值,从每个服务端中获取所述目标预占用带宽小于所述带宽阈值的服务端作为候选服务端;an acquiring unit, configured to acquire a preconfigured bandwidth threshold, and acquire a server whose target pre-occupied bandwidth is less than the bandwidth threshold from each server as a candidate server;
选择单元,用于获取所述目标客户端对应的客户类型,根据所述客户类型从所述候选服务端中选择目标服务端;a selection unit, configured to obtain a client type corresponding to the target client, and select a target server from the candidate servers according to the client type;
接入单元,用于将所述目标客户端接入所述目标服务端。An access unit, configured to access the target client to the target server.
一种计算机设备,所述计算机设备包括:A computer device comprising:
存储器,存储至少一个指令;及a memory that stores at least one instruction; and
处理器,执行所述存储器中存储的指令以实现所述基于行情数据的负载均衡方法。The processor executes the instructions stored in the memory to implement the market data-based load balancing method.
一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一个指令,所述至少一个指令被计算机设备中的处理器执行以实现所述基于行情数据的负载均衡方法。A computer-readable storage medium, where at least one instruction is stored, the at least one instruction is executed by a processor in a computer device to implement the market data-based load balancing method.
由以上技术方案可以看出,本发明能够响应于目标客户端触发的接入请求,计算所述目标客户端的预请求带宽,采集服务端集群中每个服务端的资源信息,并根据每个服务端的资源信息确定每个服务端的当前预占用带宽,分别计算每个服务端的当前预占用带宽与所述目标客户端的预请求带宽的和,得到每个服务端的目标预占用带宽,获取预先配置的带宽阈值,从每个服务端中获取所述目标预占用带宽小于所述带宽阈值的服务端作为候选服务端,获取所述目标客户端对应的客户类型,根据所述客户类型从所述候选服务端中选择目标服务端,将所述目标客户端接入所述目标服务端,进而从服务端、客户端及客户多个维度实现基于行情数据的负载均衡,提高了服务端集群的服务性能,并优化了资源配置,保证了服务端集群的健壮性。It can be seen from the above technical solutions that the present invention can respond to the access request triggered by the target client, calculate the pre-request bandwidth of the target client, collect the resource information of each server in the server cluster, and calculate the bandwidth of each server according to the information of each server. The resource information determines the current pre-occupied bandwidth of each server, respectively calculates the sum of the current pre-occupied bandwidth of each server and the pre-requested bandwidth of the target client, obtains the target pre-occupied bandwidth of each server, and obtains the pre-configured bandwidth threshold. , obtain a server whose target pre-occupied bandwidth is less than the bandwidth threshold from each server as a candidate server, obtain the client type corresponding to the target client, and select a server from the candidate server according to the client type Select the target server, connect the target client to the target server, and then realize load balancing based on market data from multiple dimensions of the server, the client and the client, improve the service performance of the server cluster, and optimize The resource configuration is guaranteed to ensure the robustness of the server cluster.
附图说明Description of drawings
图1是本发明基于行情数据的负载均衡方法的较佳实施例的流程图。FIG. 1 is a flow chart of a preferred embodiment of a load balancing method based on market data of the present invention.
图2是本发明基于行情数据的负载均衡装置的较佳实施例的功能模块图。FIG. 2 is a functional block diagram of a preferred embodiment of the market data-based load balancing device of the present invention.
图3是本发明实现基于行情数据的负载均衡方法的较佳实施例的计算机设备的结构示意图。FIG. 3 is a schematic structural diagram of a computer device according to a preferred embodiment of the present invention for implementing a load balancing method based on market data.
具体实施方式Detailed ways
为了使本发明的目的、技术方案和优点更加清楚,下面结合附图和具体实施例对本发明进行详细描述。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
如图1所示,是本发明基于行情数据的负载均衡方法的较佳实施例的流程图。根据不同的需求,该流程图中步骤的顺序可以改变,某些步骤可以省略。As shown in FIG. 1 , it is a flow chart of a preferred embodiment of the method for load balancing based on market data of the present invention. According to different requirements, the order of the steps in this flowchart can be changed, and some steps can be omitted.
所述基于行情数据的负载均衡方法应用于一个或者多个计算机设备中,所述计算机设备是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(Application Specific IntegratedCircuit,ASIC)、可编程门阵列(Field-Programmable Gate Array,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。The load balancing method based on market data is applied to one or more computer devices, and the computer device is a device that can automatically perform numerical calculation and/or information processing according to pre-set or stored instructions. Including but not limited to microprocessors, application specific integrated circuits (ASICs), programmable gate arrays (Field-Programmable Gate Arrays, FPGAs), digital processors (Digital Signal Processors, DSPs), embedded devices, and the like.
所述计算机设备可以是任何一种可与用户进行人机交互的电子产品,例如,个人计算机、平板电脑、智能手机、个人数字助理(Personal Digital Assistant,PDA)、游戏机、交互式网络电视(Internet Protocol Television,IPTV)、智能式穿戴式设备等。The computer device can be any electronic product that can interact with the user, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network TV ( Internet Protocol Television, IPTV), smart wearable devices, etc.
所述计算机设备还可以包括网络设备和/或用户设备。其中,所述网络设备包括,但不限于单个网络服务器、多个网络服务器组成的服务器组或基于云计算(CloudComputing)的由大量主机或网络服务器构成的云。The computer equipment may also include network equipment and/or user equipment. Wherein, the network device includes, but is not limited to, a single network server, a server group formed by multiple network servers, or a cloud formed by a large number of hosts or network servers based on cloud computing (Cloud Computing).
所述服务器可以是独立的服务器,也可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(ContentDelivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。The server can be an independent server, or can provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery network (Content Delivery Network) , CDN), and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms.
其中,人工智能(Artificial Intelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。Among them, artificial intelligence (AI) is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. .
人工智能基础技术一般包括如传感器、专用人工智能芯片、云计算、分布式存储、大数据处理技术、操作/交互系统、机电一体化等技术。人工智能软件技术主要包括计算机视觉技术、机器人技术、生物识别技术、语音处理技术、自然语言处理技术以及机器学习/深度学习等几大方向。The basic technologies of artificial intelligence generally include technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation/interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning/deep learning.
所述计算机设备所处的网络包括但不限于互联网、广域网、城域网、局域网、虚拟专用网络(Virtual Private Network,VPN)等。The network where the computer equipment is located includes, but is not limited to, the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (Virtual Private Network, VPN), and the like.
S10,响应于目标客户端触发的接入请求,计算所述目标客户端的预请求带宽。S10, in response to the access request triggered by the target client, calculate the pre-requested bandwidth of the target client.
在本发明的至少一个实施例中,所述目标客户端可以为任意用户的客户端,所述目标客户端请求接入服务端,以实现对金融行情数据的订阅。In at least one embodiment of the present invention, the target client may be a client of any user, and the target client requests to access the server so as to subscribe to financial market data.
在本发明的至少一个实施例中,所述计算所述目标客户端的预请求带宽包括:In at least one embodiment of the present invention, the calculating the pre-requested bandwidth of the target client includes:
获取所述目标客户端订阅的每只快照行情代码占用带宽、订阅的快照行情代码的数目、订阅的每只逐笔委托行情代码占用带宽、订阅的逐笔委托行情代码的数目、订阅的每只逐笔成交行情代码占用带宽、订阅的逐笔成交行情代码的数目,及获取所述目标客户端的流控值;Obtain the bandwidth occupied by each snapshot quotation code subscribed by the target client, the number of subscribed snapshot quotation codes, the bandwidth occupied by each entrusted quotation code of each subscription, the number of subscribed entrusted quotation codes, each subscribed quotation code The bandwidth occupied by the tick-by-ticket quotation codes, the number of subscribed tick-by-tick quotation codes, and the flow control value obtained from the target client;
计算每只快照行情代码占用带宽与所述快照行情代码的数目的乘积,得到第一数值;Calculate the product of the bandwidth occupied by each snapshot quotation code and the number of the snapshot quotation code to obtain the first value;
计算每只逐笔委托行情代码占用带宽与所述逐笔委托行情代码的数目的乘积,得到第二数值;Calculate the product of the bandwidth occupied by each entrusted quotation code and the number of the entrusted quotation codes to obtain the second value;
计算每只逐笔成交行情代码占用带宽与所述逐笔成交行情代码的数目的乘积,得到第三数值;Calculate the product of the bandwidth occupied by each tick-by-tick quotation code and the number of the tick-by-tick quotation codes to obtain a third value;
计算所述第一数值、所述第二数值与所述第三数值的和,得到所述目标客户端的预使用带宽;calculating the sum of the first numerical value, the second numerical value and the third numerical value to obtain the pre-used bandwidth of the target client;
比较所述流控值与所述预使用带宽的大小,并将较小的值确定为所述预请求带宽。The flow control value is compared with the size of the pre-used bandwidth, and the smaller value is determined as the pre-requested bandwidth.
其中,每只快照行情代码占用带宽、每只逐笔委托行情代码占用带宽、每只逐笔成交行情代码占用带宽可以根据实际情况进行测试评估,本发明不限制。Wherein, the bandwidth occupied by each snapshot quotation code, the bandwidth occupied by each transaction-by-transaction quotation code, and the bandwidth occupied by each transaction-by-transaction quotation code can be tested and evaluated according to the actual situation, which is not limited in the present invention.
其中,所述目标客户端的流控值可以根据所述目标客户端对应的账号进行配置。The flow control value of the target client may be configured according to the account corresponding to the target client.
通过上述实施方式,能够基于多个维度确定所述目标客户端的预请求带宽,使确定的所述目标客户端的预请求带宽更加准确。Through the foregoing implementation manner, the pre-requested bandwidth of the target client can be determined based on multiple dimensions, so that the determined pre-requested bandwidth of the target client is more accurate.
S11,采集服务端集群中每个服务端的资源信息,并根据每个服务端的资源信息确定每个服务端的当前预占用带宽。S11: Collect resource information of each server in the server cluster, and determine the currently pre-occupied bandwidth of each server according to the resource information of each server.
在本实施例中,所述服务端集群中包括至少一个服务端,用于向连接的客户端提供行情数据。In this embodiment, the server cluster includes at least one server for providing market data to connected clients.
在本发明的至少一个实施例中,每个服务端的资源信息可以包括,但不限于以下一种或者多种信息的组合:In at least one embodiment of the present invention, the resource information of each server may include, but is not limited to, a combination of one or more of the following information:
当前连接于每个服务端的客户端、连接于每个服务端的客户订阅情况、客户订阅限制数量。The clients currently connected to each server, the subscription status of clients connected to each server, and the limit of client subscriptions.
在本发明的至少一个实施例中,所述根据每个服务端的资源信息确定每个服务端的当前预占用带宽包括:In at least one embodiment of the present invention, the determining the current pre-occupied bandwidth of each server according to the resource information of each server includes:
根据每个服务端的资源信息确定当前连接于每个服务端的客户端;Determine the client currently connected to each server according to the resource information of each server;
获取每个客户端的预请求带宽;Get the pre-requested bandwidth for each client;
计算当前连接于每个服务端的客户端的预请求带宽的和,得到每个服务端的当前预占用带宽。Calculate the sum of the pre-requested bandwidths of the clients currently connected to each server to obtain the current pre-occupied bandwidth of each server.
其中,计算每个客户端的预请求带宽的方式与计算所述目标客户端的预请求带宽的方式类似,在此不赘述。The manner of calculating the pre-requested bandwidth of each client is similar to the manner of calculating the pre-requested bandwidth of the target client, and details are not described herein.
S12,分别计算每个服务端的当前预占用带宽与所述目标客户端的预请求带宽的和,得到每个服务端的目标预占用带宽。S12: Calculate the sum of the current pre-occupied bandwidth of each server and the pre-requested bandwidth of the target client, respectively, to obtain the target pre-occupied bandwidth of each server.
在上述实施方式中,将每个服务端的预占用带宽与所述目标客户端的预请求带宽的和作为每个服务端的目标预占用带宽,后续以此作为比较基础,以保证接入所述目标客户端后,对应的服务端能够满足负荷。In the above embodiment, the sum of the pre-occupied bandwidth of each server and the pre-requested bandwidth of the target client is used as the target pre-occupied bandwidth of each server, and this is used as a comparison basis to ensure access to the target client. After the server is installed, the corresponding server can meet the load.
S13,获取预先配置的带宽阈值,从每个服务端中获取所述目标预占用带宽小于所述带宽阈值的服务端作为候选服务端。S13: Acquire a preconfigured bandwidth threshold, and acquire a server whose target pre-occupied bandwidth is less than the bandwidth threshold from each server as a candidate server.
在本实施例中,所述带宽阈值可以根据实际需求进行自定义配置,本发明不限制。In this embodiment, the bandwidth threshold may be custom configured according to actual requirements, which is not limited in the present invention.
通过上述实施方式,能够同时结合服务端的资源占用情况以及客户端的资源占用情况选择候选服务端。Through the above embodiment, the candidate server can be selected in combination with the resource occupancy of the server and the resource occupancy of the client at the same time.
S14,获取所述目标客户端对应的客户类型,根据所述客户类型从所述候选服务端中选择目标服务端。S14: Acquire a client type corresponding to the target client, and select a target server from the candidate servers according to the client type.
在本发明的至少一个实施例中,所述客户类型可以包括,但不限于:VIP客户、非VIP客户(高级客户、普通客户、免费客户)等。In at least one embodiment of the present invention, the customer types may include, but are not limited to: VIP customers, non-VIP customers (premium customers, ordinary customers, free customers), and the like.
在本发明的至少一个实施例中,所述根据所述客户类型从所述候选服务端中选择目标服务端包括:In at least one embodiment of the present invention, the selecting a target server from the candidate servers according to the client type includes:
当所述客户类型为第一类型时,按照由小到大的顺序,根据每个候选服务端的目标预占用带宽对每个候选服务端进行排序,得到目标序列;When the client type is the first type, in order from small to large, sort each candidate server according to the target pre-occupied bandwidth of each candidate server to obtain a target sequence;
从所述目标序列中提取排在首位的候选服务端作为所述目标服务端。The first candidate server is extracted from the target sequence as the target server.
其中,所述第一类型可以包括非VIP客户类型。Wherein, the first type may include a non-VIP client type.
在上述实施方式中,针对非重点客户,选择带宽占用低的服务端作为目标服务端进行服务。In the above embodiment, for non-key clients, a server with low bandwidth occupation is selected as a target server to serve.
在本发明的至少一个实施例中,所述根据所述客户类型从所述候选服务端中选择目标服务端还包括:In at least one embodiment of the present invention, the selecting a target server from the candidate servers according to the client type further includes:
当所述客户类型为第二类型时,获取当前连接于每个候选服务端的客户端;When the client type is the second type, obtain the client currently connected to each candidate server;
确定所述当前连接于每个候选服务端的客户端的客户类型;determining the client type of the client currently connected to each candidate server;
获取所述当前连接于每个候选服务端的客户端的客户类型为所述第二类型的客户端,并作为每个候选服务端对应的第一客户端;Obtaining the client type of the client currently connected to each candidate server is the client of the second type, and as the first client corresponding to each candidate server;
分别计算每个候选服务端对应的第一客户端的数量,得到每个候选服务端对应的第一数量;Calculate the number of first clients corresponding to each candidate server respectively, and obtain the first number corresponding to each candidate server;
按照所述第一数量由小到大的顺序对每个候选服务端进行排序;Sort each candidate server according to the first quantity in ascending order;
获取排在首位的候选服务端作为所述目标服务端。The first candidate server is obtained as the target server.
其中,所述第二类型可以包括VIP客户类型。Wherein, the second type may include a VIP client type.
在上述实施方式中,针对重点客户,选择连接的重点客户数量最少的服务端作为目标服务端,以便向重点客户提供更好的服务。In the above embodiment, for key customers, the server with the least number of connected key customers is selected as the target server, so as to provide better services to key customers.
通过上述实施方式,能够在服务端维度、客户端维度的基础上,进一步综合客户维度实现负载均衡,进而能够更加满足行情数据的属性。Through the above-mentioned embodiments, on the basis of the server-side dimension and the client-side dimension, the customer dimension can be further integrated to achieve load balancing, so that the attributes of the market data can be more satisfied.
S15,将所述目标客户端接入所述目标服务端。S15, connect the target client to the target server.
通过上述实施方式,结合服务端维度、客户端维度及客户维度实现针对行情数据下发服务的负载均衡,提高了服务质量及网络数据的处理能力,降低了客户端接收数据的时延,同时能够充分利用服务端集群的资源,提高整体服务性能。Through the above embodiments, the load balancing for market data delivery services is realized in combination with the server dimension, the client dimension and the customer dimension, which improves the service quality and the processing capability of network data, reduces the delay for the client to receive data, and at the same time can Make full use of the resources of the server cluster to improve the overall service performance.
在本发明的至少一个实施例中,所述方法还包括:In at least one embodiment of the present invention, the method further includes:
当所述客户类型为所述第二类型,且从每个服务端中没有获取到所述目标预占用带宽小于所述带宽阈值的服务端作为所述候选服务端时,确定当前连接于每个服务端的客户端的客户类型;When the client type is the second type, and no server with the target pre-occupied bandwidth less than the bandwidth threshold is obtained from each server as the candidate server, it is determined that the client is currently connected to each server. The client type of the client on the server side;
获取所述当前连接于每个服务端的客户端的客户类型为所述第一类型的客户端,并作为每个服务端对应的第二客户端;Obtaining the client type of the client currently connected to each server is the client of the first type, and as the second client corresponding to each server;
获取每个服务端对应的第二客户端的占用带宽;Obtain the occupied bandwidth of the second client corresponding to each server;
分别计算每个服务端对应的第二客户端的占用带宽的和,并作为每个服务端的可释放带宽;Calculate the sum of the occupied bandwidth of the second client corresponding to each server respectively, and use it as the releasable bandwidth of each server;
从每个服务端中选择所述可释放带宽大于或者等于所述目标客户端的预请求带宽的服务端,并作为至少一个备选服务端;Select a server whose releasable bandwidth is greater than or equal to the pre-requested bandwidth of the target client from each server as at least one candidate server;
获取所述至少一个备选服务端中每个备选服务端的当前预占用带宽;Obtain the currently pre-occupied bandwidth of each alternative server in the at least one alternative server;
按照每个备选服务端的当前预占用带宽由大到小的顺序对每个备选服务端进行排序;Sort each candidate server according to the current pre-occupied bandwidth of each candidate server in descending order;
获取排在首位的备选服务端作为待处理服务端;Get the top-ranked alternative server as the pending server;
控制所述待处理服务端断开与预设数量的所述第二客户端的连接,并将所述目标客户端接入所述待处理服务端;Controlling the to-be-processed server to disconnect from a preset number of the second clients, and to connect the target client to the to-be-processed server;
其中,所述预设数量为使断开连接的所述第二客户端的占用带宽的和大于或者等于所述目标客户端的预请求带宽时,所述断开连接的所述第二客户端的数量的最小值。The preset number is the number of disconnected second clients when the sum of the occupied bandwidth of the disconnected second clients is greater than or equal to the pre-requested bandwidth of the target client. minimum value.
具体地,在控制所述待处理服务端断开与所述预设数量的所述第二客户端的连接时,可以从所述第二客户端中选择连接时间较久的客户端进行断开操作,也可以从所述第二客户端中选择资源占用较高的客户端进行断开操作,或者从所述第二客户端中任意选择客户端进行断开操作,使断开后释放的带宽刚好满足所述目标客户端的预请求带宽即可。Specifically, when controlling the to-be-processed server to disconnect from the preset number of the second clients, a client with a longer connection time may be selected from the second clients to perform the disconnection operation , you can also select the client with higher resource consumption from the second client to perform the disconnection operation, or arbitrarily select the client from the second client to perform the disconnection operation, so that the bandwidth released after disconnection is just right. It is sufficient to satisfy the pre-requested bandwidth of the target client.
通过上述实施方式,在资源有限的情况下,断开非重点客户的客户端,使重点客户能够优先且稳定的使用服务端资源,在保证服务可靠的前提下,实现灵活、差异化的负载均衡。Through the above implementation, in the case of limited resources, the clients of non-key customers are disconnected, so that key customers can use server resources preferentially and stably, and on the premise of ensuring service reliability, flexible and differentiated load balancing can be achieved .
在本发明的至少一个实施例中,所述方法还包括:In at least one embodiment of the present invention, the method further includes:
当没有从每个服务端中选择出所述可释放带宽大于或者等于所述目标客户端的预请求带宽的服务端时,发出用于提示所述服务端集群满载的告警信息,及发出对所述服务端集群的扩容请求。When a server whose releasable bandwidth is greater than or equal to the pre-requested bandwidth of the target client is not selected from each server, an alarm message for prompting the server cluster to be fully loaded is sent, and an alarm message is sent to the A request for expansion of the server cluster.
通过上述实施方式,能够在服务端集群中没有可用资源时发出满载警告,并请求扩容,以保证服务端集群能够及时恢复正常服务,避免影响客户的服务体验。Through the above implementation, a full load warning can be issued when there are no available resources in the server cluster, and capacity expansion can be requested, so as to ensure that the server cluster can resume normal services in time and avoid affecting customer service experience.
在本实施例中,当没有能够接入的目标服务端时,可以及时向所述目标客户端发送请求失败的通知,或者也可以同时向所述目标客户端发送重连的提示,以避免客户长时间等待。In this embodiment, when there is no target server that can be accessed, a notification of request failure may be sent to the target client in time, or a reconnection prompt may also be sent to the target client at the same time, so as to avoid client long wait.
由以上技术方案可以看出,本发明能够响应于目标客户端触发的接入请求,计算所述目标客户端的预请求带宽,采集服务端集群中每个服务端的资源信息,并根据每个服务端的资源信息确定每个服务端的当前预占用带宽,分别计算每个服务端的当前预占用带宽与所述目标客户端的预请求带宽的和,得到每个服务端的目标预占用带宽,获取预先配置的带宽阈值,从每个服务端中获取所述目标预占用带宽小于所述带宽阈值的服务端作为候选服务端,获取所述目标客户端对应的客户类型,根据所述客户类型从所述候选服务端中选择目标服务端,将所述目标客户端接入所述目标服务端,进而从服务端、客户端及客户多个维度实现基于行情数据的负载均衡,提高了服务端集群的服务性能,并优化了资源配置,保证了服务端集群的健壮性。It can be seen from the above technical solutions that the present invention can respond to the access request triggered by the target client, calculate the pre-request bandwidth of the target client, collect the resource information of each server in the server cluster, and calculate the bandwidth of each server according to the information of each server. The resource information determines the current pre-occupied bandwidth of each server, respectively calculates the sum of the current pre-occupied bandwidth of each server and the pre-requested bandwidth of the target client, obtains the target pre-occupied bandwidth of each server, and obtains the pre-configured bandwidth threshold. , obtain a server whose target pre-occupied bandwidth is less than the bandwidth threshold from each server as a candidate server, obtain the client type corresponding to the target client, and select a server from the candidate server according to the client type Select the target server, connect the target client to the target server, and then realize load balancing based on market data from multiple dimensions of the server, the client and the client, improve the service performance of the server cluster, and optimize The resource configuration is guaranteed to ensure the robustness of the server cluster.
如图2所示,是本发明基于行情数据的负载均衡装置的较佳实施例的功能模块图。所述基于行情数据的负载均衡装置11包括计算单元110、确定单元111、获取单元112、选择单元113、接入单元114。本发明所称的模块/单元是指一种能够被处理器13所执行,并且能够完成固定功能的一系列计算机程序段,其存储在存储器12中。在本实施例中,关于各模块/单元的功能将在后续的实施例中详述。As shown in FIG. 2 , it is a functional block diagram of a preferred embodiment of the market data-based load balancing device of the present invention. The market data-based load balancing device 11 includes a calculation unit 110 , a determination unit 111 , an acquisition unit 112 , a selection unit 113 , and an access unit 114 . The modules/units referred to in the present invention refer to a series of computer program segments that can be executed by the processor 13 and can perform fixed functions, and are stored in the memory 12 . In this embodiment, the functions of each module/unit will be described in detail in subsequent embodiments.
计算单元110响应于目标客户端触发的接入请求,计算所述目标客户端的预请求带宽。The calculating unit 110 calculates the pre-requested bandwidth of the target client in response to the access request triggered by the target client.
在本发明的至少一个实施例中,所述目标客户端可以为任意用户的客户端,所述目标客户端请求接入服务端,以实现对金融行情数据的订阅。In at least one embodiment of the present invention, the target client may be a client of any user, and the target client requests to access the server so as to subscribe to financial market data.
在本发明的至少一个实施例中,所述计算单元110计算所述目标客户端的预请求带宽包括:In at least one embodiment of the present invention, the calculating unit 110 calculating the pre-requested bandwidth of the target client includes:
获取所述目标客户端订阅的每只快照行情代码占用带宽、订阅的快照行情代码的数目、订阅的每只逐笔委托行情代码占用带宽、订阅的逐笔委托行情代码的数目、订阅的每只逐笔成交行情代码占用带宽、订阅的逐笔成交行情代码的数目,及获取所述目标客户端的流控值;Obtain the bandwidth occupied by each snapshot quotation code subscribed by the target client, the number of subscribed snapshot quotation codes, the bandwidth occupied by each entrusted quotation code of each subscription, the number of subscribed entrusted quotation codes, each subscribed quotation code The bandwidth occupied by the tick-by-ticket quotation codes, the number of subscribed tick-by-tick quotation codes, and the flow control value obtained from the target client;
计算每只快照行情代码占用带宽与所述快照行情代码的数目的乘积,得到第一数值;Calculate the product of the bandwidth occupied by each snapshot quotation code and the number of the snapshot quotation code to obtain the first value;
计算每只逐笔委托行情代码占用带宽与所述逐笔委托行情代码的数目的乘积,得到第二数值;Calculate the product of the bandwidth occupied by each entrusted quotation code and the number of the entrusted quotation codes to obtain the second value;
计算每只逐笔成交行情代码占用带宽与所述逐笔成交行情代码的数目的乘积,得到第三数值;Calculate the product of the bandwidth occupied by each tick-by-tick quotation code and the number of the tick-by-tick quotation codes to obtain a third value;
计算所述第一数值、所述第二数值与所述第三数值的和,得到所述目标客户端的预使用带宽;calculating the sum of the first numerical value, the second numerical value and the third numerical value to obtain the pre-used bandwidth of the target client;
比较所述流控值与所述预使用带宽的大小,并将较小的值确定为所述预请求带宽。The flow control value is compared with the size of the pre-used bandwidth, and the smaller value is determined as the pre-requested bandwidth.
其中,每只快照行情代码占用带宽、每只逐笔委托行情代码占用带宽、每只逐笔成交行情代码占用带宽可以根据实际情况进行测试评估,本发明不限制。Wherein, the bandwidth occupied by each snapshot quotation code, the bandwidth occupied by each transaction-by-transaction quotation code, and the bandwidth occupied by each transaction-by-transaction quotation code can be tested and evaluated according to the actual situation, which is not limited in the present invention.
其中,所述目标客户端的流控值可以根据所述目标客户端对应的账号进行配置。The flow control value of the target client may be configured according to the account corresponding to the target client.
通过上述实施方式,能够基于多个维度确定所述目标客户端的预请求带宽,使确定的所述目标客户端的预请求带宽更加准确。Through the foregoing implementation manner, the pre-requested bandwidth of the target client can be determined based on multiple dimensions, so that the determined pre-requested bandwidth of the target client is more accurate.
确定单元111采集服务端集群中每个服务端的资源信息,并根据每个服务端的资源信息确定每个服务端的当前预占用带宽。The determining unit 111 collects resource information of each server in the server cluster, and determines the currently pre-occupied bandwidth of each server according to the resource information of each server.
在本实施例中,所述服务端集群中包括至少一个服务端,用于向连接的客户端提供行情数据。In this embodiment, the server cluster includes at least one server for providing market data to connected clients.
在本发明的至少一个实施例中,每个服务端的资源信息可以包括,但不限于以下一种或者多种信息的组合:In at least one embodiment of the present invention, the resource information of each server may include, but is not limited to, a combination of one or more of the following information:
当前连接于每个服务端的客户端、连接于每个服务端的客户订阅情况、客户订阅限制数量。The clients currently connected to each server, the subscription status of clients connected to each server, and the limit of client subscriptions.
在本发明的至少一个实施例中,所述确定单元111根据每个服务端的资源信息确定每个服务端的当前预占用带宽包括:In at least one embodiment of the present invention, the determining unit 111 determining the currently pre-occupied bandwidth of each server according to the resource information of each server includes:
根据每个服务端的资源信息确定当前连接于每个服务端的客户端;Determine the client currently connected to each server according to the resource information of each server;
获取每个客户端的预请求带宽;Get the pre-requested bandwidth for each client;
计算当前连接于每个服务端的客户端的预请求带宽的和,得到每个服务端的当前预占用带宽。Calculate the sum of the pre-requested bandwidths of the clients currently connected to each server to obtain the current pre-occupied bandwidth of each server.
其中,计算每个客户端的预请求带宽的方式与计算所述目标客户端的预请求带宽的方式类似,在此不赘述。The manner of calculating the pre-requested bandwidth of each client is similar to the manner of calculating the pre-requested bandwidth of the target client, and details are not described herein.
所述计算单元110分别计算每个服务端的当前预占用带宽与所述目标客户端的预请求带宽的和,得到每个服务端的目标预占用带宽。The calculating unit 110 calculates the sum of the current pre-occupied bandwidth of each server and the pre-requested bandwidth of the target client, respectively, to obtain the target pre-occupied bandwidth of each server.
在上述实施方式中,将每个服务端的预占用带宽与所述目标客户端的预请求带宽的和作为每个服务端的目标预占用带宽,后续以此作为比较基础,以保证接入所述目标客户端后,对应的服务端能够满足负荷。In the above embodiment, the sum of the pre-occupied bandwidth of each server and the pre-requested bandwidth of the target client is used as the target pre-occupied bandwidth of each server, and this is used as a comparison basis to ensure access to the target client. After the server is installed, the corresponding server can meet the load.
获取单元112获取预先配置的带宽阈值,从每个服务端中获取所述目标预占用带宽小于所述带宽阈值的服务端作为候选服务端。The acquiring unit 112 acquires a preconfigured bandwidth threshold, and acquires a server whose target pre-occupied bandwidth is less than the bandwidth threshold from each server as a candidate server.
在本实施例中,所述带宽阈值可以根据实际需求进行自定义配置,本发明不限制。In this embodiment, the bandwidth threshold may be custom configured according to actual requirements, which is not limited in the present invention.
通过上述实施方式,能够同时结合服务端的资源占用情况以及客户端的资源占用情况选择候选服务端。Through the above embodiment, the candidate server can be selected in combination with the resource occupancy of the server and the resource occupancy of the client at the same time.
选择单元113获取所述目标客户端对应的客户类型,根据所述客户类型从所述候选服务端中选择目标服务端。The selecting unit 113 acquires a client type corresponding to the target client, and selects a target server from the candidate servers according to the client type.
在本发明的至少一个实施例中,所述客户类型可以包括,但不限于:VIP客户、非VIP客户(高级客户、普通客户、免费客户)等。In at least one embodiment of the present invention, the customer types may include, but are not limited to: VIP customers, non-VIP customers (premium customers, ordinary customers, free customers), and the like.
在本发明的至少一个实施例中,所述选择单元113根据所述客户类型从所述候选服务端中选择目标服务端包括:In at least one embodiment of the present invention, the selecting unit 113 selecting a target server from the candidate servers according to the client type includes:
当所述客户类型为第一类型时,按照由小到大的顺序,根据每个候选服务端的目标预占用带宽对每个候选服务端进行排序,得到目标序列;When the client type is the first type, in order from small to large, sort each candidate server according to the target pre-occupied bandwidth of each candidate server to obtain a target sequence;
从所述目标序列中提取排在首位的候选服务端作为所述目标服务端。The first candidate server is extracted from the target sequence as the target server.
其中,所述第一类型可以包括非VIP客户类型。Wherein, the first type may include a non-VIP client type.
在上述实施方式中,针对非重点客户,选择带宽占用低的服务端作为目标服务端进行服务。In the above embodiment, for non-key clients, a server with low bandwidth occupation is selected as a target server to serve.
在本发明的至少一个实施例中,所述选择单元113根据所述客户类型从所述候选服务端中选择目标服务端还包括:In at least one embodiment of the present invention, the selecting unit 113 selecting a target server from the candidate servers according to the client type further includes:
当所述客户类型为第二类型时,获取当前连接于每个候选服务端的客户端;When the client type is the second type, obtain the client currently connected to each candidate server;
确定所述当前连接于每个候选服务端的客户端的客户类型;determining the client type of the client currently connected to each candidate server;
获取所述当前连接于每个候选服务端的客户端的客户类型为所述第二类型的客户端,并作为每个候选服务端对应的第一客户端;Obtaining the client type of the client currently connected to each candidate server is the client of the second type, and as the first client corresponding to each candidate server;
分别计算每个候选服务端对应的第一客户端的数量,得到每个候选服务端对应的第一数量;Calculate the number of first clients corresponding to each candidate server respectively, and obtain the first number corresponding to each candidate server;
按照所述第一数量由小到大的顺序对每个候选服务端进行排序;Sort each candidate server according to the first quantity in ascending order;
获取排在首位的候选服务端作为所述目标服务端。The first candidate server is obtained as the target server.
其中,所述第二类型可以包括VIP客户类型。Wherein, the second type may include a VIP client type.
在上述实施方式中,针对重点客户,选择连接的重点客户数量最少的服务端作为目标服务端,以便向重点客户提供更好的服务。In the above embodiment, for key customers, the server with the least number of connected key customers is selected as the target server, so as to provide better services to key customers.
通过上述实施方式,能够在服务端维度、客户端维度的基础上,进一步综合客户维度实现负载均衡,进而能够更加满足行情数据的属性。Through the above-mentioned embodiments, on the basis of the server-side dimension and the client-side dimension, the customer dimension can be further integrated to achieve load balancing, so that the attributes of the market data can be more satisfied.
接入单元114将所述目标客户端接入所述目标服务端。The access unit 114 accesses the target client to the target server.
通过上述实施方式,结合服务端维度、客户端维度及客户维度实现针对行情数据下发服务的负载均衡,提高了服务质量及网络数据的处理能力,降低了客户端接收数据的时延,同时能够充分利用服务端集群的资源,提高整体服务性能。Through the above-mentioned embodiments, the load balancing for the market data delivery service is realized by combining the server dimension, the client dimension and the customer dimension, which improves the service quality and the processing capability of network data, reduces the time delay for the client to receive data, and at the same time can Make full use of the resources of the server cluster to improve the overall service performance.
在本发明的至少一个实施例中,当所述客户类型为所述第二类型,且从每个服务端中没有获取到所述目标预占用带宽小于所述带宽阈值的服务端作为所述候选服务端时,确定当前连接于每个服务端的客户端的客户类型;In at least one embodiment of the present invention, when the client type is the second type, and no server whose target pre-occupied bandwidth is less than the bandwidth threshold is obtained from each server as the candidate When the server is used, determine the client type of the client currently connected to each server;
获取所述当前连接于每个服务端的客户端的客户类型为所述第一类型的客户端,并作为每个服务端对应的第二客户端;Obtaining the client type of the client currently connected to each server is the client of the first type, and as the second client corresponding to each server;
获取每个服务端对应的第二客户端的占用带宽;Obtain the occupied bandwidth of the second client corresponding to each server;
分别计算每个服务端对应的第二客户端的占用带宽的和,并作为每个服务端的可释放带宽;Calculate the sum of the occupied bandwidth of the second client corresponding to each server respectively, and use it as the releasable bandwidth of each server;
从每个服务端中选择所述可释放带宽大于或者等于所述目标客户端的预请求带宽的服务端,并作为至少一个备选服务端;Select a server whose releasable bandwidth is greater than or equal to the pre-requested bandwidth of the target client from each server as at least one candidate server;
获取所述至少一个备选服务端中每个备选服务端的当前预占用带宽;Obtain the currently pre-occupied bandwidth of each alternative server in the at least one alternative server;
按照每个备选服务端的当前预占用带宽由大到小的顺序对每个备选服务端进行排序;Sort each candidate server according to the current pre-occupied bandwidth of each candidate server in descending order;
获取排在首位的备选服务端作为待处理服务端;Get the top-ranked alternative server as the pending server;
控制所述待处理服务端断开与预设数量的所述第二客户端的连接,并将所述目标客户端接入所述待处理服务端;Controlling the to-be-processed server to disconnect from a preset number of the second clients, and to connect the target client to the to-be-processed server;
其中,所述预设数量为使断开连接的所述第二客户端的占用带宽的和大于或者等于所述目标客户端的预请求带宽时,所述断开连接的所述第二客户端的数量的最小值。The preset number is the number of disconnected second clients when the sum of the occupied bandwidth of the disconnected second clients is greater than or equal to the pre-requested bandwidth of the target client. minimum value.
具体地,在控制所述待处理服务端断开与所述预设数量的所述第二客户端的连接时,可以从所述第二客户端中选择连接时间较久的客户端进行断开操作,也可以从所述第二客户端中选择资源占用较高的客户端进行断开操作,或者从所述第二客户端中任意选择客户端进行断开操作,使断开后释放的带宽刚好满足所述目标客户端的预请求带宽即可。Specifically, when controlling the to-be-processed server to disconnect from the preset number of the second clients, a client with a longer connection time may be selected from the second clients to perform the disconnection operation , you can also select the client with higher resource consumption from the second client to perform the disconnection operation, or arbitrarily select the client from the second client to perform the disconnection operation, so that the bandwidth released after disconnection is just right. It is sufficient to satisfy the pre-requested bandwidth of the target client.
通过上述实施方式,在资源有限的情况下,断开非重点客户的客户端,使重点客户能够优先且稳定的使用服务端资源,在保证服务可靠的前提下,实现灵活、差异化的负载均衡。Through the above implementation, in the case of limited resources, the clients of non-key customers are disconnected, so that key customers can use server resources preferentially and stably, and on the premise of ensuring service reliability, flexible and differentiated load balancing can be achieved .
在本发明的至少一个实施例中,当没有从每个服务端中选择出所述可释放带宽大于或者等于所述目标客户端的预请求带宽的服务端时,发出用于提示所述服务端集群满载的告警信息,及发出对所述服务端集群的扩容请求。In at least one embodiment of the present invention, when a server whose releasable bandwidth is greater than or equal to the pre-requested bandwidth of the target client is not selected from each server, a message is sent to prompt the server cluster full-load alarm information, and issue a capacity expansion request for the server cluster.
通过上述实施方式,能够在服务端集群中没有可用资源时发出满载警告,并请求扩容,以保证服务端集群能够及时恢复正常服务,避免影响客户的服务体验。Through the above implementation, a full load warning can be issued when there are no available resources in the server cluster, and capacity expansion can be requested, so as to ensure that the server cluster can resume normal services in time and avoid affecting customer service experience.
在本实施例中,当没有能够接入的目标服务端时,可以及时向所述目标客户端发送请求失败的通知,或者也可以同时向所述目标客户端发送重连的提示,以避免客户长时间等待。In this embodiment, when there is no target server that can be accessed, a notification of request failure may be sent to the target client in time, or a reconnection prompt may also be sent to the target client at the same time, so as to avoid client long wait.
由以上技术方案可以看出,本发明能够响应于目标客户端触发的接入请求,计算所述目标客户端的预请求带宽,采集服务端集群中每个服务端的资源信息,并根据每个服务端的资源信息确定每个服务端的当前预占用带宽,分别计算每个服务端的当前预占用带宽与所述目标客户端的预请求带宽的和,得到每个服务端的目标预占用带宽,获取预先配置的带宽阈值,从每个服务端中获取所述目标预占用带宽小于所述带宽阈值的服务端作为候选服务端,获取所述目标客户端对应的客户类型,根据所述客户类型从所述候选服务端中选择目标服务端,将所述目标客户端接入所述目标服务端,进而从服务端、客户端及客户多个维度实现基于行情数据的负载均衡,提高了服务端集群的服务性能,并优化了资源配置,保证了服务端集群的健壮性。It can be seen from the above technical solutions that the present invention can respond to the access request triggered by the target client, calculate the pre-request bandwidth of the target client, collect the resource information of each server in the server cluster, and calculate the bandwidth of each server according to the information of each server. The resource information determines the current pre-occupied bandwidth of each server, respectively calculates the sum of the current pre-occupied bandwidth of each server and the pre-requested bandwidth of the target client, obtains the target pre-occupied bandwidth of each server, and obtains the pre-configured bandwidth threshold. , obtain a server whose target pre-occupied bandwidth is less than the bandwidth threshold from each server as a candidate server, obtain the client type corresponding to the target client, and select a server from the candidate server according to the client type Select the target server, connect the target client to the target server, and then realize load balancing based on market data from multiple dimensions of the server, the client and the client, improve the service performance of the server cluster, and optimize The resource configuration is guaranteed to ensure the robustness of the server cluster.
如图3所示,是本发明实现基于行情数据的负载均衡方法的较佳实施例的计算机设备的结构示意图。As shown in FIG. 3 , it is a schematic structural diagram of a computer device according to a preferred embodiment of the present invention to implement the method for load balancing based on market data.
所述计算机设备1可以包括存储器12、处理器13和总线,还可以包括存储在所述存储器12中并可在所述处理器13上运行的计算机程序,例如基于行情数据的负载均衡程序。The computer device 1 may include a memory 12, a processor 13 and a bus, and may also include a computer program stored in the memory 12 and executable on the processor 13, such as a load balancing program based on market data.
本领域技术人员可以理解,所述示意图仅仅是计算机设备1的示例,并不构成对计算机设备1的限定,所述计算机设备1既可以是总线型结构,也可以是星形结构,所述计算机设备1还可以包括比图示更多或更少的其他硬件或者软件,或者不同的部件布置,例如所述计算机设备1还可以包括输入输出设备、网络接入设备等。Those skilled in the art can understand that the schematic diagram is only an example of the computer device 1, and does not constitute a limitation on the computer device 1. The computer device 1 can be either a bus-type structure or a star-shaped structure. The device 1 may also include more or less other hardware or software than shown, or a different arrangement of components, for example, the computer device 1 may also include input and output devices, network access devices, and the like.
需要说明的是,所述计算机设备1仅为举例,其他现有的或今后可能出现的电子产品如可适应于本发明,也应包含在本发明的保护范围以内,并以引用方式包含于此。It should be noted that the computer equipment 1 is only an example. If other existing or future electronic products can be adapted to the present invention, they should also be included within the protection scope of the present invention, and are incorporated herein by reference. .
其中,存储器12至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器12在一些实施例中可以是计算机设备1的内部存储单元,例如该计算机设备1的移动硬盘。存储器12在另一些实施例中也可以是计算机设备1的外部存储设备,例如计算机设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(SecureDigital,SD)卡、闪存卡(Flash Card)等。进一步地,存储器12还可以既包括计算机设备1的内部存储单元也包括外部存储设备。存储器12不仅可以用于存储安装于计算机设备1的应用软件及各类数据,例如基于行情数据的负载均衡程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。Wherein, the memory 12 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. . The memory 12 may be an internal storage unit of the computer device 1 in some embodiments, such as a removable hard disk of the computer device 1 . In other embodiments, the memory 12 may also be an external storage device of the computer device 1 , such as a pluggable mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) equipped on the computer device 1 . Cards, Flash Cards, etc. Further, the memory 12 may also include both an internal storage unit of the computer device 1 and an external storage device. The memory 12 can not only be used to store application software installed in the computer device 1 and various types of data, such as code of a load balancing program based on market data, etc., but also can be used to temporarily store data that has been output or will be output.
处理器13在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。处理器13是所述计算机设备1的控制核心(Control Unit),利用各种接口和线路连接整个计算机设备1的各个部件,通过运行或执行存储在所述存储器12内的程序或者模块(例如执行基于行情数据的负载均衡程序等),以及调用存储在所述存储器12内的数据,以执行计算机设备1的各种功能和处理数据。The processor 13 may be composed of integrated circuits in some embodiments, for example, may be composed of a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, including one or more central processing units. CPU (Central Processing Unit, CPU), microprocessor, digital processing chip, graphics processor and combination of various control chips, etc. The processor 13 is the control core (Control Unit) of the computer device 1, and uses various interfaces and lines to connect the various components of the entire computer device 1, and by running or executing the program or module stored in the memory 12 (for example, executing A load balancing program based on market data, etc.), and calling the data stored in the memory 12 to execute various functions of the computer device 1 and process data.
所述处理器13执行所述计算机设备1的操作系统以及安装的各类应用程序。所述处理器13执行所述应用程序以实现上述各个基于行情数据的负载均衡方法实施例中的步骤,例如图1所示的步骤。The processor 13 executes the operating system of the computer device 1 and various installed application programs. The processor 13 executes the application program to implement the steps in each of the foregoing embodiments of the load balancing method based on market data, for example, the steps shown in FIG. 1 .
示例性的,所述计算机程序可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器12中,并由所述处理器13执行,以完成本发明。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机可读指令段,该指令段用于描述所述计算机程序在所述计算机设备1中的执行过程。例如,所述计算机程序可以被分割成计算单元110、确定单元111、获取单元112、选择单元113、接入单元114。Exemplarily, the computer program may be divided into one or more modules/units, and the one or more modules/units are stored in the memory 12 and executed by the processor 13 to complete the present invention. invention. The one or more modules/units may be a series of computer-readable instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the computer device 1 . For example, the computer program may be divided into a calculation unit 110 , a determination unit 111 , an acquisition unit 112 , a selection unit 113 , and an access unit 114 .
上述以软件功能模块的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能模块存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、计算机设备,或者网络设备等)或处理器(processor)执行本发明各个实施例所述基于行情数据的负载均衡方法的部分。The above-mentioned integrated units implemented in the form of software functional modules may be stored in a computer-readable storage medium. The above-mentioned software function modules are stored in a storage medium, and include several instructions to enable a computer device (which may be a personal computer, a computer device, or a network device, etc.) or a processor (processor) to execute the based on the various embodiments of the present invention. Part of the load balancing method for market data.
所述计算机设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指示相关的硬件设备来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。If the modules/units integrated in the computer device 1 are implemented in the form of software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the processes in the methods of the above embodiments, and can also be completed by instructing relevant hardware devices through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above method embodiments can be implemented.
其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器等。Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form, and the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) , random access memory, etc.
进一步地,计算机可读存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。Further, the computer-readable storage medium may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required by at least one function, and the like; Use the created data, etc.
本发明所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in the present invention is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,在图3中仅用一根直线表示,但并不表示仅有一根总线或一种类型的总线。所述总线被设置为实现所述存储器12以及至少一个处理器13等之间的连接通信。The bus may be a peripheral component interconnect (PCI for short) bus or an extended industry standard architecture (extended industry standard architecture, EISA for short) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one straight line is shown in FIG. 3, but it does not mean that there is only one bus or one type of bus. The bus is arranged to enable connection communication between the memory 12 and at least one processor 13 and the like.
尽管未示出,所述计算机设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器13逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述计算机设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。Although not shown, the computer device 1 may also include a power supply (such as a battery) for supplying power to various components, preferably, the power supply may be logically connected to the at least one processor 13 through a power management device, so as to be implemented by the power management device Charge management, discharge management, and power management functions. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components. The computer device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
进一步地,所述计算机设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该计算机设备1与其他计算机设备之间建立通信连接。Further, the computer device 1 may also include a network interface, optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the computer device 1 Establish a communication connection with other computer equipment.
可选地,该计算机设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在计算机设备1中处理的信息以及用于显示可视化的用户界面。Optionally, the computer device 1 may further include a user interface, and the user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, and the like. The display, which may also be appropriately called a display screen or a display unit, is used for displaying information processed in the computer device 1 and for displaying a visual user interface.
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。It should be understood that the embodiments are only used for illustration, and are not limited by this structure in the scope of the patent application.
图3仅示出了具有组件12-13的计算机设备1,本领域技术人员可以理解的是,图3示出的结构并不构成对所述计算机设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 3 only shows the computer device 1 having the components 12-13. Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation on the computer device 1, and may include less than illustrated Or more components, or a combination of certain components, or a different arrangement of components.
结合图1,所述计算机设备1中的所述存储器12存储多个指令以实现一种基于行情数据的负载均衡方法,所述处理器13可执行所述多个指令从而实现:1, the memory 12 in the computer device 1 stores multiple instructions to implement a load balancing method based on market data, and the processor 13 can execute the multiple instructions to implement:
响应于目标客户端触发的接入请求,计算所述目标客户端的预请求带宽;In response to the access request triggered by the target client, calculating the pre-requested bandwidth of the target client;
采集服务端集群中每个服务端的资源信息,并根据每个服务端的资源信息确定每个服务端的当前预占用带宽;Collect resource information of each server in the server cluster, and determine the current pre-occupied bandwidth of each server according to the resource information of each server;
分别计算每个服务端的当前预占用带宽与所述目标客户端的预请求带宽的和,得到每个服务端的目标预占用带宽;Calculate the sum of the current pre-occupied bandwidth of each server and the pre-requested bandwidth of the target client respectively, and obtain the target pre-occupied bandwidth of each server;
获取预先配置的带宽阈值,从每个服务端中获取所述目标预占用带宽小于所述带宽阈值的服务端作为候选服务端;Obtaining a preconfigured bandwidth threshold, and obtaining a server whose target pre-occupied bandwidth is less than the bandwidth threshold from each server as a candidate server;
获取所述目标客户端对应的客户类型,根据所述客户类型从所述候选服务端中选择目标服务端;Obtain the client type corresponding to the target client, and select a target server from the candidate servers according to the client type;
将所述目标客户端接入所述目标服务端。Connect the target client to the target server.
具体地,所述处理器13对上述指令的具体实现方法可参考图1对应实施例中相关步骤的描述,在此不赘述。Specifically, for the specific implementation method of the above-mentioned instruction by the processor 13, reference may be made to the description of the relevant steps in the embodiment corresponding to FIG. 1 , which is not repeated here.
需要说明的是,本案中所涉及到的数据均为合法取得。It should be noted that the data involved in this case were obtained legally.
在本发明所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided by the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the modules is only a logical function division, and there may be other division manners in actual implementation.
本发明可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、置顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。本发明可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本发明,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。The present invention can be used in numerous general purpose or special purpose computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, including A distributed computing environment for any of the above systems or devices, and the like. The invention may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including storage devices.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and components shown as modules may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本发明各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.
对于本领域技术人员而言,显然本发明不限于上述示范性实施例的细节,而且在不背离本发明的精神或基本特征的情况下,能够以其他的具体形式实现本发明。It will be apparent to those skilled in the art that the present invention is not limited to the details of the above-described exemplary embodiments, but that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics of the invention.
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本发明的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本发明内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。Therefore, the embodiments are to be regarded in all respects as illustrative and not restrictive, and the scope of the invention is to be defined by the appended claims rather than the foregoing description, which are therefore intended to fall within the scope of the claims. All changes within the meaning and range of the equivalents of , are included in the present invention. Any reference signs in the claims shall not be construed as limiting the involved claim.
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。本发明中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第一、第二等词语用来表示名称,而并不表示任何特定的顺序。Furthermore, it is clear that the word "comprising" does not exclude other units or steps and the singular does not exclude the plural. A plurality of units or devices stated in the present invention may also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to denote names and do not denote any particular order.
最后应说明的是,以上实施例仅用以说明本发明的技术方案而非限制,尽管参照较佳实施例对本发明进行了详细说明,本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或等同替换,而不脱离本发明技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be Modifications or equivalent substitutions can be made without departing from the spirit and scope of the technical solutions of the present invention.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210097246.XA CN114124968B (en) | 2022-01-27 | 2022-01-27 | Load balancing method, device, equipment and medium based on market data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210097246.XA CN114124968B (en) | 2022-01-27 | 2022-01-27 | Load balancing method, device, equipment and medium based on market data |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114124968A CN114124968A (en) | 2022-03-01 |
CN114124968B true CN114124968B (en) | 2022-05-20 |
Family
ID=80361794
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210097246.XA Active CN114124968B (en) | 2022-01-27 | 2022-01-27 | Load balancing method, device, equipment and medium based on market data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114124968B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114884946B (en) * | 2022-04-28 | 2024-01-16 | 抖动科技(深圳)有限公司 | Remote multi-activity implementation method based on artificial intelligence and related equipment |
CN115766549B (en) * | 2022-10-28 | 2024-05-14 | 苏州浪潮智能科技有限公司 | Antithetical couplet test method, device, electronic equipment and storage medium |
CN116633881A (en) * | 2023-06-02 | 2023-08-22 | 软通动力信息技术(集团)股份有限公司 | A bandwidth control method, device, equipment and medium |
CN116668379B (en) * | 2023-07-31 | 2023-11-03 | 苏州浪潮智能科技有限公司 | Data transmission method and system, FDS management module, storage medium and electronic device |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8949410B2 (en) * | 2010-09-10 | 2015-02-03 | Cisco Technology, Inc. | Server load balancer scaling for virtual servers |
CN103795788B (en) * | 2014-01-20 | 2017-11-03 | 中国建设银行股份有限公司 | The load-balancing method and load-balanced server of instant communication server |
CN108572871B (en) * | 2017-12-13 | 2021-03-26 | 北京金山云网络技术有限公司 | A resource allocation method, device, electronic device and storage medium |
CN110109953B (en) * | 2018-01-19 | 2023-12-19 | 阿里巴巴集团控股有限公司 | Data query method, device and equipment |
CN109976917B (en) * | 2019-04-08 | 2020-09-11 | 科大讯飞股份有限公司 | Load scheduling method, device, load scheduler, storage medium and system |
CN110740164B (en) * | 2019-09-04 | 2021-01-08 | 华云数据控股集团有限公司 | Server determination method, regulation and control method, device, equipment and storage medium |
CN111225069B (en) * | 2020-03-13 | 2023-06-20 | 浙江书香荷马文化有限公司 | Distributed market data processing system and method |
CN112633867A (en) * | 2020-12-30 | 2021-04-09 | 中国农业银行股份有限公司 | Transaction request processing method and device |
CN112860384B (en) * | 2021-03-15 | 2024-08-06 | 南京邮电大学 | Multi-dimensional resource load balancing-oriented VNF multiplexing and migration method |
-
2022
- 2022-01-27 CN CN202210097246.XA patent/CN114124968B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN114124968A (en) | 2022-03-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114124968B (en) | Load balancing method, device, equipment and medium based on market data | |
US11336583B2 (en) | Background processes in update load balancers of an auto scaling group | |
CN109729106B (en) | Method, system and computer program product for processing computing tasks | |
US10038640B2 (en) | Managing state for updates to load balancers of an auto scaling group | |
WO2022111313A1 (en) | Request processing method and micro-service system | |
US10341426B2 (en) | Managing load balancers associated with auto-scaling groups | |
CN109960575B (en) | Computing power sharing method, system and related equipment | |
CN112015544A (en) | Load balancing method, device and equipment of k8s cluster and storage medium | |
CN112269628A (en) | Resource scheduling system and method | |
CN114564313A (en) | Load adjustment method and device, electronic equipment and storage medium | |
CN116431282A (en) | A cloud virtual host server management method, device, equipment and storage medium | |
CN115033605A (en) | Data query method and device, electronic equipment and storage medium | |
CN118014732A (en) | Data return method, device, equipment and medium | |
CN114860349A (en) | Data loading method, device, equipment and medium | |
CN114461401A (en) | Resource scheduling method and device, electronic equipment and storage medium | |
CN114827161A (en) | Service calling request sending method and device, electronic equipment and readable storage medium | |
CN118200421A (en) | Message processing method, device, electronic equipment and medium | |
CN111082982A (en) | Data transmission method, electronic device, system and medium | |
CN114995954B (en) | Bare metal server control method, device and medium | |
JP2023031248A (en) | Edge computing network, data transmission method, apparatus, device, and storage medium | |
CN116455756B (en) | Bandwidth equalization method, device and medium based on market push and inquiry | |
CN117914943B (en) | Data subscription and pushing method, device, equipment and medium | |
CN113076175A (en) | Memory sharing method and device for virtual machine | |
CN114489915B (en) | Mobile equipment-based open screen picture display method, device, equipment and medium | |
CN114389988B (en) | Remote procedure call method, device, equipment and medium based on network architecture |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP01 | Change in the name or title of a patent holder | ||
CP01 | Change in the name or title of a patent holder |
Address after: Room 2301, building 5, Shenzhen new generation industrial park, 136 Zhongkang Road, Meidu community, Meilin street, Futian District, Shenzhen, Guangdong 518000 Patentee after: Shenzhen Huarui Distributed Technology Co.,Ltd. Address before: Room 2301, building 5, Shenzhen new generation industrial park, 136 Zhongkang Road, Meidu community, Meilin street, Futian District, Shenzhen, Guangdong 518000 Patentee before: SHENZHEN ARCHFORCE FINANCIAL TECHNOLOGY Co.,Ltd. |
|
PE01 | Entry into force of the registration of the contract for pledge of patent right | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right |
Denomination of invention: Load balancing method, device, equipment, and medium based on market data Granted publication date: 20220520 Pledgee: CITIC Bank Limited by Share Ltd. Shenzhen branch Pledgor: Shenzhen Huarui Distributed Technology Co.,Ltd. Registration number: Y2024980044032 |