WO2024082406A1 - Traffic distribution method and apparatus, and storage medium and device - Google Patents

Traffic distribution method and apparatus, and storage medium and device Download PDF

Info

Publication number
WO2024082406A1
WO2024082406A1 PCT/CN2022/138523 CN2022138523W WO2024082406A1 WO 2024082406 A1 WO2024082406 A1 WO 2024082406A1 CN 2022138523 W CN2022138523 W CN 2022138523W WO 2024082406 A1 WO2024082406 A1 WO 2024082406A1
Authority
WO
WIPO (PCT)
Prior art keywords
service provider
service
target
value
list
Prior art date
Application number
PCT/CN2022/138523
Other languages
French (fr)
Chinese (zh)
Inventor
郑雄飞
Original Assignee
湖南快乐阳光互动娱乐传媒有限公司
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 湖南快乐阳光互动娱乐传媒有限公司 filed Critical 湖南快乐阳光互动娱乐传媒有限公司
Publication of WO2024082406A1 publication Critical patent/WO2024082406A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/80Actions related to the user profile or the type of traffic
    • H04L47/805QOS or priority aware
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9017Indexing; Data structures therefor; Storage structures using directory or table look-up
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/82Miscellaneous aspects

Definitions

  • the present application relates to the field of Internet technology, and in particular to a traffic distribution method, device, storage medium and equipment.
  • the existing traffic distribution method usually requires manual determination of the traffic proportion of each service provider. However, it is difficult to ensure that clients receive high-quality services by only referring to manual experience for traffic distribution.
  • the present application provides a traffic distribution method, apparatus, storage medium and device, the purpose of which is to ensure that a client can obtain high-quality services after traffic distribution.
  • a flow distribution method comprising:
  • the list of service providers includes multiple service providers that provide service capabilities for the target service project, as well as a weight and a sequence number of each of the service providers; the weight is calculated based on an influencing factor associated with the service quality of the service provider;
  • parsing the service request sent by the client to obtain the target service item includes:
  • One or more service requests sent by different types of clients are saved in a preset request queue, and the request time of each of the service requests is recorded;
  • the service requests in the preset request queue are analyzed in sequence to obtain the target service items;
  • a list of service providers of the target service item is obtained from a preset database.
  • the process of calculating the weight according to the influencing factors associated with the service quality of the service provider includes:
  • Pre-configuring basic information of multiple influencing factors associated with the service quality of the service provider the basic information at least includes an influencing coefficient and an influencing index;
  • a service provider list for configuring multiple service items includes multiple service providers that provide service capabilities for the service items, a serial number of each service provider, and values of various influencing factors associated with each service provider;
  • the weight of each service provider in the service provider list is calculated based on the values of each influencing factor associated with each service provider in the service provider list, and the influence coefficient and influence index of each influencing factor associated with each service provider in the service provider list.
  • determining the target service provider based on the weight of each service provider in the service provider list includes:
  • the target sum value includes: the sum of the weight of the service provider currently read and the value of the starting number variable before adjustment
  • For each service provider read determine whether the adjusted value of the starting number variable is not greater than the target value, and whether the sum of the weight of the service provider and the adjusted value of the starting number variable is greater than the target value;
  • the service provider currently read is identified as the target service provider.
  • the service provider currently read is identified as a non-target service provider.
  • the service provider with the first serial number in the service provider list is identified as the target service provider.
  • obtaining a target value based on a weight of each service provider in the service provider list includes:
  • a random number is randomly selected from the random number value interval as the target value.
  • a flow distribution device comprising:
  • a request parsing unit used to parse the service request sent by the client and obtain the target service item
  • a list acquisition unit used to acquire a list of service providers of a target service project from a preset database; the list of service providers includes a plurality of service providers that provide service capabilities for the target service project, and a weight and a sequence number of each of the service providers; the weight is calculated based on an influencing factor associated with the service quality of the service provider;
  • a service provider screening unit configured to determine a target service provider based on the weight of each service provider in the service provider list
  • the traffic distribution unit is used to distribute the traffic of the target service item to the target service provider.
  • a computer-readable storage medium includes a stored program, wherein the program implements the flow distribution method when executed by a processor.
  • a flow distribution device comprises: a processor, a memory and a bus; the processor and the memory are connected via the bus;
  • the memory is used to store programs, and the processor is used to run programs, wherein the program executes the traffic distribution method when the processor runs it.
  • the technical solution provided by the present application parses the service request sent by the client, obtains the target service project, and obtains the service provider list of the target service project from a preset database. Based on the weight of each service provider in the service provider list, the target service provider is determined. The traffic of the target service project is allocated to the target service provider. The present application can determine the weight of each service provider in the service provider list based on the influencing factors associated with the service quality of the service provider, and screen out the target service provider from the service provider list according to the weight of each service provider as the traffic allocation object of the target service project. Compared with the prior art, the selection of the target service provider is more objective, and can effectively ensure that the client can obtain high-quality services after traffic allocation.
  • FIG. 1a is a schematic diagram of a flow chart of a flow distribution method provided in an embodiment of the present application
  • FIG1b is a flow chart of a flow distribution method provided in an embodiment of the present application.
  • FIG2 is a flow chart of another flow distribution method provided in an embodiment of the present application.
  • FIG3 is a schematic diagram of the architecture of a flow distribution device provided in an embodiment of the present application.
  • a flow chart of a traffic distribution method provided in an embodiment of the present application is applied to a server and includes the following steps.
  • S101 pre-configure basic information of multiple influencing factors associated with the service quality of the service provider.
  • the basic information includes but is not limited to: code, name, description, type, impact coefficient, and impact index.
  • the so-called code is used to indicate the foreign name of the influencing factor.
  • the so-called names are used to indicate the Chinese names of the influencing factors.
  • the so-called type is also used to indicate the correlation between the influencing factor and the service quality. For example, if the type is positively correlated, it means that the influencing factor is proportional to the service quality.
  • the so-called impact coefficient is used to indicate the ratio of any influencing factor to the sum of all influencing factors. Specifically, assuming that the ratio of price (a specific form of influencing factor) to the sum of all influencing factors is 0.4, the impact coefficient of price is 0.4.
  • the so-called impact index is used to indicate the intensity of the influence of differences between different influencing factors on the weight.
  • the impact index is usually the index mentioned in the power operation. Assuming that the price (a specific form of influencing factor) is 10 and the impact index is 2, the value obtained after exponential operation of the price is 100.
  • the service provider list includes multiple service providers that provide service capabilities for the service project, the serial number of each service provider, and the values of various influencing factors associated with each service provider.
  • the serial number of the service provider is usually the order in which the service provider is written into the service provider list.
  • each service provider list For each service provider list, the weight of each service provider in the service provider list is calculated based on the values of each influencing factor associated with each service provider in the service provider list, and the influence coefficient and influence index of each influencing factor associated with each service provider in the service provider list.
  • Wi ⁇ Wpj+ ⁇ Wnt (1)
  • Wi represents the weight of any service provider
  • i represents the index of the service provider
  • Wp represents the positive correlation weight of any service provider
  • the specific calculation method of Wp is shown in formula (2)
  • j represents the index of the positive correlation factor (i.e., the influencing factor of the type of positive correlation)
  • Wn represents the negative correlation weight
  • the specific calculation method of Wn is shown in formula (3)
  • t represents the index of the negative correlation factor (i.e., the influencing factor of the type of negative correlation).
  • N represents the total number of service providers in the service provider list
  • Si represents the value of the positive correlation factor
  • C represents the influence coefficient of the positive correlation factor
  • M represents the influence index of the positive correlation factor
  • N represents the total number of service providers
  • Si represents the value of the negative correlation factor
  • C represents the impact coefficient of the negative correlation factor
  • M represents the impact index of the negative correlation factor
  • the service provider that is unable to provide services needs to be removed from the service provider list to obtain a new service provider list, and based on the values of various influencing factors associated with each service provider in the new service provider list, as well as the influence coefficient and influence index of each influencing factor associated with each service provider in the new service provider list, the weight of each service provider in the new service provider list is recalculated.
  • Wi W old +W new (4)
  • Wi represents the weight of any service provider in the new service provider list
  • i represents the index of the service provider
  • W old represents the original weight of any service provider in the new service provider list
  • W new represents the new weight of any service provider in the new service provider list.
  • S104 adding the weight of each service provider to the service provider list, and saving the service provider list of each service item to a preset database.
  • the service provider list of each service item is saved in a preset database, which can facilitate users to query the weight of each service provider at any time.
  • S105 One or more service requests sent by different types of clients are saved in a preset request queue, and the request time of each service request is recorded.
  • saving each service request in a preset request queue can realize asynchronous processing of each service request, so that the efficiency of traffic distribution is effectively improved.
  • clients include but are not limited to web clients, mobile clients, etc.
  • S106 parse each service request in the preset request queue in order of request time from earliest to latest, and obtain each target service item.
  • the target service item may be understood as the service item requested by the client.
  • S109 Generate a random number value interval based on the total weight value as the upper limit of the interval and the preset value as the lower limit of the interval.
  • the preset value can be set to 0.
  • the initial value of the start number variable is set to 0.
  • S112 traverse each service provider in the service provider list, and adjust the value of the start number variable when reading each service provider, so that the value of the adjusted start number variable is equal to the target value.
  • the target sum value includes: the sum of the weight of the service provider currently read and the value of the starting number variable before adjustment.
  • S113 For each service provider read, determine whether the adjusted value of the starting number variable is not greater than the target value, and whether the sum of the service provider's weight and the adjusted value of the starting number variable is greater than the target value.
  • the weight of service provider A is 400
  • the weight of service provider B is 300
  • the weight of service provider C is 200
  • a service provider needs to be found to send the text message.
  • the starting number variable m 0
  • the target value n is a random number randomly selected between 0 and 900, assuming that the target value n is 500
  • the reading order of each service provider is service provider A, service provider B, and service provider C.
  • the weight of service provider B is 300.
  • the reading of other service providers in the service provider list may be stopped to save computing resources.
  • S115 Mark the service provider with the first serial number in the service provider list as a non-target service provider.
  • S117 Allocate the traffic of the target service item to the target service provider.
  • the target service provider is selected as the traffic distribution object of the target service project, and the weight of each service provider is used as a reference basis for selection, and the weight of each service provider is calculated based on the influencing factors related to the service quality of the service provider as a reference basis.
  • the target service provider finally selected is selected based on the influencing factors as a reference basis, so that high-quality services can be provided for the target service project.
  • the traffic distribution result is more objective, ensuring that the client can obtain high-quality services after traffic distribution.
  • this embodiment can determine the weight of each service provider in the service provider list based on the influencing factors associated with the service quality of the service provider, and screen out the target service provider from the service provider list according to the weight of each service provider as the traffic allocation object of the target service project.
  • the selection of the target service provider is more objective and can effectively ensure that the client can obtain high-quality service after traffic allocation.
  • S101 mentioned in the above embodiment is an optional implementation of the flow distribution method shown in the embodiment of the present application.
  • S115 mentioned in the above embodiment is also an optional implementation of the flow distribution method shown in the embodiment of the present application.
  • the process mentioned in the above embodiment can be summarized as the method shown in Figure 2.
  • FIG2 a flow chart of another flow distribution method provided in an embodiment of the present application is provided, which includes the following steps.
  • S201 parse the service request sent by the client to obtain the target service item.
  • S202 Acquire a list of service providers of the target service item from a preset database.
  • the service provider list includes multiple service providers that provide service capabilities for the target service project, as well as the weight and sequence number of each service provider; the weight is calculated based on influencing factors associated with the service quality of the service provider.
  • S203 Determine a target service provider based on the weight of each service provider in the service provider list.
  • S204 Allocate the traffic of the target service item to the target service provider.
  • this embodiment can determine the weight of each service provider in the service provider list based on the influencing factors associated with the service quality of the service provider, and screen out the target service provider from the service provider list according to the weight of each service provider as the traffic allocation object of the target service project.
  • the selection of the target service provider is more objective and can effectively ensure that the client can obtain high-quality service after traffic allocation.
  • the embodiment of the present application also provides a flow distribution device.
  • FIG3 it is a schematic diagram of the architecture of a flow distribution device provided in an embodiment of the present application, including the units shown below.
  • the request parsing unit 100 is used to parse the service request sent by the client to obtain the target service item.
  • the request parsing unit 100 is specifically used to: save one or more service requests sent by different types of clients into a preset request queue, and record the request time of each service request; parse each service request in the preset request queue in order of request time from early to late, and obtain each target service item; for each target service item, obtain a list of service providers for the target service item from a preset database.
  • the list acquisition unit 200 is used to obtain a service provider list of the target service project from a preset database; the service provider list includes multiple service providers that provide service capabilities for the target service project, as well as the weight and serial number of each service provider; the weight is calculated based on the influencing factors associated with the service quality of the service provider.
  • the list acquisition unit 200 is specifically used to: pre-configure basic information of multiple influencing factors associated with the service quality of the service provider; the basic information at least includes an influencing coefficient and an influencing index; configure a list of service providers for multiple service items; the service provider list includes multiple service providers that provide service capabilities for the service items, the serial number of each service provider, and the values of each influencing factor associated with each service provider; for each service provider list, the weight of each service provider in the service provider list is calculated based on the values of each influencing factor associated with each service provider in the service provider list, and the influencing coefficient and influencing index of each influencing factor associated with each service provider in the service provider list.
  • the service provider screening unit 300 is used to determine a target service provider based on the weight of each service provider in the service provider list.
  • the service provider screening unit 300 is specifically used to: obtain a target value based on the weight of each service provider in the service provider list; initialize a starting number variable; wherein the initial value of the starting number variable is set to 0; traverse each service provider in the service provider list, and when reading each service provider, adjust the value of the starting number variable so that the value of the adjusted starting number variable is equal to the target sum value; the target sum value includes: the sum of the weight of the service provider currently read and the value of the starting number variable before adjustment; for each service provider read, determine whether the value of the adjusted starting number variable is not greater than the target value, and whether the sum of the service provider's weight and the value of the adjusted starting number variable is greater than the target value; when the value of the adjusted starting number variable is not greater than the target value, and the sum of the service provider's weight and the value of the adjusted starting number variable is greater than the target value, identify the currently read service provider as the target service provider.
  • the service provider screening unit 300 is also used to: when the value of the adjusted starting number variable is greater than the target value, and the sum of the service provider's weight and the value of the adjusted starting number variable is not greater than the target value, mark the currently read service provider as a non-target service provider.
  • the service provider screening unit 300 is further configured to: after reading all service providers in the service provider list and if the target service provider is not obtained, identify the service provider with the first serial number in the service provider list as the target service provider.
  • the service provider screening unit 300 is specifically used for: calculating the sum of the weights of each service provider in the service provider list to obtain the total weight value; generating a random number value interval based on the total weight value as the upper limit of the interval and the preset value as the lower limit of the interval; and randomly selecting a random number from the random number value interval as the target value.
  • the traffic distribution unit 400 is used to distribute the traffic of the target service item to the target service provider.
  • this embodiment can determine the weight of each service provider in the service provider list based on the influencing factors associated with the service quality of the service provider, and screen out the target service provider from the service provider list according to the weight of each service provider as the traffic allocation object of the target service project.
  • the selection of the target service provider is more objective and can effectively ensure that the client can obtain high-quality service after traffic allocation.
  • the present application also provides a computer-readable storage medium, which includes a stored program, wherein the program executes the traffic distribution method provided by the present application.
  • the present application also provides a traffic distribution device, including: a processor, a memory, and a bus.
  • the processor and the memory are connected via a bus, the memory is used to store programs, and the processor is used to run programs, wherein when the program is running, the traffic distribution method provided by the present application is executed, including the following steps:
  • the list of service providers includes multiple service providers that provide service capabilities for the target service project, as well as a weight and a sequence number of each of the service providers; the weight is calculated based on an influencing factor associated with the service quality of the service provider;
  • the parsing of the service request sent by the client to obtain the target service item includes:
  • One or more service requests sent by different types of clients are saved in a preset request queue, and the request time of each of the service requests is recorded;
  • the service requests in the preset request queue are analyzed in sequence to obtain the target service items;
  • a list of service providers of the target service item is obtained from a preset database.
  • the process of calculating the weight according to the influencing factors associated with the service quality of the service provider includes:
  • Pre-configuring basic information of multiple influencing factors associated with the service quality of the service provider the basic information at least includes an influencing coefficient and an influencing index;
  • a service provider list for configuring multiple service items includes multiple service providers that provide service capabilities for the service items, a serial number of each service provider, and values of various influencing factors associated with each service provider;
  • the weight of each service provider in the service provider list is calculated based on the values of each influencing factor associated with each service provider in the service provider list, and the influence coefficient and influence index of each influencing factor associated with each service provider in the service provider list.
  • determining the target service provider based on the weight of each service provider in the service provider list includes:
  • the target sum value includes: the sum of the weight of the service provider currently read and the value of the starting number variable before adjustment
  • For each service provider read determine whether the adjusted value of the starting number variable is not greater than the target value, and whether the sum of the weight of the service provider and the adjusted value of the starting number variable is greater than the target value;
  • the service provider currently read is identified as the target service provider.
  • the service provider currently read is identified as a non-target service provider.
  • the service provider with the first serial number in the service provider list is identified as the target service provider.
  • the step of obtaining the target value based on the weight of each service provider in the service provider list includes:
  • a random number is randomly selected from the random number value interval as the target value.
  • the functions described in the method of the embodiment of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in a storage medium readable by a computing device.
  • a computing device which can be a personal computer, server, mobile computing device or network device, etc.
  • the aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories, random access memories, magnetic disks or optical disks.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

Disclosed in the present application are a traffic distribution method and apparatus, and a storage medium and a device. The method comprises: parsing a service request, which is sent by a client, so as to obtain a target service item; acquiring a service provider list of the target service item from a preset database; determining a target service provider on the basis of the weight of each service provider in the service provider list; and distributing traffic of the target service item to the target service provider. By means of the method, the weight of each service provider in a service provider list is determined on the basis of an influencing factor associated with the quality of service of each service provider, and a target service provider is selected, as a traffic distribution object of a target service item, from the service provider list according to the weight of each service provider. Compared with the prior art, the selection of the target service provider is more objective, such that it can be effectively ensured that a client can obtain a high-quality service after traffic distribution is performed.

Description

流量分配方法、装置、存储介质和设备Traffic distribution method, device, storage medium and equipment
本申请要求于2022年10月18日提交中国专利局、申请号为202211272986.9、发明名称为“流量分配方法、装置、存储介质和设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the China Patent Office on October 18, 2022, with application number 202211272986.9 and invention name “Traffic distribution method, device, storage medium and equipment”, the entire contents of which are incorporated by reference in this application.
技术领域Technical Field
本申请涉及互联网技术领域,尤其涉及一种流量分配方法、装置、存储介质和设备。The present application relates to the field of Internet technology, and in particular to a traffic distribution method, device, storage medium and equipment.
背景技术Background technique
目前互联网行业大多需要云服务、短信、广告投放等能力,而相同能力市面上有很多厂商可以提供,如果多家服务提供商入围,就会涉及到一个流量分配的问题。Currently, most Internet industries require cloud services, text messages, advertising and other capabilities, and there are many manufacturers on the market that can provide the same capabilities. If multiple service providers are shortlisted, the issue of traffic distribution will arise.
现有的流量分配方式,通常需要人工制定各个服务商的流量占比,然而,仅仅参考人工经验进行流量分配,难以确保客户端获得高质量的服务。The existing traffic distribution method usually requires manual determination of the traffic proportion of each service provider. However, it is difficult to ensure that clients receive high-quality services by only referring to manual experience for traffic distribution.
为此,如何确保经由流量分配后客户端能够获得高质量的服务,成为本领域亟需解决的问题。Therefore, how to ensure that the client can obtain high-quality services after traffic distribution has become an urgent problem to be solved in this field.
发明内容Summary of the invention
本申请提供了一种流量分配方法、装置、存储介质和设备,目的在于确保经由流量分配后客户端能够获得高质量的服务。The present application provides a traffic distribution method, apparatus, storage medium and device, the purpose of which is to ensure that a client can obtain high-quality services after traffic distribution.
为了实现上述目的,本申请提供了以下技术方案:In order to achieve the above objectives, this application provides the following technical solutions:
一种流量分配方法,包括:A flow distribution method, comprising:
解析客户端发送的服务请求,得到目标服务项目;Parse the service request sent by the client and obtain the target service item;
从预设数据库中获取目标服务项目的服务商列表;所述服务商列表包括为所述目标服务项目提供服务能力的多个服务商,以及每个所述服务商的权重和序号;所述权重依据与所述服务商的服务质量关联的影响因素计算得到;Obtaining a list of service providers for the target service project from a preset database; the list of service providers includes multiple service providers that provide service capabilities for the target service project, as well as a weight and a sequence number of each of the service providers; the weight is calculated based on an influencing factor associated with the service quality of the service provider;
基于所述服务商列表中各个服务商的权重,确定目标服务商;Determining a target service provider based on the weight of each service provider in the service provider list;
将所述目标服务项目的流量,分配给所述目标服务商。Allocate the traffic of the target service item to the target service provider.
可选的,所述解析客户端发送的服务请求,得到目标服务项目,包括:Optionally, parsing the service request sent by the client to obtain the target service item includes:
将不同类型的客户端发送的一个或多个服务请求,保存到预设请求队列中,并记录每个所述服务请求的请求时间;One or more service requests sent by different types of clients are saved in a preset request queue, and the request time of each of the service requests is recorded;
按照请求时间由早到晚的顺序,依次解析所述预设请求队列中的各个服务请求,得到各个目标服务项目;According to the order of request time from earliest to latest, the service requests in the preset request queue are analyzed in sequence to obtain the target service items;
对于每个所述目标服务项目,从预设数据库中获取所述目标服务项目的服务商列表。For each of the target service items, a list of service providers of the target service item is obtained from a preset database.
可选的,所述依据与所述服务商的服务质量关联的影响因素计算得到所述权重的过程,包括:Optionally, the process of calculating the weight according to the influencing factors associated with the service quality of the service provider includes:
预先配置与所述服务商的服务质量关联的多个影响因素的基础信息;所述基础信息至少包括影响系数和影响指数;Pre-configuring basic information of multiple influencing factors associated with the service quality of the service provider; the basic information at least includes an influencing coefficient and an influencing index;
配置多个服务项目的服务商列表;所述服务商列表包括为所述服务项目提供服务能力的多个服务商、每个服务商的序号,以及与每个服务商关联的各个影响因素的取值;A service provider list for configuring multiple service items; the service provider list includes multiple service providers that provide service capabilities for the service items, a serial number of each service provider, and values of various influencing factors associated with each service provider;
对于每个所述服务商列表,基于与所述服务商列表中每个服务商关联的各个影响因素的取值,以及与所述服务商列表中每个服务商关联的各个影响因素的影响系数和影响指数,计算得出所述服务商列表中每个服务商的权重。For each of the service provider lists, the weight of each service provider in the service provider list is calculated based on the values of each influencing factor associated with each service provider in the service provider list, and the influence coefficient and influence index of each influencing factor associated with each service provider in the service provider list.
可选的,所述基于所述服务商列表中各个服务商的权重,确定目标服务商,包括:Optionally, determining the target service provider based on the weight of each service provider in the service provider list includes:
基于所述服务商列表中各个服务商的权重,获得目标数值;Obtaining a target value based on the weight of each service provider in the service provider list;
初始化一个起始数变量;其中,所述起始数变量的初始值设为0;Initialize a starting number variable; wherein the initial value of the starting number variable is set to 0;
遍历所述服务商列表中的各个服务商,并在读取每个服务商时,调整所述起始数变量的取值,以使调整后的起始数变量的取值等于目标和值;所述目标和值包括:当前读取得到的服务商的权重和调整前的起始数变量的取值的和值;Traversing each service provider in the service provider list, and adjusting the value of the starting number variable when reading each service provider, so that the adjusted value of the starting number variable is equal to the target sum value; the target sum value includes: the sum of the weight of the service provider currently read and the value of the starting number variable before adjustment;
对于每次读取得到的服务商,判断调整后的起始数变量的取值是否不大于所述目标数值,且所述服务商的权重与调整后的起始数变量的取值的和值是否大于所述目标数值;For each service provider read, determine whether the adjusted value of the starting number variable is not greater than the target value, and whether the sum of the weight of the service provider and the adjusted value of the starting number variable is greater than the target value;
在调整后的起始数变量的取值不大于所述目标数值,且所述服务商的权重与调整后的起始数变量的取值的和值大于所述目标数值的情况下,将当前读取得到的所述服务商,标识为目标服务商。When the value of the adjusted starting number variable is not greater than the target value, and the sum of the weight of the service provider and the value of the adjusted starting number variable is greater than the target value, the service provider currently read is identified as the target service provider.
可选的,还包括:Optionally, also include:
在调整后的起始数变量的取值大于所述目标数值,且所述服务商的权重与调整后的起始数变量的取值的和值不大于所述目标数值的情况下,将当前读取得到的所述服务商,标识为非目标服务商。When the value of the adjusted starting number variable is greater than the target value, and the sum of the weight of the service provider and the value of the adjusted starting number variable is not greater than the target value, the service provider currently read is identified as a non-target service provider.
可选的,还包括:Optionally, also include:
在读取所述服务商列表中的所有服务商之后,且并未获取得到所述目标服务商的情况下,将所述服务商列表中序号为首位的服务商,标识为所述目标服务商。After reading all the service providers in the service provider list, if the target service provider is not obtained, the service provider with the first serial number in the service provider list is identified as the target service provider.
可选的,所述基于所述服务商列表中各个服务商的权重,获得目标数值,包括:Optionally, obtaining a target value based on a weight of each service provider in the service provider list includes:
计算所述服务商列表中各个所述服务商的权重的总和,得到权重总值;Calculate the sum of the weights of each service provider in the service provider list to obtain a total weight value;
基于所述权重总值作为区间上限,预设数值作为区间下限,生成随机数取值区间;Generate a random number value interval based on the total weight value as the interval upper limit and the preset value as the interval lower limit;
从所述随机数取值区间中随机选取一个随机数,作为目标数值。A random number is randomly selected from the random number value interval as the target value.
一种流量分配装置,包括:A flow distribution device, comprising:
请求解析单元,用于解析客户端发送的服务请求,得到目标服务项目;A request parsing unit, used to parse the service request sent by the client and obtain the target service item;
列表获取单元,用于从预设数据库中获取目标服务项目的服务商列表;所述服务商列表包括为所述目标服务项目提供服务能力的多个服务商,以及每个所述服务商的权重和序号;所述权重依据与所述服务商的服务质量关联的影响因素计算得到;A list acquisition unit, used to acquire a list of service providers of a target service project from a preset database; the list of service providers includes a plurality of service providers that provide service capabilities for the target service project, and a weight and a sequence number of each of the service providers; the weight is calculated based on an influencing factor associated with the service quality of the service provider;
服务商筛选单元,用于基于所述服务商列表中各个服务商的权重,确定目标服务商;A service provider screening unit, configured to determine a target service provider based on the weight of each service provider in the service provider list;
流量分配单元,用于将所述目标服务项目的流量,分配给所述目标服务商。The traffic distribution unit is used to distribute the traffic of the target service item to the target service provider.
一种计算机可读存储介质,所述计算机可读存储介质包括存储的程序,其中,所述程序被处理器运行时所述的流量分配方法。A computer-readable storage medium includes a stored program, wherein the program implements the flow distribution method when executed by a processor.
一种流量分配设备,包括:处理器、存储器和总线;所述处理器与所述存储器通过所述总线连接;A flow distribution device comprises: a processor, a memory and a bus; the processor and the memory are connected via the bus;
所述存储器用于存储程序,所述处理器用于运行程序,其中,所述程序被处理器运行时执行所述的流量分配方法。The memory is used to store programs, and the processor is used to run programs, wherein the program executes the traffic distribution method when the processor runs it.
本申请提供的技术方案,解析客户端发送的服务请求,得到目标服务项目,从预设数据库中获取目标服务项目的服务商列表。基于服务商列表中各个服务商的权重,确定目标服务商。将目标服务项目的流量,分配给目标服务商。本申请能够基于与服务商的服务质量关联的影响因素,确定服务商列表中各个服务商的权重,并依据各个服务商的权重,从服务商列表中筛选出目标服务商,作为目标服务项目的流量分配对象,相较于现有技术,目标服务商的选择更加客观,能够有效确保经由流量分配后客户端能够获得高质量的服务。The technical solution provided by the present application parses the service request sent by the client, obtains the target service project, and obtains the service provider list of the target service project from a preset database. Based on the weight of each service provider in the service provider list, the target service provider is determined. The traffic of the target service project is allocated to the target service provider. The present application can determine the weight of each service provider in the service provider list based on the influencing factors associated with the service quality of the service provider, and screen out the target service provider from the service provider list according to the weight of each service provider as the traffic allocation object of the target service project. Compared with the prior art, the selection of the target service provider is more objective, and can effectively ensure that the client can obtain high-quality services after traffic allocation.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
图1a为本申请实施例提供的一种流量分配方法的流程示意图;FIG. 1a is a schematic diagram of a flow chart of a flow distribution method provided in an embodiment of the present application;
图1b为本申请实施例提供的一种流量分配方法的流程示意图;FIG1b is a flow chart of a flow distribution method provided in an embodiment of the present application;
图2为本申请实施例提供的另一种流量分配方法的流程示意图;FIG2 is a flow chart of another flow distribution method provided in an embodiment of the present application;
图3为本申请实施例提供的一种流量分配装置的架构示意图。FIG3 is a schematic diagram of the architecture of a flow distribution device provided in an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
如图1a和图1b所示,为本申请实施例提供的一种流量分配方法的流程示意图,应用于服务端,包括如下所示步骤。As shown in FIG. 1a and FIG. 1b , a flow chart of a traffic distribution method provided in an embodiment of the present application is applied to a server and includes the following steps.
S101:预先配置与服务商的服务质量关联的多个影响因素的基础信息。S101: pre-configure basic information of multiple influencing factors associated with the service quality of the service provider.
其中,基础信息包括但不限于为:编码(code)、名称、描述、类型、影响系数、影响指数。The basic information includes but is not limited to: code, name, description, type, impact coefficient, and impact index.
所谓的编码,用于指示影响因素的外文名称。The so-called code is used to indicate the foreign name of the influencing factor.
所谓的名称,用于指示影响因素的中文名称。The so-called names are used to indicate the Chinese names of the influencing factors.
所谓的描述,用于指示影响因素与服务质量的关联关系,例如效率(影响因素的一种具体表现形式)与服务质量成正比(即效率越高,服务质量越好)。The so-called description is used to indicate the correlation between the influencing factors and the service quality. For example, efficiency (a specific manifestation of the influencing factors) is proportional to the service quality (that is, the higher the efficiency, the better the service quality).
所谓的类型,同样用于指示影响因素与服务质量的关联关系,例如类型为正相关,则代表影响因素与服务质量成正比。The so-called type is also used to indicate the correlation between the influencing factor and the service quality. For example, if the type is positively correlated, it means that the influencing factor is proportional to the service quality.
所谓的影响系数,用于指示任意一个影响因素与全部影响因素总和的比值,具体的,假设价格(影响因素的一种具体表现形式)与全部影响因素总和的比值为0.4,则价格的影响系数为0.4。The so-called impact coefficient is used to indicate the ratio of any influencing factor to the sum of all influencing factors. Specifically, assuming that the ratio of price (a specific form of influencing factor) to the sum of all influencing factors is 0.4, the impact coefficient of price is 0.4.
所谓的影响指数,用于指示不同影响因素之间的差异对权重影响的强度,影响指数越大,则对权重的影响越大,具体的,影响指数通常为幂运算所提及的指数,假设价格(影响因素的一种具体表现形式)为10,影响指数为2,则经由对价格进行幂运算后得到的值为100。The so-called impact index is used to indicate the intensity of the influence of differences between different influencing factors on the weight. The larger the impact index, the greater the influence on the weight. Specifically, the impact index is usually the index mentioned in the power operation. Assuming that the price (a specific form of influencing factor) is 10 and the impact index is 2, the value obtained after exponential operation of the price is 100.
具体的,各个影响因素的基础信息可以参见表1所示。Specifically, the basic information of each influencing factor can be seen in Table 1.
表1Table 1
Figure PCTCN2022138523-appb-000001
Figure PCTCN2022138523-appb-000001
Figure PCTCN2022138523-appb-000002
Figure PCTCN2022138523-appb-000002
需要说明的是,上述表1所示的内容仅仅用于举例说明。一般来讲,表1所示的内容为各个影响因素的基础信息的具体配置场景。It should be noted that the contents shown in Table 1 above are only used for illustration. Generally speaking, the contents shown in Table 1 are specific configuration scenarios of basic information of various influencing factors.
具体的,针对短信服务(服务项目的一种具体表现形式)的具体使用场景中,假设各个影响因素包括价格占比、到达率、偷量检测成功率、验证码核销率,其中,价格占比6成,影响系数=0.6,影响指数=1,负相关,价格越低,后续S103计算得到的权重越高;到达率占比1成,影响系数=0.1,影响指数=10,正相关,到达率越高,后续S103计算得到的权重越高;偷量检测成功率占比2成,影响系数=0.2,影响指数=10,正相关,成功率越高,后续S103计算得到的权重越高;验证码核销率占比1成,影响系数=0.1,影响指数=10,正相关,核销率越高,后续S103计算得到的权重越高。Specifically, in the specific usage scenario of SMS service (a specific form of service item), it is assumed that the influencing factors include price proportion, arrival rate, theft detection success rate, and verification code cancellation rate, among which the price accounts for 60%, the influence coefficient = 0.6, the influence index = 1, negative correlation, the lower the price, the higher the weight calculated in the subsequent S103; the arrival rate accounts for 10%, the influence coefficient = 0.1, the influence index = 10, positive correlation, the higher the arrival rate, the higher the weight calculated in the subsequent S103; the theft detection success rate accounts for 20%, the influence coefficient = 0.2, the influence index = 10, positive correlation, the higher the success rate, the higher the weight calculated in the subsequent S103; the verification code cancellation rate accounts for 10%, the influence coefficient = 0.1, the influence index = 10, positive correlation, the higher the cancellation rate, the higher the weight calculated in the subsequent S103.
S102:配置多个服务项目的服务商列表。S102: configuring a service provider list for multiple service items.
其中,服务商列表包括为服务项目提供服务能力的多个服务商、每个服务商的序号,以及与每个服务商关联的各个影响因素的取值。一般来讲,服务商的序号通常为该服务商写入到服务商列表中的次序。The service provider list includes multiple service providers that provide service capabilities for the service project, the serial number of each service provider, and the values of various influencing factors associated with each service provider. Generally speaking, the serial number of the service provider is usually the order in which the service provider is written into the service provider list.
具体的,服务商列表的具体内容可参见表2所示。Specifically, the specific content of the service provider list can be seen in Table 2.
表2Table 2
序号Serial number 服务商Service Provider 价格price 效率efficiency 到达率Reach 合格率Pass rate 权重Weights 创建时间Creation time 操作operate
11 服务商1Service Provider 1 100100 1.31.3 98%98% 99%99% 0.20.2 2021-12-092021-12-09 计算权重删除Calculate weight deletion
22 服务商2Service Provider 2 9898 0.90.9 99%99% 98%98% 0.20.2 2021-12-092021-12-09 计算权重删除Calculate weight deletion
33 服务商3Service Provider 3 9797 0.80.8 100%100% 97%97% 0.20.2 2021-12-092021-12-09 计算权重删除Calculate weight deletion
44 服务商4Service Provider 4 102102 1.41.4 95%95% 99%99% 0.20.2 2021-12-092021-12-09 计算权重删除Calculate weight deletion
需要说明的是,上述表2所示内容仅仅用于举例说明。此外,上述表2所示权重一栏需要用户触发操作中的计算权重这一项,才能获得服务商的权重,即执行后续S103后,才能获得权重这一项信息。It should be noted that the contents shown in Table 2 are only for illustration. In addition, the weight column shown in Table 2 requires the user to trigger the calculation weight item in the operation to obtain the weight of the service provider, that is, to obtain the weight information after executing the subsequent S103.
S103:对于每个服务商列表,基于与服务商列表中每个服务商关联的各个影响因素的取值,以及与服务商列表中每个服务商关联的各个影响因素的影响系数和影响指数,计算得出服务商列表中每个服务商的权重。S103: For each service provider list, the weight of each service provider in the service provider list is calculated based on the values of each influencing factor associated with each service provider in the service provider list, and the influence coefficient and influence index of each influencing factor associated with each service provider in the service provider list.
其中,基于与服务商列表中每个服务商关联的各个影响因素的取值,以及与服务商列表中每个服务商关联的各个影响因素的影响系数和影响指数,计算得出服务商列表中每个服务商的权重的具体实现过程,可以参见公式(1)所示。The specific implementation process of calculating the weight of each service provider in the service provider list based on the values of each influencing factor associated with each service provider in the service provider list, as well as the influence coefficient and influence index of each influencing factor associated with each service provider in the service provider list, can be seen in formula (1).
Wi=∑Wpj+∑Wnt   (1)Wi=∑Wpj+∑Wnt   (1)
在公式(1)中,Wi代表任意一个服务商的权重,i代表服务商的索引,Wp代表任意一个服务商的正相关权重,且Wp的具体计算方式如公式(2)所示,j代表正相关因数(即类型为正相关的影响因素)的索引,Wn代表负相关权重,且Wn的具体计算方式如公式(3)所示,t代表负相关因数(即类型为负相关的影响因素)的索引。In formula (1), Wi represents the weight of any service provider, i represents the index of the service provider, Wp represents the positive correlation weight of any service provider, and the specific calculation method of Wp is shown in formula (2), j represents the index of the positive correlation factor (i.e., the influencing factor of the type of positive correlation), Wn represents the negative correlation weight, and the specific calculation method of Wn is shown in formula (3), and t represents the index of the negative correlation factor (i.e., the influencing factor of the type of negative correlation).
Figure PCTCN2022138523-appb-000003
Figure PCTCN2022138523-appb-000003
在公式(2)中,N代表服务商列表的服务商总数,Si代表正相关因数的取值,C代表正相关因数的影响系数,M代表正相关因数的影响指数。In formula (2), N represents the total number of service providers in the service provider list, Si represents the value of the positive correlation factor, C represents the influence coefficient of the positive correlation factor, and M represents the influence index of the positive correlation factor.
Figure PCTCN2022138523-appb-000004
Figure PCTCN2022138523-appb-000004
在公式(3)中,N代表服务商的总数,Si代表负相关因数的取值,C代表负相关因数的影响系数,M代表负相关因数的影响指数。In formula (3), N represents the total number of service providers, Si represents the value of the negative correlation factor, C represents the impact coefficient of the negative correlation factor, and M represents the impact index of the negative correlation factor.
需要说明的是,在检测到服务商列表中任意一个服务商无法提供服务的情况下,需要将无法提供服务的服务商从服务商列表中剔除出去,得到新的服务商列表,并基于与新的服务商列表中每个服务商关联的各个影响因素的取值,以及与新的服务商列表中每个服务商关联的各个影响因素的影响系数和影响指数,重新计算得出新的服务商列表中每个服务商的权重。It should be noted that if it is detected that any service provider in the service provider list is unable to provide services, the service provider that is unable to provide services needs to be removed from the service provider list to obtain a new service provider list, and based on the values of various influencing factors associated with each service provider in the new service provider list, as well as the influence coefficient and influence index of each influencing factor associated with each service provider in the new service provider list, the weight of each service provider in the new service provider list is recalculated.
具体的,基于与新的服务商列表中每个服务商关联的各个影响因素的取值,以及与新的服务商列表中每个服务商关联的各个影响因素的影响系数和影响指数,重新计算得出新的服务商列表中每个服务商的权重的具体实现过程,可以参见公式(4)所示。Specifically, based on the values of various influencing factors associated with each service provider in the new service provider list, as well as the influence coefficient and influence index of various influencing factors associated with each service provider in the new service provider list, the specific implementation process of recalculating the weight of each service provider in the new service provider list can be seen in formula (4).
Wi=W old+W new  (4) Wi=W old +W new (4)
在公式(4)中,Wi代表新的服务商列表中任意一个服务商的权重,i代表服务商的索引,W old代表新的服务商列表中任意一个服务商的原先的权重,W new代表新的服务商列表中任意一个服务商的新的权重,W new的具体计算过程如公式(5)所示。 In formula (4), Wi represents the weight of any service provider in the new service provider list, i represents the index of the service provider, W old represents the original weight of any service provider in the new service provider list, and W new represents the new weight of any service provider in the new service provider list. The specific calculation process of W new is shown in formula (5).
W new=W old(N=Q)*W m  (5) W new =W old(N = Q) *W m (5)
在公式(5)中,W old(N=Q)代表在服务商总数为Q(Q=N-1)的条件下任意一个服务商所分配的权重,W m代表已被剔除出服务商列表的服务商原先被分配到的权重,m代表被剔除的服务商的索引。此外,W old(N=Q)的具体计算过程可参见公式(1),两者间的区别仅仅是服务商总数变更为Q。 In formula (5), W old (N = Q) represents the weight assigned to any service provider when the total number of service providers is Q (Q = N-1), W m represents the weight originally assigned to the service provider that has been removed from the service provider list, and m represents the index of the removed service provider. In addition, the specific calculation process of W old (N = Q) can be referred to formula (1), and the difference between the two is only that the total number of service providers is changed to Q.
需要强调的是,在任意一个影响因素的影响系数和影响指数发生变更,以及发生新增影响因素、删除影响因素的情况下,需要调用公式(1),重新计算服务商列表中每个服务商的权重。It should be emphasized that when the influence coefficient and influence index of any influencing factor changes, or when a new influencing factor is added or deleted, it is necessary to call formula (1) to recalculate the weight of each service provider in the service provider list.
S104:将各个服务商的权重,添加到服务商列表中,并将各个服务项目的服务商列表,保存到预设数据库中。S104: adding the weight of each service provider to the service provider list, and saving the service provider list of each service item to a preset database.
其中,将各个服务项目的服务商列表,保存到预设数据库中,能够方便用户随时查询各个服务商的权重。Among them, the service provider list of each service item is saved in a preset database, which can facilitate users to query the weight of each service provider at any time.
S105:将不同类型的客户端发送的一个或多个服务请求,保存到预设请求队列中,并记录每个服务请求的请求时间。S105: One or more service requests sent by different types of clients are saved in a preset request queue, and the request time of each service request is recorded.
其中,将各个服务请求保存到预设请求队列中,能够实现各个服务请求的异步处理,使得流量分配的效率得到有效提高。Among them, saving each service request in a preset request queue can realize asynchronous processing of each service request, so that the efficiency of traffic distribution is effectively improved.
需要说明的是,不同类型的客户端包括但不限于为网页客户端、移动客户端等。It should be noted that different types of clients include but are not limited to web clients, mobile clients, etc.
S106:按照请求时间由早到晚的顺序,依次解析预设请求队列中的各个服务请求,得到各个目标服务项目。S106: parse each service request in the preset request queue in order of request time from earliest to latest, and obtain each target service item.
其中,目标服务项目可以理解为客户端所请求的服务项目。The target service item may be understood as the service item requested by the client.
S107:对于每个目标服务项目,从预设数据库中获取目标服务项目的服务商列表。S107: For each target service item, a service provider list of the target service item is obtained from a preset database.
S108:计算服务商列表中各个服务商的权重的总和,得到权重总值。S108: Calculate the sum of the weights of the various service providers in the service provider list to obtain a total weight value.
S109:基于权重总值作为区间上限,预设数值作为区间下限,生成随机数取值区间。S109: Generate a random number value interval based on the total weight value as the upper limit of the interval and the preset value as the lower limit of the interval.
其中,预设数值可设为0。Among them, the preset value can be set to 0.
S110:从随机数取值区间中随机选取一个随机数,作为目标数值。S110: Randomly select a random number from the random number value interval as the target value.
S111:初始化一个起始数变量。S111: Initialize a starting number variable.
其中,起始数变量的初始值设为0。The initial value of the start number variable is set to 0.
S112:遍历服务商列表中的各个服务商,并在读取每个服务商时,调整起始数变量的取值,以使调整后的起始数变量的取值等于目标和值。S112: traverse each service provider in the service provider list, and adjust the value of the start number variable when reading each service provider, so that the value of the adjusted start number variable is equal to the target value.
其中,目标和值包括:当前读取得到的服务商的权重和调整前的起始数变量的取值的和值。The target sum value includes: the sum of the weight of the service provider currently read and the value of the starting number variable before adjustment.
S113:对于每次读取得到的服务商,判断调整后的起始数变量的取值是否不大于目标数值,且服务商的权重与调整后的起始数变量的取值的和值是否大于目标数值。S113: For each service provider read, determine whether the adjusted value of the starting number variable is not greater than the target value, and whether the sum of the service provider's weight and the adjusted value of the starting number variable is greater than the target value.
若调整后的起始数变量的取值不大于目标数值,且服务商的权重与调整后的起始数变量的取值的和值大于目标数值,则执行S114。If the value of the adjusted starting number variable is not greater than the target value, and the sum of the weight of the service provider and the value of the adjusted starting number variable is greater than the target value, S114 is executed.
若调整后的起始数变量的取值大于目标数值,且服务商的权重与调整后的起始数变量的取值的和值不大于目标数值,则执行S115。If the adjusted value of the starting number variable is greater than the target value, and the sum of the service provider's weight and the adjusted value of the starting number variable is not greater than the target value, S115 is executed.
具体的,假设服务商A的权重为400、服务商B的权重为300和服务商C的权重为200,收到一次短信请求(即目标服务项目),需要找到一个服务商来发送短信。起始数变量m=0,目标数值n为0到900之间随机选取的随机数,假设为目标数值n为500,且各个服务商的读取顺序为服务商A、服务商B、服务商C,每次读取到任意一个服务商,则判断过程简化为:m<=n且n<(m+当前读取得到的服务商的权重)。Specifically, assuming that the weight of service provider A is 400, the weight of service provider B is 300, and the weight of service provider C is 200, when a text message request (i.e., the target service item) is received, a service provider needs to be found to send the text message. The starting number variable m=0, the target value n is a random number randomly selected between 0 and 900, assuming that the target value n is 500, and the reading order of each service provider is service provider A, service provider B, and service provider C. Each time any service provider is read, the judgment process is simplified to: m<=n and n<(m+the weight of the currently read service provider).
当读取到服务商A时,服务商A的权重为400,首先m<=n是满足的(因为0<=500),n<(m+当前循环服务的权重不满足(因为500<0+400不成立),此时m=m+当前循环服务的权重=0+400=400,然后继续循环2;When service provider A is read, the weight of service provider A is 400. First, m<=n is satisfied (because 0<=500), but n<(m+the weight of the current cycle service) is not satisfied (because 500<0+400 is not true). At this time, m=m+the weight of the current cycle service=0+400=400, and then cycle 2 is continued;
当读取到服务商B时,服务商B的权重为300,首先m<=n是满足的(因为400<=500),n<(m+当前循环服务的权重也满足(因为500<400+300成立),此是两个条件都满足,说明找到服务商B来执行本次的短信发送动作, 否则继续循环,直到所有的服务商都遍历完还没找到符合条件的,则取第一个服务商即服务商A来执行短信发送动作。When service provider B is read, the weight of service provider B is 300. First, m<=n is satisfied (because 400<=500), and n<(m+the weight of the current loop service) is also satisfied (because 500<400+300 is established). These two conditions are met, indicating that service provider B is found to perform the SMS sending action. Otherwise, the loop continues until all service providers are traversed and no qualified service provider is found. Then the first service provider, service provider A, is selected to perform the SMS sending action.
S114:将当前读取得到的服务商,标识为目标服务商。S114: Identify the currently read service provider as the target service provider.
在执行S114之后,继续执行S117。After executing S114, continue to execute S117.
其中,在获取到目标服务商后,则可停止读取服务商列表中的其他服务商,以节省计算资源。After the target service provider is obtained, the reading of other service providers in the service provider list may be stopped to save computing resources.
S115:将服务商列表中序号为首位的服务商,标识为非目标服务商。S115: Mark the service provider with the first serial number in the service provider list as a non-target service provider.
在执行S115之后,继续执行S116。After executing S115 , continue to execute S116 .
S116:在读取服务商列表中的所有服务商之后,且并未获取得到目标服务商的情况下,将服务商列表中序号为首位的服务商,标识为目标服务商。S116: After reading all the service providers in the service provider list, if the target service provider is not obtained, the service provider with the first serial number in the service provider list is marked as the target service provider.
在执行S116之后,继续执行S117。After executing S116, continue to execute S117.
S117:将目标服务项目的流量,分配给目标服务商。S117: Allocate the traffic of the target service item to the target service provider.
其中,选择目标服务商作为目标服务项目的流量分配对象,是以各个服务商的权重作为参考依据进行选择的,且各个服务商的权重是依据与服务商的服务质量关联的影响因素作为参考依据计算得到,也就是说,最终所选择的目标服务商,是基于影响因素作为参考依据进行选择的,从而能够为目标服务项目提供高质量的服务,相较于现有的人为选择方式,流量分配结果更加客观,确保经由流量分配后客户端能够获得高质量的服务。Among them, the target service provider is selected as the traffic distribution object of the target service project, and the weight of each service provider is used as a reference basis for selection, and the weight of each service provider is calculated based on the influencing factors related to the service quality of the service provider as a reference basis. In other words, the target service provider finally selected is selected based on the influencing factors as a reference basis, so that high-quality services can be provided for the target service project. Compared with the existing manual selection method, the traffic distribution result is more objective, ensuring that the client can obtain high-quality services after traffic distribution.
综上所述,本实施例能够基于与服务商的服务质量关联的影响因素,确定服务商列表中各个服务商的权重,并依据各个服务商的权重,从服务商列表中筛选出目标服务商,作为目标服务项目的流量分配对象,相较于现有技术,目标服务商的选择更加客观,能够有效确保经由流量分配后客户端能够获得高质量的服务。To sum up, this embodiment can determine the weight of each service provider in the service provider list based on the influencing factors associated with the service quality of the service provider, and screen out the target service provider from the service provider list according to the weight of each service provider as the traffic allocation object of the target service project. Compared with the existing technology, the selection of the target service provider is more objective and can effectively ensure that the client can obtain high-quality service after traffic allocation.
需要说明的是,上述实施例提及的S101,为本申请实施例所示流量分配方法的一种可选的实现方式。此外,上述实施例提及的S115,也为本申请实施例所示流量分配方法的一种可选的实现方式。为此,上述实施例提及的流程,可以概括为图2所示的方法。It should be noted that S101 mentioned in the above embodiment is an optional implementation of the flow distribution method shown in the embodiment of the present application. In addition, S115 mentioned in the above embodiment is also an optional implementation of the flow distribution method shown in the embodiment of the present application. To this end, the process mentioned in the above embodiment can be summarized as the method shown in Figure 2.
如图2所示,为本申请实施例提供的另一种流量分配方法的流程示意图,包括如下所示步骤。As shown in FIG2 , a flow chart of another flow distribution method provided in an embodiment of the present application is provided, which includes the following steps.
S201:解析客户端发送的服务请求,得到目标服务项目。S201: parse the service request sent by the client to obtain the target service item.
S202:从预设数据库中获取目标服务项目的服务商列表。S202: Acquire a list of service providers of the target service item from a preset database.
其中,服务商列表包括为目标服务项目提供服务能力的多个服务商,以及每个服务商的权重和序号;权重依据与服务商的服务质量关联的影响因素计算得到。The service provider list includes multiple service providers that provide service capabilities for the target service project, as well as the weight and sequence number of each service provider; the weight is calculated based on influencing factors associated with the service quality of the service provider.
S203:基于服务商列表中各个服务商的权重,确定目标服务商。S203: Determine a target service provider based on the weight of each service provider in the service provider list.
S204:将目标服务项目的流量,分配给目标服务商。S204: Allocate the traffic of the target service item to the target service provider.
综上所述,本实施例能够基于与服务商的服务质量关联的影响因素,确定服务商列表中各个服务商的权重,并依据各个服务商的权重,从服务商列表中筛选出目标服务商,作为目标服务项目的流量分配对象,相较于现有技术,目标服务商的选择更加客观,能够有效确保经由流量分配后客户端能够获得高质量的服务。To sum up, this embodiment can determine the weight of each service provider in the service provider list based on the influencing factors associated with the service quality of the service provider, and screen out the target service provider from the service provider list according to the weight of each service provider as the traffic allocation object of the target service project. Compared with the existing technology, the selection of the target service provider is more objective and can effectively ensure that the client can obtain high-quality service after traffic allocation.
与上述本申请实施例提供的流量分配方法相对应,本申请实施例还提供了一种流量分配装置。Corresponding to the flow distribution method provided in the above-mentioned embodiment of the present application, the embodiment of the present application also provides a flow distribution device.
如图3所示,为本申请实施例提供的一种流量分配装置的架构示意图,包括如下所示单元。As shown in FIG3 , it is a schematic diagram of the architecture of a flow distribution device provided in an embodiment of the present application, including the units shown below.
请求解析单元100,用于解析客户端发送的服务请求,得到目标服务项目。The request parsing unit 100 is used to parse the service request sent by the client to obtain the target service item.
可选的,请求解析单元100具体用于:将不同类型的客户端发送的一个或多个服务请求,保存到预设请求队列中,并记录每个服务请求的请求时间;按照请求时间由早到晚的顺序,依次解析预设请求队列中的各个服务请求,得到各个目标服务项目;对于每个目标服务项目,从预设数据库中获取目标服务项目的服务商列表。Optionally, the request parsing unit 100 is specifically used to: save one or more service requests sent by different types of clients into a preset request queue, and record the request time of each service request; parse each service request in the preset request queue in order of request time from early to late, and obtain each target service item; for each target service item, obtain a list of service providers for the target service item from a preset database.
列表获取单元200,用于从预设数据库中获取目标服务项目的服务商列表;服务商列表包括为目标服务项目提供服务能力的多个服务商,以及每个服务商的权重和序号;权重依据与服务商的服务质量关联的影响因素计算得到。The list acquisition unit 200 is used to obtain a service provider list of the target service project from a preset database; the service provider list includes multiple service providers that provide service capabilities for the target service project, as well as the weight and serial number of each service provider; the weight is calculated based on the influencing factors associated with the service quality of the service provider.
可选的,列表获取单元200具体用于:预先配置与服务商的服务质量关联的多个影响因素的基础信息;基础信息至少包括影响系数和影响指数;配置多个服务项目的服务商列表;服务商列表包括为服务项目提供服务能力的多个服务商、每个服务商的序号,以及与每个服务商关联的各个影响因素的取值;对于每个服务商列表,基于与服务商列表中每个服务商关联的各个影响因素的取值,以及与服务商列表中每个服务商关联的各个影响因素的影响系数和影响指数,计算得出服务商列表中每个服务商的权重。Optionally, the list acquisition unit 200 is specifically used to: pre-configure basic information of multiple influencing factors associated with the service quality of the service provider; the basic information at least includes an influencing coefficient and an influencing index; configure a list of service providers for multiple service items; the service provider list includes multiple service providers that provide service capabilities for the service items, the serial number of each service provider, and the values of each influencing factor associated with each service provider; for each service provider list, the weight of each service provider in the service provider list is calculated based on the values of each influencing factor associated with each service provider in the service provider list, and the influencing coefficient and influencing index of each influencing factor associated with each service provider in the service provider list.
服务商筛选单元300,用于基于服务商列表中各个服务商的权重,确定目标服务商。The service provider screening unit 300 is used to determine a target service provider based on the weight of each service provider in the service provider list.
可选的,服务商筛选单元300具体用于:基于服务商列表中各个服务商的权重,获得目标数值;初始化一个起始数变量;其中,起始数变量的初始值设为0;遍历服务商列表中的各个服务商,并在读取每个服务商时,调整起始数变量的取值,以使调整后的起始数变量的取值等于目标和值;目标和值包括:当前读取得到的服务商的权重和调整前的起始数变量的取值的和值;对于每次读取得到的服务商,判断调整后的起始数变量的取值是否不大于目标数值,且服务商的权重与调整后的起始数变量的取值的和值是否大于目标数值;在调整后的起始数变量的取值不大于目标数值,且服务商的权重与调整后的起始数变量的取值的和值大于目标数值的情况下,将当前读取得到的服务商,标识为目标服务商。Optionally, the service provider screening unit 300 is specifically used to: obtain a target value based on the weight of each service provider in the service provider list; initialize a starting number variable; wherein the initial value of the starting number variable is set to 0; traverse each service provider in the service provider list, and when reading each service provider, adjust the value of the starting number variable so that the value of the adjusted starting number variable is equal to the target sum value; the target sum value includes: the sum of the weight of the service provider currently read and the value of the starting number variable before adjustment; for each service provider read, determine whether the value of the adjusted starting number variable is not greater than the target value, and whether the sum of the service provider's weight and the value of the adjusted starting number variable is greater than the target value; when the value of the adjusted starting number variable is not greater than the target value, and the sum of the service provider's weight and the value of the adjusted starting number variable is greater than the target value, identify the currently read service provider as the target service provider.
服务商筛选单元300还用于:在调整后的起始数变量的取值大于目标数值,且服务商的权重与调整后的起始数变量的取值的和值不大于目标数值的情况下,将当前读取得到的服务商,标识为非目标服务商。The service provider screening unit 300 is also used to: when the value of the adjusted starting number variable is greater than the target value, and the sum of the service provider's weight and the value of the adjusted starting number variable is not greater than the target value, mark the currently read service provider as a non-target service provider.
服务商筛选单元300还用于:在读取服务商列表中的所有服务商之后,且并未获取得到目标服务商的情况下,将服务商列表中序号为首位的服务商,标识为目标服务商。The service provider screening unit 300 is further configured to: after reading all service providers in the service provider list and if the target service provider is not obtained, identify the service provider with the first serial number in the service provider list as the target service provider.
服务商筛选单元300具体用于:计算服务商列表中各个服务商的权重的总和,得到权重总值;基于权重总值作为区间上限,预设数值作为区间下限,生成随机数取值区间;从随机数取值区间中随机选取一个随机数,作为目标数值。The service provider screening unit 300 is specifically used for: calculating the sum of the weights of each service provider in the service provider list to obtain the total weight value; generating a random number value interval based on the total weight value as the upper limit of the interval and the preset value as the lower limit of the interval; and randomly selecting a random number from the random number value interval as the target value.
流量分配单元400,用于将目标服务项目的流量,分配给目标服务商。The traffic distribution unit 400 is used to distribute the traffic of the target service item to the target service provider.
综上所述,本实施例能够基于与服务商的服务质量关联的影响因素,确定服务商列表中各个服务商的权重,并依据各个服务商的权重,从服务商列表中筛选出目标服务商,作为目标服务项目的流量分配对象,相较于现有技术,目标服务商的选择更加客观,能够有效确保经由流量分配后客户端能够获得高质量的服务。To sum up, this embodiment can determine the weight of each service provider in the service provider list based on the influencing factors associated with the service quality of the service provider, and screen out the target service provider from the service provider list according to the weight of each service provider as the traffic allocation object of the target service project. Compared with the existing technology, the selection of the target service provider is more objective and can effectively ensure that the client can obtain high-quality service after traffic allocation.
本申请还提供了一种计算机可读存储介质,计算机可读存储介质包括存储的程序,其中,程序执行上述本申请提供的流量分配方法。The present application also provides a computer-readable storage medium, which includes a stored program, wherein the program executes the traffic distribution method provided by the present application.
本申请还提供了一种流量分配设备,包括:处理器、存储器和总线。处理器与存储器通过总线连接,存储器用于存储程序,处理器用于运行程序,其中,程序运行时执行上述本申请提供的流量分配方法,包括如下步骤:The present application also provides a traffic distribution device, including: a processor, a memory, and a bus. The processor and the memory are connected via a bus, the memory is used to store programs, and the processor is used to run programs, wherein when the program is running, the traffic distribution method provided by the present application is executed, including the following steps:
解析客户端发送的服务请求,得到目标服务项目;Parse the service request sent by the client and obtain the target service item;
从预设数据库中获取目标服务项目的服务商列表;所述服务商列表包括为所述目标服务项目提供服务能力的多个服务商,以及每个所述服务商的权重和序号;所述权重依据与所述服务商的服务质量关联的影响因素计算得到;Obtaining a list of service providers for the target service project from a preset database; the list of service providers includes multiple service providers that provide service capabilities for the target service project, as well as a weight and a sequence number of each of the service providers; the weight is calculated based on an influencing factor associated with the service quality of the service provider;
基于所述服务商列表中各个服务商的权重,确定目标服务商;Determining a target service provider based on the weight of each service provider in the service provider list;
将所述目标服务项目的流量,分配给所述目标服务商。Allocate the traffic of the target service item to the target service provider.
具体的,在上述实施例的基础上,所述解析客户端发送的服务请求,得到目标服务项目,包括:Specifically, based on the above embodiment, the parsing of the service request sent by the client to obtain the target service item includes:
将不同类型的客户端发送的一个或多个服务请求,保存到预设请求队列中,并记录每个所述服务请求的请求时间;One or more service requests sent by different types of clients are saved in a preset request queue, and the request time of each of the service requests is recorded;
按照请求时间由早到晚的顺序,依次解析所述预设请求队列中的各个服务请求,得到各个目标服务项目;According to the order of request time from earliest to latest, the service requests in the preset request queue are analyzed in sequence to obtain the target service items;
对于每个所述目标服务项目,从预设数据库中获取所述目标服务项目的服务商列表。For each of the target service items, a list of service providers of the target service item is obtained from a preset database.
具体的,在上述实施例的基础上,所述依据与所述服务商的服务质量关联的影响因素计算得到所述权重的过程,包括:Specifically, based on the above embodiment, the process of calculating the weight according to the influencing factors associated with the service quality of the service provider includes:
预先配置与所述服务商的服务质量关联的多个影响因素的基础信息;所述基础信息至少包括影响系数和影响指数;Pre-configuring basic information of multiple influencing factors associated with the service quality of the service provider; the basic information at least includes an influencing coefficient and an influencing index;
配置多个服务项目的服务商列表;所述服务商列表包括为所述服务项目提供服务能力的多个服务商、每个服务商的序号,以及与每个服务商关联的各个影响因素的取值;A service provider list for configuring multiple service items; the service provider list includes multiple service providers that provide service capabilities for the service items, a serial number of each service provider, and values of various influencing factors associated with each service provider;
对于每个所述服务商列表,基于与所述服务商列表中每个服务商关联的各个影响因素的取值,以及与所述服务商列表中每个服务商关联的各个影响因素的影响系数和影响指数,计算得出所述服务商列表中每个服务商的权重。For each of the service provider lists, the weight of each service provider in the service provider list is calculated based on the values of each influencing factor associated with each service provider in the service provider list, and the influence coefficient and influence index of each influencing factor associated with each service provider in the service provider list.
具体的,在上述实施例的基础上,所述基于所述服务商列表中各个服务商的权重,确定目标服务商,包括:Specifically, based on the above embodiment, determining the target service provider based on the weight of each service provider in the service provider list includes:
基于所述服务商列表中各个服务商的权重,获得目标数值;Obtaining a target value based on the weight of each service provider in the service provider list;
初始化一个起始数变量;其中,所述起始数变量的初始值设为0;Initialize a starting number variable; wherein the initial value of the starting number variable is set to 0;
遍历所述服务商列表中的各个服务商,并在读取每个服务商时,调整所述起始数变量的取值,以使调整后的起始数变量的取值等于目标和值;所述目标和值包括:当前读取得到的服务商的权重和调整前的起始数变量的取值的和值;Traversing each service provider in the service provider list, and adjusting the value of the starting number variable when reading each service provider, so that the adjusted value of the starting number variable is equal to the target sum value; the target sum value includes: the sum of the weight of the service provider currently read and the value of the starting number variable before adjustment;
对于每次读取得到的服务商,判断调整后的起始数变量的取值是否不大于所述目标数值,且所述服务商的权重与调整后的起始数变量的取值的和值是否大于所述目标数值;For each service provider read, determine whether the adjusted value of the starting number variable is not greater than the target value, and whether the sum of the weight of the service provider and the adjusted value of the starting number variable is greater than the target value;
在调整后的起始数变量的取值不大于所述目标数值,且所述服务商的权重与调整后的起始数变量的取值的和值大于所述目标数值的情况下,将当前读取得到的所述服务商,标识为目标服务商。When the value of the adjusted starting number variable is not greater than the target value, and the sum of the weight of the service provider and the value of the adjusted starting number variable is greater than the target value, the service provider currently read is identified as the target service provider.
具体的,在上述实施例的基础上,还包括:Specifically, based on the above embodiment, it also includes:
在调整后的起始数变量的取值大于所述目标数值,且所述服务商的权重与调整后的起始数变量的取值的和值不大于所述目标数值的情况下,将当前读取得到的所述服务商,标识为非目标服务商。When the value of the adjusted starting number variable is greater than the target value, and the sum of the weight of the service provider and the value of the adjusted starting number variable is not greater than the target value, the service provider currently read is identified as a non-target service provider.
具体的,在上述实施例的基础上,还包括:Specifically, based on the above embodiment, it also includes:
在读取所述服务商列表中的所有服务商之后,且并未获取得到所述目标服务商的情况下,将所述服务商列表中序号为首位的服务商,标识为所述目标服务商。After reading all the service providers in the service provider list, if the target service provider is not obtained, the service provider with the first serial number in the service provider list is identified as the target service provider.
具体的,在上述实施例的基础上,所述基于所述服务商列表中各个服务商的权重,获得目标数值,包括:Specifically, based on the above embodiment, the step of obtaining the target value based on the weight of each service provider in the service provider list includes:
计算所述服务商列表中各个所述服务商的权重的总和,得到权重总值;Calculate the sum of the weights of each service provider in the service provider list to obtain a total weight value;
基于所述权重总值作为区间上限,预设数值作为区间下限,生成随机数取值区间;Generate a random number value interval based on the total weight value as the interval upper limit and the preset value as the interval lower limit;
从所述随机数取值区间中随机选取一个随机数,作为目标数值。A random number is randomly selected from the random number value interval as the target value.
本申请实施例方法所述的功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算设备可读取存储介质中。基于这样的理解,本申请实施例对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一台计算设备(可以是个人计算机,服务器,移动计算设备或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。If the functions described in the method of the embodiment of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in a storage medium readable by a computing device. Based on this understanding, the part of the embodiment of the present application that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computing device (which can be a personal computer, server, mobile computing device or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories, random access memories, magnetic disks or optical disks.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本申请。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

  1. 一种流量分配方法,其特征在于,包括:A flow distribution method, characterized by comprising:
    解析客户端发送的服务请求,得到目标服务项目;Parse the service request sent by the client and obtain the target service item;
    从预设数据库中获取目标服务项目的服务商列表;所述服务商列表包括为所述目标服务项目提供服务能力的多个服务商,以及每个所述服务商的权重和序号;所述权重依据与所述服务商的服务质量关联的影响因素计算得到;Obtaining a list of service providers for the target service project from a preset database; the list of service providers includes multiple service providers that provide service capabilities for the target service project, as well as a weight and a sequence number of each of the service providers; the weight is calculated based on an influencing factor associated with the service quality of the service provider;
    基于所述服务商列表中各个服务商的权重,确定目标服务商;Determining a target service provider based on the weight of each service provider in the service provider list;
    将所述目标服务项目的流量,分配给所述目标服务商。Allocate the traffic of the target service item to the target service provider.
  2. 根据权利要求1所述的方法,其特征在于,所述解析客户端发送的服务请求,得到目标服务项目,包括:The method according to claim 1, characterized in that the step of parsing the service request sent by the client to obtain the target service item comprises:
    将不同类型的客户端发送的一个或多个服务请求,保存到预设请求队列中,并记录每个所述服务请求的请求时间;One or more service requests sent by different types of clients are saved in a preset request queue, and the request time of each of the service requests is recorded;
    按照请求时间由早到晚的顺序,依次解析所述预设请求队列中的各个服务请求,得到各个目标服务项目;According to the order of request time from earliest to latest, the service requests in the preset request queue are analyzed in sequence to obtain the target service items;
    对于每个所述目标服务项目,从预设数据库中获取所述目标服务项目的服务商列表。For each of the target service items, a list of service providers of the target service item is obtained from a preset database.
  3. 根据权利要求1所述的方法,其特征在于,所述依据与所述服务商的服务质量关联的影响因素计算得到所述权重的过程,包括:The method according to claim 1, characterized in that the process of calculating the weight according to the influencing factors associated with the service quality of the service provider comprises:
    预先配置与所述服务商的服务质量关联的多个影响因素的基础信息;所述基础信息至少包括影响系数和影响指数;Pre-configuring basic information of multiple influencing factors associated with the service quality of the service provider; the basic information at least includes an influencing coefficient and an influencing index;
    配置多个服务项目的服务商列表;所述服务商列表包括为所述服务项目提供服务能力的多个服务商、每个服务商的序号,以及与每个服务商关联的各个影响因素的取值;A service provider list for configuring multiple service items; the service provider list includes multiple service providers that provide service capabilities for the service items, a serial number of each service provider, and values of various influencing factors associated with each service provider;
    对于每个所述服务商列表,基于与所述服务商列表中每个服务商关联的各个影响因素的取值,以及与所述服务商列表中每个服务商关联的各个影响因素的影响系数和影响指数,计算得出所述服务商列表中每个服务商的权重。For each of the service provider lists, the weight of each service provider in the service provider list is calculated based on the values of each influencing factor associated with each service provider in the service provider list, and the influence coefficient and influence index of each influencing factor associated with each service provider in the service provider list.
  4. 根据权利要求1所述的方法,其特征在于,所述基于所述服务商列表中各个服务商的权重,确定目标服务商,包括:The method according to claim 1, characterized in that the step of determining the target service provider based on the weight of each service provider in the service provider list comprises:
    基于所述服务商列表中各个服务商的权重,获得目标数值;Obtaining a target value based on the weight of each service provider in the service provider list;
    初始化一个起始数变量;其中,所述起始数变量的初始值设为0;Initialize a starting number variable; wherein the initial value of the starting number variable is set to 0;
    遍历所述服务商列表中的各个服务商,并在读取每个服务商时,调整所述起始数变量的取值,以使调整后的起始数变量的取值等于目标和值;所述目标和值包括:当前读取得到的服务商的权重和调整前的起始数变量的取值的和值;Traversing each service provider in the service provider list, and adjusting the value of the starting number variable when reading each service provider, so that the adjusted value of the starting number variable is equal to the target sum value; the target sum value includes: the sum of the weight of the service provider currently read and the value of the starting number variable before adjustment;
    对于每次读取得到的服务商,判断调整后的起始数变量的取值是否不大于所述目标数值,且所述服务商的权重与调整后的起始数变量的取值的和值是否大于所述目标数值;For each service provider read, determine whether the adjusted value of the starting number variable is not greater than the target value, and whether the sum of the weight of the service provider and the adjusted value of the starting number variable is greater than the target value;
    在调整后的起始数变量的取值不大于所述目标数值,且所述服务商的权重与调整后的起始数变量的取值的和值大于所述目标数值的情况下,将当前读取得到的所述服务商,标识为目标服务商。When the value of the adjusted starting number variable is not greater than the target value, and the sum of the weight of the service provider and the value of the adjusted starting number variable is greater than the target value, the service provider currently read is identified as the target service provider.
  5. 根据权利要求4所述的方法,其特征在于,还包括:The method according to claim 4, further comprising:
    在调整后的起始数变量的取值大于所述目标数值,且所述服务商的权重与调整后的起始数变量的取值的和值不大于所述目标数值的情况下,将当前读取得到的所述服务商,标识为非目标服务商。When the value of the adjusted starting number variable is greater than the target value, and the sum of the weight of the service provider and the value of the adjusted starting number variable is not greater than the target value, the service provider currently read is identified as a non-target service provider.
  6. 根据权利要求4所述的方法,其特征在于,还包括:The method according to claim 4, further comprising:
    在读取所述服务商列表中的所有服务商之后,且并未获取得到所述目标服务商的情况下,将所述服务商列表中序号为首位的服务商,标识为所述目标服务商。After reading all the service providers in the service provider list, if the target service provider is not obtained, the service provider with the first serial number in the service provider list is identified as the target service provider.
  7. 根据权利要求4所述的方法,其特征在于,所述基于所述服务商列表中各个服务商的权重,获得目标数值,包括:The method according to claim 4, characterized in that obtaining the target value based on the weight of each service provider in the service provider list comprises:
    计算所述服务商列表中各个所述服务商的权重的总和,得到权重总值;Calculate the sum of the weights of each service provider in the service provider list to obtain a total weight value;
    基于所述权重总值作为区间上限,预设数值作为区间下限,生成随机数取值区间;Generate a random number value interval based on the total weight value as the interval upper limit and the preset value as the interval lower limit;
    从所述随机数取值区间中随机选取一个随机数,作为目标数值。A random number is randomly selected from the random number value interval as the target value.
  8. 一种流量分配装置,其特征在于,包括:A flow distribution device, characterized by comprising:
    请求解析单元,用于解析客户端发送的服务请求,得到目标服务项目;A request parsing unit, used to parse the service request sent by the client and obtain the target service item;
    列表获取单元,用于从预设数据库中获取目标服务项目的服务商列表;所述服务商列表包括为所述目标服务项目提供服务能力的多个服务商,以及每个 所述服务商的权重和序号;所述权重依据与所述服务商的服务质量关联的影响因素计算得到;a list acquisition unit, configured to acquire a list of service providers of a target service item from a preset database; the list of service providers includes a plurality of service providers that provide service capabilities for the target service item, and a weight and a sequence number of each of the service providers; the weight is calculated based on an influencing factor associated with the service quality of the service provider;
    服务商筛选单元,用于基于所述服务商列表中各个服务商的权重,确定目标服务商;A service provider screening unit, configured to determine a target service provider based on the weight of each service provider in the service provider list;
    流量分配单元,用于将所述目标服务项目的流量,分配给所述目标服务商。The traffic distribution unit is used to distribute the traffic of the target service item to the target service provider.
  9. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括存储的程序,其中,所述程序被处理器运行时执行权利要求1-7任一所述的流量分配方法。A computer-readable storage medium, characterized in that the computer-readable storage medium includes a stored program, wherein the program, when executed by a processor, executes the traffic distribution method described in any one of claims 1-7.
  10. 一种流量分配设备,其特征在于,包括:处理器、存储器和总线;所述处理器与所述存储器通过所述总线连接;A flow distribution device, characterized in that it comprises: a processor, a memory and a bus; the processor and the memory are connected via the bus;
    所述存储器用于存储程序,所述处理器用于运行程序,其中,所述程序被处理器运行时执行权利要求1-7任一所述的流量分配方法。The memory is used to store programs, and the processor is used to run programs, wherein the program, when run by the processor, executes the traffic distribution method according to any one of claims 1 to 7.
PCT/CN2022/138523 2022-10-18 2022-12-13 Traffic distribution method and apparatus, and storage medium and device WO2024082406A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211272986.9 2022-10-18
CN202211272986.9A CN115633001A (en) 2022-10-18 2022-10-18 Flow distribution method, device, storage medium and equipment

Publications (1)

Publication Number Publication Date
WO2024082406A1 true WO2024082406A1 (en) 2024-04-25

Family

ID=84906096

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/138523 WO2024082406A1 (en) 2022-10-18 2022-12-13 Traffic distribution method and apparatus, and storage medium and device

Country Status (2)

Country Link
CN (1) CN115633001A (en)
WO (1) WO2024082406A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190140920A1 (en) * 2017-01-22 2019-05-09 Huawei Technologies Co., Ltd. Scheduling Method for Content Delivery Network, and Device
CN113869718A (en) * 2021-09-26 2021-12-31 北京达佳互联信息技术有限公司 Virtual resource processing method, device, system, electronic equipment and storage medium
CN114430381A (en) * 2022-01-13 2022-05-03 上海聚音信息科技有限公司 Dynamic distribution method and device for service provider
CN115190441A (en) * 2022-08-15 2022-10-14 湖南快乐阳光互动娱乐传媒有限公司 Short message distribution method and device, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190140920A1 (en) * 2017-01-22 2019-05-09 Huawei Technologies Co., Ltd. Scheduling Method for Content Delivery Network, and Device
CN113869718A (en) * 2021-09-26 2021-12-31 北京达佳互联信息技术有限公司 Virtual resource processing method, device, system, electronic equipment and storage medium
CN114430381A (en) * 2022-01-13 2022-05-03 上海聚音信息科技有限公司 Dynamic distribution method and device for service provider
CN115190441A (en) * 2022-08-15 2022-10-14 湖南快乐阳光互动娱乐传媒有限公司 Short message distribution method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN115633001A (en) 2023-01-20

Similar Documents

Publication Publication Date Title
US11882242B2 (en) System and method for a work distribution service
US11093305B2 (en) System and method for managing concurrent events
CN109104336B (en) Service request processing method and device, computer equipment and storage medium
AU2017404110B2 (en) Agent allocation method and device, server, and storage medium
CN108881448B (en) API request processing method and device
US10430332B2 (en) System and method for performance tuning of garbage collection algorithms
WO2019019644A1 (en) Push server allocation method and apparatus, and computer device and storage medium
US9774654B2 (en) Service call graphs for website performance
US20200012602A1 (en) Cache allocation method, and apparatus
JP2015515664A (en) Method and apparatus for user recognition and information distribution
CN107888660B (en) Cloud service resource allocation method, medium, device and computing equipment
WO2018153256A1 (en) Method and apparatus for accelerating dynamic resource access, medium, and device
CN110516465B (en) Resource address management method, device, equipment and computer readable storage medium
US20220215008A1 (en) Dynamic model server for multi-model machine learning inference services
WO2018192403A1 (en) Method and apparatus for loading and optimizing bind configuration, medium, and computer device
CN113015116B (en) Dynamic quota method and device based on flow prediction
WO2019179043A1 (en) Voice message method and apparatus, computer device and storage medium
CN108234141B (en) Directional traffic processing method and server
CN113656178B (en) Data processing method, device, equipment and readable storage medium
WO2018214836A1 (en) Application identifier matching method, device, storage media and server
WO2024082406A1 (en) Traffic distribution method and apparatus, and storage medium and device
WO2021104100A1 (en) Url refreshing method, apparatus and device in cdn, and cdn node
TW201905669A (en) APP application display interface method, device and electronic device
CN114143263A (en) Method, device and medium for limiting current of user request
CN114466075B (en) Request processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22962582

Country of ref document: EP

Kind code of ref document: A1