CN117082151A - Calling method and device for multiple data sources and storage medium - Google Patents
Calling method and device for multiple data sources and storage medium Download PDFInfo
- Publication number
- CN117082151A CN117082151A CN202310953926.1A CN202310953926A CN117082151A CN 117082151 A CN117082151 A CN 117082151A CN 202310953926 A CN202310953926 A CN 202310953926A CN 117082151 A CN117082151 A CN 117082151A
- Authority
- CN
- China
- Prior art keywords
- data source
- product
- data sources
- data
- sources
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
- H04L67/63—Routing a service request depending on the request content or context
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
- H04L67/61—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources taking into account QoS or priority requirements
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (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
本申请提供了一种多数据源的调用方法、装置及存储介质。其中方法包括:获取产品服务请求中携带的请求参数信息,并确定满足产品服务请求的第一产品;获取第一产品在原始树样本中的路由信息,基于路由信息,确定第一产品的产品类型;在第一产品的产品类型为单一产品的情况下,获取该单一产品关联的多个数据源,并对多个数据源进行轮盘权重决策,确定各数据源的初始优先级;基于各数据源的初始优先级以及各数据源的相关调用信息,获取各数据源的选取概率;并基于多个数据源的选取概率调用目标数据源。能更好的综合数据源多个维度进行分析,从而选取出更优异的数据源进行服务调用,从一定程度上讲,节省了成本,提升了用户体验。
This application provides a method, device and storage medium for calling multiple data sources. The method includes: obtaining the request parameter information carried in the product service request, and determining the first product that satisfies the product service request; obtaining the routing information of the first product in the original tree sample, and determining the product type of the first product based on the routing information ; When the product type of the first product is a single product, obtain multiple data sources associated with the single product, make a roulette weight decision on the multiple data sources, and determine the initial priority of each data source; based on each data The initial priority of the source and the relevant calling information of each data source are obtained to obtain the selection probability of each data source; and the target data source is called based on the selection probability of multiple data sources. It can better integrate multiple dimensions of data sources for analysis, thereby selecting better data sources for service calls. To a certain extent, it saves costs and improves user experience.
Description
技术领域Technical Field
本申请涉及多数据源的调用技术领域,尤其涉及一种多数据源的调用方法、装置及存储介质。The present application relates to the technical field of calling multiple data sources, and in particular to a method, device and storage medium for calling multiple data sources.
背景技术Background Art
在一些多数据源的调用场景中,例如用户实名信息的鉴定场景,存在着诸多的方式,如人物信息三要素(姓名,身份证,电话号码),图片人物信息四要素(姓名,身份证,电话号码,人像图片信息),用户二要素(姓名,手机号)等等,对于服务提供方的服务端设备而言,同一种能力如人物信息三要素的鉴定数据来源有许多个,如市场上的电信公司,移动公司等。In some scenarios where multiple data sources are called, such as the authentication scenario of user real-name information, there are many ways, such as the three elements of personal information (name, ID card, phone number), the four elements of image personal information (name, ID card, phone number, portrait image information), the two elements of user (name, mobile phone number), etc. For the service provider's server-side equipment, there are many sources of authentication data for the same capability, such as the three elements of personal information, such as telecommunications companies and mobile companies in the market.
现有的技术方案是通过生成一个服务调用端口的形式提供实名认证服务,即“多对多”的形式,这种形式下,无法智能的选择价格,性能等更加优异的数据源,只能单一进行特定数据源的调用。The existing technical solution is to provide real-name authentication services by generating a service call port, that is, a "many-to-many" format. In this format, it is impossible to intelligently select a data source with better price, performance, etc., and only a single call to a specific data source can be made.
发明内容Summary of the invention
本申请提供了一种多数据源的调用方法、装置及系统,以实现多数据源的智能调用。本申请的技术方案如下:The present application provides a method, device and system for calling multiple data sources to realize intelligent calling of multiple data sources. The technical solution of the present application is as follows:
第一方面,本申请实施例提供了一种多数据源的调用方法,包括:In a first aspect, an embodiment of the present application provides a method for calling multiple data sources, including:
响应于产品服务请求,获取所述产品服务请求中携带的请求参数信息;并基于所述请求参数信息确定满足所述产品服务请求的第一产品;In response to a product service request, obtaining request parameter information carried in the product service request; and determining a first product that satisfies the product service request based on the request parameter information;
获取所述第一产品在原始树样本中的路由信息,并基于所述路由信息,确定所述第一产品的产品类型;其中,所述产品类型包括组合产品和单一产品;所述原始树样本是以服务、产品和数据源分别作为根节点、分支节点和叶节点构建的;所述组合产品的子节点为组合产品或单一产品,所述单一产品的子节点为数据源;Obtaining routing information of the first product in the original tree sample, and determining the product type of the first product based on the routing information; wherein the product type includes a combination product and a single product; the original tree sample is constructed with services, products and data sources as root nodes, branch nodes and leaf nodes respectively; the child nodes of the combination product are combination products or single products, and the child nodes of the single product are data sources;
在所述第一产品的产品类型为组成产品的情况下,逐个寻址所述第一产品在所述原始树样本中关联的单一产品,针对该单一产品进行如下步骤操作,直到所述产品服务请求响应结束;In the case where the product type of the first product is a component product, addressing the single products associated with the first product in the original tree sample one by one, and performing the following steps on the single products until the product service request response ends;
获取该单一产品关联的多个数据源,并对所述多个数据源进行轮盘权重决策,确定所述多个数据源中各数据源的初始优先级;Acquire multiple data sources associated with the single product, and perform a roulette weight decision on the multiple data sources to determine an initial priority of each of the multiple data sources;
基于所述多个数据源中各数据源的初始优先级以及所述各数据源的相关调用信息,获取所述各数据源的选取概率;并基于所述多个数据源的选取概率,确定并调用所述多个数据源中的目标数据源。Based on the initial priority of each data source among the multiple data sources and the relevant calling information of each data source, the selection probability of each data source is obtained; and based on the selection probability of the multiple data sources, the target data source among the multiple data sources is determined and called.
在一些实现方式中,所述方法还包括:In some implementations, the method further includes:
在所述第一产品的产品类型为单一产品的情况下,获取该单一产品关联的多个数据源;并对所述多个数据源进行轮盘权重决策,确定所述多个数据源中各数据源的初始优先级;In the case where the product type of the first product is a single product, multiple data sources associated with the single product are obtained; and a roulette weight decision is performed on the multiple data sources to determine an initial priority of each of the multiple data sources;
基于所述多个数据源中各数据源的初始优先级以及所述各数据源的相关调用信息,获取所述各数据源的选取概率;并基于所述多个数据源的选取概率,确定并调用所述多个数据源中的目标数据源。Based on the initial priority of each data source among the multiple data sources and the relevant calling information of each data source, the selection probability of each data source is obtained; and based on the selection probability of the multiple data sources, the target data source among the multiple data sources is determined and called.
在一些实现方式中,所述对所述多个数据源进行轮盘权重决策,确定所述多个数据源中各数据源的初始优先级,包括:In some implementations, performing a roulette wheel weight decision on the multiple data sources to determine an initial priority of each of the multiple data sources includes:
针对所述多个数据源中的每个数据源,计算所述每个数据源的轮盘权重;For each data source among the plurality of data sources, calculating a roulette weight of each data source;
基于所述多个数据源的轮盘权重,获取所述每个数据源的轮盘权重占比;Based on the roulette weights of the multiple data sources, obtaining the roulette weight ratio of each data source;
基于所述轮盘权重占比和预设轮盘机制,确定所述每个数据源的轮盘区域;Determine the roulette area of each data source based on the roulette weight ratio and the preset roulette mechanism;
基于所述预设轮盘机制随机生成一个自然数,并确定所述自然数在所述预设轮盘机制中所处的轮盘区域;Randomly generate a natural number based on the preset roulette mechanism, and determine the roulette area where the natural number is located in the preset roulette mechanism;
基于所述自然数所处的轮盘区域,确定所述多个数据源中各数据源的初始优先级。Based on the roulette area where the natural number is located, an initial priority of each of the multiple data sources is determined.
在一些实现方式中,所述计算所述每个数据源的轮盘权重,包括:In some implementations, calculating the roulette weight of each data source includes:
基于所述每个数据源的价格和调用时延,计算所述每个数据源的轮盘权重。Based on the price and call latency of each data source, a roulette weight of each data source is calculated.
在一些实现方式中,所述确定并调用所述多个数据源中的目标数据源之后,还包括:In some implementations, after determining and calling a target data source among the multiple data sources, the method further includes:
判断所述目标数据源是否调用成功;Determine whether the target data source is successfully called;
在所述目标数据源调用不成功的情况下,计算所述多个数据源中除目标数据源之外的各替代数据源的选取概率;In the case that the target data source is not successfully called, calculating the selection probability of each alternative data source among the multiple data sources except the target data source;
基于所述各替代数据源的选取概率,确定并调用新的目标数据源。Based on the selection probabilities of the alternative data sources, a new target data source is determined and called.
在一些实现方式中,所述计算所述多个数据源中除目标数据源之外的各数据源的选取概率,包括:In some implementations, calculating the selection probability of each data source other than the target data source among the multiple data sources includes:
基于预设数据源选取规则,计算所述多个数据源中除目标数据源之外的各数据源的选取概率。Based on the preset data source selection rule, the selection probability of each data source among the multiple data sources except the target data source is calculated.
在一些实现方式中,所述基于所述多个数据源中各数据源的初始优先级以及所述各数据源的相关调用信息,获取所述各数据源的选取概率,包括:In some implementations, the acquiring the selection probability of each data source based on the initial priority of each data source among the multiple data sources and the related call information of each data source includes:
基于所述多个数据源中各数据源的初始优先级、所述各数据源与所述第一产品之间的信息素以及所述各数据源的调用时延,获取所述各数据源的选取概率。Based on the initial priority of each data source among the multiple data sources, the pheromone between each data source and the first product, and the call delay of each data source, the selection probability of each data source is obtained.
在一些实现方式中,所述获取该单一产品关联的多个数据源之后,还包括:In some implementations, after obtaining the multiple data sources associated with the single product, the method further includes:
基于数据源黑名单,对所述多个数据源进行筛选,得到适用于所述第一产品的多个数据源。Based on the data source blacklist, the multiple data sources are screened to obtain multiple data sources suitable for the first product.
第二方面,本申请实施例提供了一种多数据源的调用装置,包括:In a second aspect, an embodiment of the present application provides a device for calling multiple data sources, including:
数据解析模块,用于响应于产品服务请求,获取所述产品服务请求中携带的请求参数信息;并基于所述请求参数信息确定满足所述产品服务请求的第一产品;A data parsing module, configured to obtain, in response to a product service request, request parameter information carried in the product service request; and determine, based on the request parameter information, a first product that satisfies the product service request;
产品类型确定模块,用于获取所述第一产品在原始树样本中的路由信息,并基于所述路由信息,确定所述第一产品的产品类型;其中,所述产品类型包括组合产品和单一产品;所述原始树样本是以服务、产品和数据源分别作为根节点、分支节点和叶节点构建的;所述组合产品的子节点为组合产品或单一产品,所述单一产品的子节点为数据源;a product type determination module, configured to obtain routing information of the first product in the original tree sample, and determine the product type of the first product based on the routing information; wherein the product types include combined products and single products; the original tree sample is constructed with services, products and data sources as root nodes, branch nodes and leaf nodes respectively; the child nodes of the combined product are combined products or single products, and the child nodes of the single product are data sources;
流程控制模块,用于在所述第一产品的产品类型为组成产品的情况下,逐个寻址所述第一产品在所述原始树样本中关联的单一产品,针对该单一产品进行如下步骤操作,直到所述产品服务请求响应结束;a process control module, for, when the product type of the first product is a component product, addressing the single product associated with the first product in the original tree sample one by one, and performing the following steps on the single product until the product service request response is completed;
轮盘决策模块,用于获取该单一产品关联的多个数据源,并对所述多个数据源进行轮盘权重决策,确定所述多个数据源中各数据源的初始优先级;A roulette decision module, used to obtain multiple data sources associated with the single product, and perform a roulette weight decision on the multiple data sources to determine the initial priority of each data source in the multiple data sources;
目标确定模块,用于基于所述多个数据源中各数据源的初始优先级以及所述各数据源的相关调用信息,获取所述各数据源的选取概率;并基于所述多个数据源的选取概率,确定并调用所述多个数据源中的目标数据源。A target determination module is used to obtain the selection probability of each data source among the multiple data sources based on the initial priority of each data source and the relevant calling information of each data source; and based on the selection probability of the multiple data sources, determine and call the target data source among the multiple data sources.
在一些实现方式中,轮盘决策模块,还用于:In some implementations, the roulette decision module is further configured to:
在所述第一产品的产品类型为单一产品的情况下,获取该单一产品关联的多个数据源;并对所述多个数据源进行轮盘权重决策,确定所述多个数据源中各数据源的初始优先级;In the case where the product type of the first product is a single product, multiple data sources associated with the single product are obtained; and a roulette weight decision is performed on the multiple data sources to determine an initial priority of each of the multiple data sources;
目标确定模块,用于基于所述多个数据源中各数据源的初始优先级以及所述各数据源的相关调用信息,获取所述各数据源的选取概率;并基于所述多个数据源的选取概率,确定并调用所述多个数据源中的目标数据源。A target determination module is used to obtain the selection probability of each data source among the multiple data sources based on the initial priority of each data source and the relevant calling information of each data source; and based on the selection probability of the multiple data sources, determine and call the target data source among the multiple data sources.
在一些实现方式中,轮盘决策模块,具体用于:In some implementations, the roulette decision module is specifically configured to:
针对所述多个数据源中的每个数据源,计算所述每个数据源的轮盘权重;For each data source among the plurality of data sources, calculating a roulette weight of each data source;
基于所述多个数据源的轮盘权重,获取所述每个数据源的轮盘权重占比;Based on the roulette weights of the multiple data sources, obtaining the roulette weight ratio of each data source;
基于所述轮盘权重占比和预设轮盘机制,确定所述每个数据源的轮盘区域;Determine the roulette area of each data source based on the roulette weight ratio and the preset roulette mechanism;
基于所述预设轮盘机制随机生成一个自然数,并确定所述自然数在所述预设轮盘机制中所处的轮盘区域;Randomly generate a natural number based on the preset roulette mechanism, and determine the roulette area where the natural number is located in the preset roulette mechanism;
基于所述自然数所处的轮盘区域,确定所述多个数据源中各数据源的初始优先级。Based on the roulette area where the natural number is located, an initial priority of each of the multiple data sources is determined.
在一些实现方式中,轮盘决策模块在计算所述每个数据源的轮盘权重时,用于:In some implementations, the roulette decision module, when calculating the roulette weight of each data source, is used to:
基于所述每个数据源的价格和调用时延,计算所述每个数据源的轮盘权重。Based on the price and call latency of each data source, a roulette weight of each data source is calculated.
在一些实现方式中,所述装置还包括:In some implementations, the apparatus further includes:
结果判断模块,用于判断所述目标数据源是否调用成功;A result judgment module is used to judge whether the target data source is successfully called;
替代计算模块,用于在所述目标数据源调用不成功的情况下,计算所述多个数据源中除目标数据源之外的各替代数据源的选取概率;并基于所述各替代数据源的选取概率,确定并调用新的目标数据源。The alternative calculation module is used to calculate the selection probability of each alternative data source other than the target data source among the multiple data sources when the target data source is not successfully called; and determine and call a new target data source based on the selection probability of each alternative data source.
在一些实现方式中,替代计算模块在计算所述多个数据源中除目标数据源之外的各数据源的选取概率时,具体用于:In some implementations, when calculating the selection probability of each data source other than the target data source among the multiple data sources, the alternative calculation module is specifically configured to:
基于预设数据源选取规则,计算所述多个数据源中除目标数据源之外的各数据源的选取概率。Based on the preset data source selection rule, the selection probability of each data source among the multiple data sources except the target data source is calculated.
在一些实现方式中,目标确定模块在基于所述多个数据源中各数据源的初始优先级以及所述各数据源的相关调用信息,获取所述各数据源的选取概率时,用于:In some implementations, when the target determination module obtains the selection probability of each data source based on the initial priority of each data source among the multiple data sources and the relevant call information of each data source, it is used to:
基于所述多个数据源中各数据源的初始优先级、所述各数据源与所述第一产品之间的信息素以及所述各数据源的调用时延,获取所述各数据源的选取概率。Based on the initial priority of each data source among the multiple data sources, the pheromone between each data source and the first product, and the call delay of each data source, the selection probability of each data source is obtained.
在一些实现方式中,轮盘决策模块在获取该单一产品关联的多个数据源之后,还用于:In some implementations, after obtaining multiple data sources associated with the single product, the roulette decision module is further configured to:
基于数据源黑名单,对所述多个数据源进行筛选,得到适用于所述第一产品的多个数据源。Based on the data source blacklist, the multiple data sources are screened to obtain multiple data sources suitable for the first product.
第三方面,本申请实施例提供了一种电子设备,包括:至少一个处理器;以及与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行本申请第一方面实施例所述的多数据源的调用方法。In a third aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the calling method of multiple data sources described in the embodiment of the first aspect of the present application.
第四方面,本申请实施例提供了一种存储有计算机指令的非瞬时计算机可读存储介质,所述计算机指令用于使所述计算机执行本申请第一方面实施例所述的多数据源的调用方法。In a fourth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the method for calling multiple data sources described in the embodiment of the first aspect of the present application.
第五方面,本申请实施例提供了一种计算机程序产品,包括计算机指令,该计算机指令被处理器执行时实现本申请第一方面实施例所述的多数据源的调用方法的步骤。In a fifth aspect, an embodiment of the present application provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the method for calling multiple data sources described in the embodiment of the first aspect of the present application.
本申请实施例提供的技术方案至少带来以下有益效果:The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:
基于组合产品、单一产品以及数据源构建原始树样本,在数据源的路由信息基础上通过添加轮盘权重、优先级等属性形成决策树样本,基于决策树样本实现数据源的择优选择。在决策树形成的过程中,基于数据源的性能,价格等综合因素得到数据源的轮盘权重,在基于轮盘权重确定数据源的初始优先级,之后结合数据源的其他调用相关因素得到数据源的最终优先级,基于最终优先级实现多维度的数据源的择优调用。基于决策树能更好的综合数据源多个维度进行分析,从而选取出更优异的数据源进行服务调用,从一定程度上讲,节省了成本,提升了用户体验。The original tree samples are constructed based on the combination products, single products and data sources. The decision tree samples are formed by adding attributes such as roulette weights and priorities based on the routing information of the data source. The data source is selected based on the decision tree samples. In the process of forming the decision tree, the roulette weights of the data source are obtained based on comprehensive factors such as the performance and price of the data source. The initial priority of the data source is determined based on the roulette weights. Then, the final priority of the data source is obtained in combination with other call-related factors of the data source. The optimal call of the multi-dimensional data source is realized based on the final priority. Based on the decision tree, the multiple dimensions of the data source can be better analyzed comprehensively, so as to select a better data source for service call. To a certain extent, it saves costs and improves user experience.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理,并不构成对本申请的不当限定。The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application, and do not constitute improper limitations on the present application.
图1是根据一示例性实施例示出的一种多数据源的调用方法的流程图。Fig. 1 is a flow chart showing a method for calling multiple data sources according to an exemplary embodiment.
图2是根据一示例性实施例示出的原始树样本的示意图。Fig. 2 is a schematic diagram showing an original tree sample according to an exemplary embodiment.
图3是根据另一示例性实施例示出的一种多数据源的调用方法的流程图。Fig. 3 is a flow chart showing a method for calling multiple data sources according to another exemplary embodiment.
图4是根据又一示例性实施例示出的一种多数据源的调用方法的流程图。Fig. 4 is a flow chart showing a method for calling multiple data sources according to yet another exemplary embodiment.
图5是根据又一示例性实施例示出的一种多数据源的调用方法的流程图。Fig. 5 is a flowchart showing a method for calling multiple data sources according to yet another exemplary embodiment.
图6是根据一示例性实施例示出的一种多数据源的调用装置的框图。Fig. 6 is a block diagram showing a device for calling multiple data sources according to an exemplary embodiment.
图7是根据一示例性实施例示出的一种电子设备的框图。Fig. 7 is a block diagram of an electronic device according to an exemplary embodiment.
具体实施方式DETAILED DESCRIPTION
为了使本领域普通人员更好地理解本申请的技术方案,下面将结合附图,对本申请实施例中的技术方案进行清楚、完整地描述。In order to enable ordinary persons in the art to better understand the technical solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
需要说明的是,本申请中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请实施例能够以除了在这里图示或描述的那些以外的顺序实施。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。It should be noted that the terms "first", "second", etc. in this application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the application described here can be implemented in an order other than those illustrated or described here. The implementation methods described in the following exemplary embodiments do not represent all implementation methods consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
实名认证服务为通过人物信息比对校验,为外部应用注册登录提供安全可靠的用户信息维护服务。实名认证服务存在着两个场景。The real-name authentication service provides a secure and reliable user information maintenance service for external application registration and login through character information comparison and verification. There are two scenarios for the real-name authentication service.
场景1,一种能力关联多种能力,如:图片人物信息四要素是由人物信息三要素(姓名,身份证,电话号码),图像信息三要素(姓名,身份证,图像)等组成的。先从人物信息三要素认证成功后,再取图像信息,姓名,身份证信息进行图像三要素校验,综合两个结果再进行返回。Scenario 1: One capability is associated with multiple capabilities. For example, the four elements of the person information in the picture are composed of the three elements of the person information (name, ID card, phone number) and the three elements of the image information (name, ID card, image). After the three elements of the person information are successfully authenticated, the image information, name, and ID card information are taken to verify the three elements of the image, and the two results are combined and returned.
场景2,一种能力关联多个数据源,如人物信息三要素(姓名,身份证,电话号码)可由例如电信号码数据库,移动号码数据库,联通号码数据库等多个认证数据库组成,根据价格性能等综合因素可以对他们进行决策,优先级高的进行优先调用,调用失败后再进行依次进行调用。Scenario 2: A capability is associated with multiple data sources. For example, the three elements of personal information (name, ID card, and phone number) can be composed of multiple authentication databases such as the telecommunications number database, the mobile number database, and the Unicom number database. Decisions can be made based on comprehensive factors such as price and performance. The ones with higher priority will be called first, and if the call fails, they will be called in sequence.
针对以上两个场景,可以细分出以下的相关维度。For the above two scenarios, the following relevant dimensions can be subdivided.
产品维度:实名认证可以分为众多的产品,其中,如运营商三要素(手机+姓名+身份证),人像三要素(姓名+身份证+人像),运营商二要素(手机+姓名),身份二要素(身份证+姓名),运营商四要素(手机+姓名+身份证+人像)等等,产品的维度多代表能力多,消费的时候,能力值必须得到申请,才能进行计费和结算。Product dimension: Real-name authentication can be divided into many products, including three elements of operators (mobile phone + name + ID card), three elements of portrait (name + ID card + portrait), two elements of operators (mobile phone + name), two elements of identity (ID card + name), four elements of operators (mobile phone + name + ID card + portrait), etc. The more dimensions of a product, the more capabilities it represents. When consuming, the capability value must be applied for before billing and settlement can be carried out.
数据源维度:同样的道理,一个产品包括一个系列的数据源,比如,人物信息三要素就可以有多个数据源组成,每个数据源都属于一个单独的个体;如果说产品是一个连,那数据源就是连队里面的士兵。Data source dimension: In the same way, a product includes a series of data sources. For example, the three elements of character information can be composed of multiple data sources, and each data source belongs to a separate individual. If the product is a company, then the data source is the soldiers in the company.
数据源方公司维度(影响较小):每个公司都有提供不同能力的数据源,为了能对其进行结算,也需要把他们统一管理起来。Data source company dimension (small impact): Each company has data sources with different capabilities. In order to settle them, they also need to be managed in a unified manner.
针对以上的现状,首先要面对的技术问题是,不同维度下的场景存在调用困难的情况,首先要面临的问题是:多对多,面对一种产品维度就开通一个调用的服务接口,当产品维度数量过多时,开通的服务调用端口也随之增多,这样大大提升了人工成本,同时也不方便整个服务系统的维护,浪费大部分的人工资源,增加了监控的成本,不利于问题的排查。In view of the above situation, the first technical problem we need to face is that it is difficult to call scenarios under different dimensions. The first problem we need to face is: many-to-many. For each product dimension, a calling service interface is opened. When the number of product dimensions is too large, the number of opened service calling ports also increases. This greatly increases the labor cost, and it is also inconvenient to maintain the entire service system, wastes most of the labor resources, increases the monitoring cost, and is not conducive to problem troubleshooting.
为了解决上述问题,本申请实施例提供了一种多数据源的调用方法,以从多个维度综合选取合适的数据源进行调用。In order to solve the above problems, an embodiment of the present application provides a method for calling multiple data sources, so as to comprehensively select appropriate data sources from multiple dimensions for calling.
图1是根据本申请一个实施例的多数据源的调用方法的流程图。需要说明的是,本申请实施例的多数据源的调用方法可应用于本申请实施例的多数据源的调用装置。该多数据源的调用装置可被配置于电子设备上。如图1所示,该多数据源的调用方法可以包括如下步骤。FIG1 is a flow chart of a method for calling multiple data sources according to an embodiment of the present application. It should be noted that the method for calling multiple data sources according to an embodiment of the present application can be applied to a device for calling multiple data sources according to an embodiment of the present application. The device for calling multiple data sources can be configured on an electronic device. As shown in FIG1 , the method for calling multiple data sources can include the following steps.
在步骤S101中,响应于产品服务请求,获取产品服务请求中携带的请求参数信息;并基于请求参数信息确定满足产品服务请求的第一产品。In step S101, in response to a product service request, request parameter information carried in the product service request is obtained; and a first product satisfying the product service request is determined based on the request parameter information.
作为一个示例,用户将携带请求参数信息的产品服务请求(如实名认证请求)传入到预设数据源调用系统,预设数据源调用系统进行请求参数信息解析,得到产品信息为第一产品,第一产品例如为运营商四要素,并将产品信息提交路由系统,路由系统的功能介绍详见下面步骤。As an example, a user transmits a product service request (such as a real-name authentication request) carrying request parameter information to the preset data source calling system. The preset data source calling system parses the request parameter information and obtains product information as the first product, such as the four elements of the operator, and submits the product information to the routing system. The functions of the routing system are described in detail in the following steps.
在步骤S102中,获取第一产品在原始树样本中的路由信息,并基于路由信息,确定第一产品的产品类型;其中,产品类型包括组合产品和单一产品;原始树样本是以服务、产品和数据源分别作为根节点、分支节点和叶节点构建的;组合产品的子节点为组合产品或单一产品,单一产品的子节点为数据源。In step S102, the routing information of the first product in the original tree sample is obtained, and based on the routing information, the product type of the first product is determined; wherein the product type includes a combination product and a single product; the original tree sample is constructed with services, products and data sources as root nodes, branch nodes and leaf nodes respectively; the child nodes of the combination product are the combination product or the single product, and the child nodes of the single product are the data sources.
需要说明的是,本实施例根据业务需求将产品细分为组合产品和单一产品,以服务、产品和数据源分别作为根节点、分支节点和叶节点构建原始树样本,原始树样本需要预先构建。一种实现方式,为组合产品、单一产品、数据源样本均配置路由信息,形成原始树样本,如图2所示。根节点为服务,例如实名认证服务。其中,原始树样本的分支节点为产品,产品可以为组合产品或者单一产品,组合产品下面的子节点可为组合产品或单一产品,单一产品的子节点是叶节点,叶节点对应数据源。每个单一产品可能对应多个数据源。每个组合产品可能向下拆分出多个单一产品。It should be noted that this embodiment subdivides products into combination products and single products according to business needs, and constructs the original tree sample with services, products and data sources as root nodes, branch nodes and leaf nodes respectively. The original tree sample needs to be constructed in advance. In one implementation method, routing information is configured for combination products, single products, and data source samples to form an original tree sample, as shown in Figure 2. The root node is a service, such as a real-name authentication service. Among them, the branch node of the original tree sample is a product, and the product can be a combination product or a single product. The child node under the combination product can be a combination product or a single product. The child node of the single product is a leaf node, and the leaf node corresponds to the data source. Each single product may correspond to multiple data sources. Each combination product may be split into multiple single products.
例如,运营商四要素为组合产品,包括两个子节点均为单一产品,分别为包括运营商三要素和人像三要素,其中,运营商三要素和人像三要素均包括多个数据源。For example, the four elements of an operator are a combination product, including two sub-nodes that are single products, namely the three elements of an operator and the three elements of a portrait. The three elements of an operator and the three elements of a portrait both include multiple data sources.
作为一种实现方式,为原始树样本中的每个数据源配置标签编号;其中,为数据源配置标签编号主要是为了方便管理数据源。例如,可以配置为:数据源1,数据源2,数据源3等。同时也能方便在后续工作中,能跟据相关的标签编号添加轮盘权重属性。As an implementation method, a label number is configured for each data source in the original tree sample; wherein, the label number is configured for the data source mainly to facilitate the management of the data source. For example, it can be configured as: data source 1, data source 2, data source 3, etc. At the same time, it is also convenient to add roulette weight attributes according to the relevant label number in subsequent work.
单一产品拆分:单一产品为分支节点,由数据源构成其叶子节点;组合产品可以由单一产品构成,也可以由组合产品构成,也可以由单一和组合产品构成。Single product splitting: A single product is a branch node, and its leaf nodes are composed of data sources; a combination product can be composed of a single product, a combination of products, or a single and combination of products.
在上面步骤确定满足产品服务请求的第一产品之后,可以查询第一产品在原始树样本中的路由信息,例如根据路由配置信息表查询第一产品的路由信息,获取第一产品的路由信息。After determining the first product that meets the product service request in the above step, the routing information of the first product in the original tree sample can be queried, for example, the routing information of the first product can be queried according to the routing configuration information table to obtain the routing information of the first product.
作为一种实现方式,由路由系统配置产品及数据源的树状路由信息,并在后续处理过程中,在路由信息的基础上添加轮盘权重、优先级、黑白名单等属性信息形成决策树。以及由路由系统实现各产品的路由挖掘即拆分。As an implementation method, the routing system configures the tree-like routing information of products and data sources, and in the subsequent processing, adds attribute information such as wheel weight, priority, blacklist and whitelist to the routing information to form a decision tree. The routing system also implements routing mining, i.e. splitting, for each product.
在步骤S103中,在第一产品的产品类型为组成产品的情况下,逐个寻址第一产品在原始树样本中关联的单一产品,针对该单一产品进行如下步骤操作,直到产品服务请求响应结束。In step S103, when the product type of the first product is a component product, single products associated with the first product in the original tree sample are addressed one by one, and the following steps are performed for the single product until the product service request response is completed.
第一产品可能为组合产品或者为单一产品。若为单一产品,则进行单一产品拆分,分解出适用于本次产品服务请求的多个数据源,进入后续多个数据源的择优选择调用。The first product may be a combination product or a single product. If it is a single product, the single product is split to decompose multiple data sources applicable to this product service request, and then the subsequent multiple data sources are selected and called.
若为组合产品,进行组合产品拆分,进行路由数据挖掘,挖掘组合产品的子节点以及下一级子节点,直至拆分到单一产品。即对组合产品使用递归算法进行轮询处理每个单一产品。也就是,通过层层拆分逐个得到组合产品下面的单一产品;在进行单一产品拆分,得到数据源。例如,组合产品包括3个子节点,3个子节点均为单一产品,则逐个对该3个单一产品进行拆分,得到数据源并进行后续处理。If it is a combination product, the combination product is split, and routing data mining is performed to mine the subnodes of the combination product and the next-level subnodes until it is split into a single product. That is, a recursive algorithm is used to poll each single product of the combination product. In other words, the single products under the combination product are obtained one by one through layer-by-layer splitting; the single product is split to obtain the data source. For example, if the combination product includes 3 subnodes, and all 3 subnodes are single products, the 3 single products are split one by one to obtain the data source and perform subsequent processing.
以实名认证服务为例,产品服务请求响应结束的一种情况是,该用户的多个用户信息校验完毕,认证成功,即对应组合产品下关联的多个单一产品的每个单一产品的数据源逐个进行后续处理后调用成功,流程结束,或者路由系统判断流程结束。产品服务请求响应结束的另一种情况是,认证失败,例如在手机号校验时,校验失败,则不进行下面的图像校验流程,流程结束。Taking the real-name authentication service as an example, one case where the product service request response ends is that the user's multiple user information is verified and the authentication is successful, that is, the data source of each single product associated with the corresponding combination product is successfully called after subsequent processing, and the process ends, or the routing system determines that the process ends. Another case where the product service request response ends is that the authentication fails. For example, when verifying the mobile phone number, if the verification fails, the following image verification process will not be performed and the process ends.
在步骤S104中,获取该单一产品关联的多个数据源,并对多个数据源进行轮盘权重决策,确定多个数据源中各数据源的初始优先级。In step S104, multiple data sources associated with the single product are obtained, and a roulette wheel weight decision is performed on the multiple data sources to determine the initial priority of each of the multiple data sources.
需要说明的是,在数据源的使用过程中,可能存在数据源使用到期、数据源提供方提高价格等诸多情况,这些情况发生后,对应的数据源将可能不能被调用,因此,在进行数据源选择之前,需要先将不能调用的数据源去掉。It should be noted that during the use of data sources, there may be many situations such as the data source expiring or the data source provider raising prices. After these situations occur, the corresponding data source may not be called. Therefore, before selecting a data source, you need to remove the data source that cannot be called.
作为一种实现方式,可以通过设置数据源黑名单和/或数据源白名单的形式,并实时对数据源黑名单和/或数据源白名单进行更新,以确保进行后续处理的数据源均为当前可以调用的数据源。例如,可以将数据源属于白名单和/或黑名单的情况作为数据源的一个属性值,添加到数据源的路由配置信息中。As an implementation method, a data source blacklist and/or a data source whitelist may be set and updated in real time to ensure that the data sources for subsequent processing are all currently available data sources. For example, the fact that a data source belongs to a whitelist and/or a blacklist may be used as an attribute value of the data source and added to the routing configuration information of the data source.
可选的,基于数据源黑名单,对多个数据源进行筛选,得到适用于第一产品的多个数据源。Optionally, based on the data source blacklist, multiple data sources are screened to obtain multiple data sources suitable for the first product.
对于黑名单和/或白名单的选择,作为一个示例,可以根据数据源的使用是否到期,使用价格是否发生变动等信息确定数据源的黑名单和白名单。若数据源未到合同签约期,则可以列入白名单中,意为可使用状态。或者,若合同正常,在后续规划中也是计划使用的,则将其规划至白名单;再或者,若数据源已过合同签约期(也即继续调用会违约的情况),则可以将该数据源列入黑名单中,禁止调用。再或者,若数据源的使用价格短期上涨,不符合预期的成本等因素,可以归入到黑名单中。As for the selection of blacklist and/or whitelist, as an example, the blacklist and whitelist of data sources can be determined based on information such as whether the use of the data source has expired and whether the price of use has changed. If the data source has not reached the contract signing period, it can be included in the whitelist, which means it can be used. Alternatively, if the contract is normal and it is planned to be used in subsequent plans, it will be planned to be included in the whitelist; alternatively, if the data source has passed the contract signing period (that is, if it continues to be called, it will be in breach of contract), the data source can be included in the blacklist and the call is prohibited. Alternatively, if the price of the use of the data source rises in the short term and does not meet expected costs and other factors, it can be included in the blacklist.
在原始树样本的数据源的路由信息基础上可以通过添加轮盘权重、优先级等属性形成决策树样本,以便基于决策树样本实现数据源的择优选择。Based on the routing information of the data source of the original tree sample, a decision tree sample can be formed by adding attributes such as roulette weight and priority, so as to realize the optimal selection of the data source based on the decision tree sample.
在通过黑名单和/或白名单对多个数据源进行筛选之后,确定各数据源的初始优先级。After screening multiple data sources through the blacklist and/or whitelist, an initial priority of each data source is determined.
作为一种实现方式,确定多个数据源中各数据源的初始优先级的实现方式,包括:As an implementation manner, an implementation manner of determining an initial priority of each of the multiple data sources includes:
S201,针对多个数据源中的每个数据源,计算每个数据源的轮盘权重。S201, for each data source among a plurality of data sources, calculating a roulette weight of each data source.
作为一种实现方式,基于每个数据源的价格和调用时延,计算每个数据源的轮盘权重。As an implementation method, the roulette weight of each data source is calculated based on the price and call latency of each data source.
作为一种具体实现方式,获取该单一产品的子节点对应的多个数据源之后,通过如下公式计算各数据源的轮盘权重:As a specific implementation method, after obtaining multiple data sources corresponding to the sub-nodes of the single product, the wheel weight of each data source is calculated by the following formula:
其中,f代表数据源的轮盘权重,ω为适应性因子参数,a为价格因子参数,round(a)为价格因子的就近取整因数,单位为角;t为时间因子参数,单位为毫秒。Among them, f represents the roulette weight of the data source, ω is the adaptability factor parameter, a is the price factor parameter, round(a) is the nearest integer factor of the price factor, the unit is angle; t is the time factor parameter, the unit is milliseconds.
其中,时间因子参数t的取值由以下的公式求出:Among them, the value of the time factor parameter t is calculated by the following formula:
其中,T为每次测试的调用时长值,n为测试的次数。Where T is the call duration of each test, and n is the number of tests.
在决策树形成的过程中,基于数据源的性能,价格等综合因素得到数据源的轮盘权重。In the process of forming the decision tree, the roulette weight of the data source is obtained based on comprehensive factors such as the performance and price of the data source.
S202,基于多个数据源的轮盘权重,获取每个数据源的轮盘权重占比。S202, based on the roulette weights of multiple data sources, obtain the roulette weight ratio of each data source.
综合因素占优的数据源拥有更高的轮盘权重占比。Data sources with a combination of factors have a higher roulette weight ratio.
S203,基于轮盘权重占比和预设轮盘机制,确定每个数据源的轮盘区域。S203: Determine a roulette area for each data source based on the roulette weight ratio and a preset roulette mechanism.
S204,基于预设轮盘机制随机生成一个自然数,并确定自然数在预设轮盘机制中所处的轮盘区域。S204, randomly generating a natural number based on a preset roulette mechanism, and determining a roulette area where the natural number is located in the preset roulette mechanism.
S205,基于自然数所处的轮盘区域,确定多个数据源中各数据源的初始优先级。S205, determining an initial priority of each data source among the multiple data sources based on the roulette area where the natural number is located.
示例1,该单一产品包括3个子节点,分别对应数据源1-数据源3,数据源1的价格中等,价格就近取整因子为1,性能好,调用延时低,得到的时间因子参数近似为100毫秒。数据源2的价格昂贵,价格就近取整因数为2,性能好,调用时延得到的调用时间因子参数近似为100毫秒。数据源3的价格中等,价格就近取整因数为1,性能稍差,调用时延长,时间因子参数近似为200毫秒。例如,将适应性因子参数ω设置为1,计算数据源1~3的轮盘权重f,并得到3个数据源的轮盘权重占比为2:1:1。若设置1~100的轮盘机制,若在预算成本合理的情况下,为了提高用户的使用体验,以及让剩下数据源也存在合理调用,则可以根据轮盘权重占比2:1:1,将数据源1设置为1~50轮盘区域,将数据源2和数据源3分别设置为51~75轮盘区域,76~100轮盘区域。Example 1, this single product includes 3 child nodes, corresponding to data source 1 to data source 3. Data source 1 has a medium price, a price rounding factor of 1, good performance, low call delay, and the obtained time factor parameter is approximately 100 milliseconds. Data source 2 has an expensive price, a price rounding factor of 2, good performance, and a call delay of approximately 100 milliseconds. Data source 3 has a medium price, a price rounding factor of 1, slightly worse performance, and a longer call time, and the time factor parameter is approximately 200 milliseconds. For example, set the adaptability factor parameter ω to 1, calculate the roulette weight f of data sources 1 to 3, and obtain the roulette weight ratio of the three data sources as 2:1:1. If a roulette mechanism of 1 to 100 is set, and if the budget cost is reasonable, in order to improve the user experience and ensure that the remaining data sources can be reasonably called, data source 1 can be set to the roulette area of 1 to 50, and data source 2 and data source 3 can be set to the roulette area of 51 to 75 and the roulette area of 76 to 100 respectively according to the roulette weight ratio of 2:1:1.
在1~100的轮盘机制中随机生成一个自然数,若判断该自然数落在1~50区域中,则与该区域对应的数据源1就为初始优先级最高的数据源,若在51~75区域中,则与该区域对应的数据源2为初始优先级最高的数据源,若在76~100区域中,则与该区域对应的数据源3为初始优先级最高的数据源。A natural number is randomly generated in the roulette mechanism of 1 to 100. If it is determined that the natural number falls in the range of 1 to 50, the data source 1 corresponding to the range is the data source with the highest initial priority. If it is in the range of 51 to 75, the data source 2 corresponding to the range is the data source with the highest initial priority. If it is in the range of 76 to 100, the data source 3 corresponding to the range is the data source with the highest initial priority.
在步骤S105中,基于多个数据源中各数据源的初始优先级以及各数据源的相关调用信息,获取各数据源的选取概率;并基于多个数据源的选取概率,确定并调用多个数据源中的目标数据源。In step S105, based on the initial priority of each data source among the multiple data sources and the relevant calling information of each data source, the selection probability of each data source is obtained; and based on the selection probability of the multiple data sources, the target data source among the multiple data sources is determined and called.
作为一种实现方式,基于多个数据源中各数据源的初始优先级、各数据源与第一产品之间的信息素以及各数据源的调用时延,获取各数据源的选取概率。As an implementation manner, based on the initial priority of each data source among multiple data sources, the pheromone between each data source and the first product, and the call delay of each data source, the selection probability of each data source is obtained.
获取各数据源的选取概率,可以基于选取概率确定各数据源的最终优先级,例如按照选取概率从大到小,设置最终优先级由高到低。The selection probability of each data source is obtained, and the final priority of each data source can be determined based on the selection probability. For example, the final priority can be set from high to low according to the selection probability from large to small.
还需要说明的是,在确定各数据源的轮盘权重、初始优先级以及选取概率或者最终优先级之后,可以在各数据源的树状路由信息的基础上设置轮盘权重、初始优先级以及选取概率或者最终优先级中的一个或者多个。例如,可以将轮盘权重、初始优先级以及选取概率或者最终优先级作为各对应数据源的属性添加到数据源的标签编号上。可以理解为,这样,原始树样本则成为决策树,在进行数据源调用时,基于决策树选择合适的数据源。It should also be noted that after determining the roulette weight, initial priority, and selection probability or final priority of each data source, one or more of the roulette weight, initial priority, selection probability, or final priority can be set based on the tree routing information of each data source. For example, the roulette weight, initial priority, and selection probability or final priority can be added to the label number of the data source as attributes of each corresponding data source. It can be understood that in this way, the original tree sample becomes a decision tree, and when calling a data source, a suitable data source is selected based on the decision tree.
可选的,确定选取概率最大的数据源,作为待调用的目标数据源。即调用最终优先级最高的数据源。Optionally, determine the data source with the highest selection probability as the target data source to be called, that is, call the data source with the highest final priority.
现有技术中,多数据源管理的方式较为混乱,而且无法综合数据源的优劣程度进行综合分析其利弊。本申请实施例的原始树样本在添加轮盘权重、优先级等属性后构成决策树,解决了多数据源无法统一管理的痛点,规范了多数据源的管理选取模式,实现创新性地对数据源进行渠道分发。In the prior art, the management method of multiple data sources is relatively chaotic, and it is impossible to comprehensively analyze the pros and cons of the data sources based on their pros and cons. The original tree sample of the embodiment of the present application forms a decision tree after adding attributes such as wheel weight and priority, which solves the pain point that multiple data sources cannot be managed uniformly, standardizes the management and selection mode of multiple data sources, and realizes innovative channel distribution of data sources.
作为一种具体实现方式,根据各数据源的初始优先级、各数据源与用户请求产品m之间的信息素,以及各数据源的调用时延,通过如下计算公式计算各数据源的选取概率,并根据选取概率从若干数据源中选取适合用户请求产品m的数据源:As a specific implementation method, according to the initial priority of each data source, the pheromone between each data source and the user's requested product m, and the call delay of each data source, the selection probability of each data source is calculated by the following calculation formula, and the data source suitable for the user's requested product m is selected from several data sources according to the selection probability:
其中,P(i)表示数据源i的选取概率;τ(i,m)表示数据源i和用户请求产品m(第一产品)之间的信息素,δ、θ分别表示预设启发函数和信息素的影响;τ(ti,m)表示数据源i的调用时延和用户请求产品m之间的信息素;η(i)表示数据i的源调度启发函数;η(ti)表示数据源i的调用时延的调度启发函数。ψ表示数据源初始优先级对应的优先级权重值;Where P(i) represents the selection probability of data source i; τ(i,m) represents the pheromone between data source i and user requested product m (first product), δ and θ represent the influence of preset heuristic function and pheromone respectively; τ( ti ,m) represents the pheromone between the call delay of data source i and user requested product m; η(i) represents the source scheduling heuristic function of data i; η( ti ) represents the scheduling heuristic function of the call delay of data source i. ψ represents the priority weight value corresponding to the initial priority of the data source;
其中,in,
其中,U(i)表示数据源i的初始优先级的向上排名,数据源的初始优先级越高,则数据源的初始优先级的向上排名对应的数值越小。表示所有数据源对应的轮盘区域的平均轮盘区域值;表示除数据源i之外,位于数据源i的下一优先级的数据源j对应的轮盘区域的平均轮盘区域值;U(j)表示数据源j的初始优先级的向上排名,数据源j是指位于数据源i的下一优先级的数据源(位于数据源i的下一优先级的数据源可能有多个)。Among them, U(i) represents the upward ranking of the initial priority of data source i. The higher the initial priority of the data source, the smaller the value corresponding to the upward ranking of the initial priority of the data source. Indicates the average roulette area value of the roulette areas corresponding to all data sources; It represents the average roulette area value of the roulette area corresponding to the data source j at the next priority level of data source i, excluding data source i. U(j) represents the upward ranking of the initial priority of data source j, where data source j refers to the data source at the next priority level of data source i (there may be multiple data sources at the next priority level of data source i).
作为一种实现方式,在调用目标数据源时可以采用抽象工厂模式:根据被选中的目标数据源的标签编号,将该数据源的数据源信息发送到抽象工厂中,抽象工厂跟据接收的数据源信息,自上而下生成数据源实例,通过数据源实例进行目标数据源的调用,并得到数据调用结果,即调用是否成功的结果。As an implementation method, the abstract factory pattern can be used when calling the target data source: according to the tag number of the selected target data source, the data source information of the data source is sent to the abstract factory. The abstract factory generates a data source instance from top to bottom based on the received data source information, and calls the target data source through the data source instance to obtain the data call result, that is, whether the call is successful.
还需要说明的是,若调用结果为成功,则进行下一个关联单一产品上述处理流程,若调用失败则从剩下的数据源中选择新的目标数据源进行调用。It should also be noted that if the call result is successful, the above-mentioned processing flow of the next associated single product is carried out. If the call fails, a new target data source is selected from the remaining data sources for calling.
本申请实施例的多数据源的调用方法,基于组合产品、单一产品以及数据源构建原始树样本,在数据源的路由信息基础上通过添加轮盘权重、优先级等属性形成决策树样本,基于决策树样本实现数据源的择优选择。在决策树形成的过程中,基于数据源的性能,价格等综合因素得到数据源的轮盘权重,在基于轮盘权重确定数据源的初始优先级,之后结合数据源的其他调用相关因素得到数据源的最终优先级,基于最终优先级实现多维度的数据源的择优调用。基于决策树能更好的综合数据源多个维度进行分析,从而选取出更优异的数据源进行服务调用,从一定程度上讲,节省了成本,提升了用户体验。The calling method of multiple data sources in the embodiment of the present application constructs an original tree sample based on a combination product, a single product, and a data source, forms a decision tree sample by adding attributes such as roulette weight and priority based on the routing information of the data source, and implements the preferential selection of the data source based on the decision tree sample. In the process of forming the decision tree, the roulette weight of the data source is obtained based on comprehensive factors such as the performance and price of the data source, and the initial priority of the data source is determined based on the roulette weight. Then, the final priority of the data source is obtained in combination with other call-related factors of the data source, and the preferential calling of multi-dimensional data sources is implemented based on the final priority. Based on the decision tree, multiple dimensions of the data source can be better integrated for analysis, so as to select a better data source for service calling, which saves costs and improves user experience to a certain extent.
上述实施例对应的是第一产品为组合产品的情况,在第一产品为单一产品的情况下,图4是根据本申请另一个实施例的多数据源的调用方法的流程图。如图4所示,该多数据源的调用方法可以包括如下步骤。The above embodiment corresponds to the case where the first product is a combined product. When the first product is a single product, Figure 4 is a flow chart of a method for calling multiple data sources according to another embodiment of the present application. As shown in Figure 4, the method for calling multiple data sources may include the following steps.
在步骤S301中,响应于产品服务请求,获取产品服务请求中携带的请求参数信息;并基于请求参数信息确定满足产品服务请求的第一产品。In step S301, in response to a product service request, request parameter information carried in the product service request is obtained; and a first product satisfying the product service request is determined based on the request parameter information.
在步骤S302中,获取第一产品在原始树样本中的路由信息,并基于路由信息,确定第一产品的产品类型;其中,产品类型包括组合产品和单一产品;原始树样本是以服务、产品和数据源分别作为根节点、分支节点和叶节点构建的;组合产品的子节点为组合产品或单一产品,单一产品的子节点为数据源。In step S302, the routing information of the first product in the original tree sample is obtained, and based on the routing information, the product type of the first product is determined; wherein the product type includes a combination product and a single product; the original tree sample is constructed with services, products and data sources as root nodes, branch nodes and leaf nodes respectively; the child nodes of the combination product are combination products or single products, and the child nodes of the single product are data sources.
在步骤S303中,在第一产品的产品类型为单一产品的情况下,获取该单一产品关联的多数据源;并对多个数据源进行轮盘权重决策,确定多个数据源中各数据源的初始优先级。In step S303, when the product type of the first product is a single product, multiple data sources associated with the single product are obtained; and a roulette weight decision is performed on the multiple data sources to determine the initial priority of each of the multiple data sources.
在步骤S304中,基于多个数据源中各数据源的初始优先级以及各数据源的相关调用信息,获取各数据源的选取概率;并基于多个数据源的选取概率,确定并调用多个数据源中的目标数据源。In step S304, based on the initial priority of each data source among the multiple data sources and the relevant calling information of each data source, the selection probability of each data source is obtained; and based on the selection probability of the multiple data sources, the target data source among the multiple data sources is determined and called.
需要说明的是,在本申请的实施例中,上述步骤S301-步骤S304的实现过程可参见上述步骤S101、S102、S104、S105的实现过程的描述,在此不再赘述。It should be noted that, in the embodiment of the present application, the implementation process of the above steps S301 to S304 can refer to the description of the implementation process of the above steps S101, S102, S104, and S105, which will not be repeated here.
还需要说明的是,在数据源的调用过程中,可能遇到数据源调用失败的情况,在这种情况下,可以重新选择数据源进行调用。也就是说,在步骤S105之后,还可以进行如下操作。It should also be noted that, during the process of calling the data source, the data source calling may fail. In this case, a new data source may be selected for calling. That is, after step S105, the following operations may be performed.
图5是根据本申请又一个实施例的多数据源的调用方法的流程图。如图5所示,该多数据源的调用方法可以包括如下步骤。Fig. 5 is a flow chart of a method for calling multiple data sources according to another embodiment of the present application. As shown in Fig. 5, the method for calling multiple data sources may include the following steps.
在步骤S401中,判断目标数据源是否调用成功。In step S401, it is determined whether the target data source is successfully called.
在步骤S402中,在目标数据源调用不成功的情况下,计算多个数据源中除目标数据源之外的各替代数据源的选取概率。In step S402, when the target data source is not successfully called, the selection probability of each alternative data source other than the target data source among the multiple data sources is calculated.
作为一种实现方式,以上述实施例中的示例1为例,若优先级最高的数据源调用失败,则需重新进入轮盘机制,失败的数据源对应的轮盘区域部分废弃,剩余数据源进行优先级选举决策。比如,若数据源1在第一次被选中后调用失败,则与该数据源1对应的轮盘1~50区域的部分废弃,重新在51~100的轮盘区域进行选举,进而重新确定数据源2、3的初始优先级,并计算数据源2、3的选取概率。As an implementation method, taking Example 1 in the above embodiment as an example, if the highest priority data source fails to be called, the roulette mechanism needs to be re-entered, and the roulette area corresponding to the failed data source is partially abandoned, and the remaining data sources are subject to priority election decisions. For example, if data source 1 fails to be called after being selected for the first time, the part of the roulette area 1 to 50 corresponding to the data source 1 is abandoned, and the election is re-performed in the roulette area 51 to 100, and then the initial priority of data sources 2 and 3 is re-determined, and the selection probability of data sources 2 and 3 is calculated.
为了提高数据源的调用成功率,作为另一种实现方式,计算多个数据源中除目标数据源之外的各数据源的选取概率,包括:基于预设数据源选取规则,计算多个数据源中除目标数据源之外的各数据源的选取概率。In order to improve the success rate of calling the data source, as another implementation method, the selection probability of each data source other than the target data source among multiple data sources is calculated, including: based on a preset data source selection rule, calculating the selection probability of each data source other than the target data source among multiple data sources.
在判断上述步骤选取的目标数据源调用不成功的情况下,则根据预设数据源选取规则计算各替代数据源的选取概率,然后根据选取概率选取替代数据源,即新的目标数据源。其中,预设数据源选取规则是指根据数据源的调用成功率,调用等待时间以及调用成本等因素综合选取替代数据源,以保证在数据源调用成功的情况下,尽量减少数据源的调用等待时间和调用成本。If the target data source selected in the above step is unsuccessful, the selection probability of each alternative data source is calculated according to the preset data source selection rule, and then the alternative data source, i.e., the new target data source, is selected according to the selection probability. The preset data source selection rule refers to the comprehensive selection of alternative data sources based on factors such as the call success rate of the data source, the call waiting time, and the call cost, so as to ensure that the call waiting time and call cost of the data source are minimized when the data source call is successful.
作为一种具体实现方式,可以按照如下预设数据源选取规则计算多个数据源中除目标数据源之外的各数据源的选取概率:As a specific implementation method, the selection probability of each data source other than the target data source among multiple data sources may be calculated according to the following preset data source selection rule:
其中,p(h)表示除第一次调用失败的数据源之外的替代数据源被选取的概率,τ(hcost,m)表示替代数据源h和用户请求产品m之间的信息素;λ(hcost)表示替代数据源h的性价比竞争因子;τ(αh,m)表示替代数据源h的调用成功率和用户请求产品m之间的信息素;EST(h,T)表示调用替代数据源h时需要等待的调用等待时间。Among them, p(h) represents the probability of selecting an alternative data source other than the data source that failed in the first call, τ(h cost ,m) represents the pheromone between the alternative data source h and the user requested product m; λ(h cost ) represents the cost-effectiveness competition factor of the alternative data source h; τ(α h ,m) represents the pheromone between the call success rate of the alternative data source h and the user requested product m; EST(h,T) represents the call waiting time required to wait when calling the alternative data source h.
在步骤S403中,基于各替代数据源的选取概率,确定并调用新的目标数据源。In step S403, based on the selection probability of each alternative data source, a new target data source is determined and called.
例如,可以选择各替代数据源中的选取概率最大的数据源,作为新的目标数据源。For example, a data source with the highest selection probability among the alternative data sources may be selected as the new target data source.
本申请实施例的多数据源的调用方法,在上述任一实施例的基础上,当数据源调用失败时,提供了一种替代数据源的选取方式,在保证在数据源调用成功的情况下,可以尽量减少数据源的调用等待时间和调用成本。The calling method of multiple data sources of the embodiment of the present application, based on any of the above embodiments, provides a method for selecting an alternative data source when the data source call fails, which can minimize the calling waiting time and calling cost of the data source while ensuring the success of the data source call.
对应于上述方法实施例,图6是根据一示例性实施例示出的一种多数据源的调用装置的框图。参照图6,该多数据源的调用装置可以包括:数据解析模块601、产品类型确定模块602、流程控制模块603、轮盘决策模块604和目标确定模块605。Corresponding to the above method embodiment, Fig. 6 is a block diagram of a device for calling multiple data sources according to an exemplary embodiment. Referring to Fig. 6, the device for calling multiple data sources may include: a data parsing module 601, a product type determination module 602, a process control module 603, a roulette decision module 604, and a target determination module 605.
具体地,数据解析模块601,用于响应于产品服务请求,获取产品服务请求中携带的请求参数信息;并基于请求参数信息确定满足产品服务请求的第一产品;Specifically, the data parsing module 601 is used to obtain request parameter information carried in the product service request in response to the product service request; and determine the first product that meets the product service request based on the request parameter information;
产品类型确定模块602,用于获取第一产品在原始树样本中的路由信息,并基于路由信息,确定第一产品的产品类型;其中,产品类型包括组合产品和单一产品;原始树样本是以服务、产品和数据源分别作为根节点、分支节点和叶节点构建的;组合产品的子节点为组合产品或单一产品,单一产品的子节点为数据源;The product type determination module 602 is used to obtain the routing information of the first product in the original tree sample, and determine the product type of the first product based on the routing information; wherein the product type includes a combination product and a single product; the original tree sample is constructed with services, products and data sources as root nodes, branch nodes and leaf nodes respectively; the child nodes of the combination product are the combination product or the single product, and the child nodes of the single product are the data sources;
流程控制模块603,用于在第一产品的产品类型为组成产品的情况下,逐个寻址第一产品在原始树样本中关联的单一产品,针对该单一产品进行如下步骤操作,直到产品服务请求响应结束;The process control module 603 is used to address the single products associated with the first product in the original tree sample one by one when the product type of the first product is a component product, and perform the following steps on the single product until the product service request response is completed;
轮盘决策模块604,用于获取该单一产品关联的多个数据源,并对多个数据源进行轮盘权重决策,确定多个数据源中各数据源的初始优先级;A roulette decision module 604 is used to obtain multiple data sources associated with the single product, and perform a roulette weight decision on the multiple data sources to determine the initial priority of each of the multiple data sources;
目标确定模块605,用于基于多个数据源中各数据源的初始优先级以及各数据源的相关调用信息,获取各数据源的选取概率;并基于多个数据源的选取概率,确定并调用多个数据源中的目标数据源。The target determination module 605 is used to obtain the selection probability of each data source based on the initial priority of each data source and the relevant calling information of each data source; and determine and call the target data source among the multiple data sources based on the selection probability of the multiple data sources.
在一些实现方式中,轮盘决策模块604,还用于:In some implementations, the roulette decision module 604 is further configured to:
在第一产品的产品类型为单一产品的情况下,获取该单一产品关联的多个数据源;并对多个数据源进行轮盘权重决策,确定多个数据源中各数据源的初始优先级;In the case where the product type of the first product is a single product, multiple data sources associated with the single product are obtained; and a roulette weight decision is performed on the multiple data sources to determine an initial priority of each of the multiple data sources;
目标确定模块605,用于基于多个数据源中各数据源的初始优先级以及各数据源的相关调用信息,获取各数据源的选取概率;并基于多个数据源的选取概率,确定并调用多个数据源中的目标数据源。The target determination module 605 is used to obtain the selection probability of each data source based on the initial priority of each data source and the relevant calling information of each data source; and determine and call the target data source among the multiple data sources based on the selection probability of the multiple data sources.
在一些实现方式中,轮盘决策模块604,具体用于:In some implementations, the roulette decision module 604 is specifically configured to:
针对多个数据源中的每个数据源,计算每个数据源的轮盘权重;For each data source among the plurality of data sources, calculating a roulette weight of each data source;
基于多个数据源的轮盘权重,获取每个数据源的轮盘权重占比;Based on the roulette weights of multiple data sources, obtain the roulette weight ratio of each data source;
基于轮盘权重占比和预设轮盘机制,确定每个数据源的轮盘区域;Based on the roulette weight ratio and the preset roulette mechanism, determine the roulette area for each data source;
基于预设轮盘机制随机生成一个自然数,并确定自然数在预设轮盘机制中所处的轮盘区域;Randomly generate a natural number based on a preset roulette mechanism, and determine the roulette area where the natural number is located in the preset roulette mechanism;
基于自然数所处的轮盘区域,确定多个数据源中各数据源的初始优先级。Based on the roulette wheel region where the natural number is located, an initial priority of each of the multiple data sources is determined.
在一些实现方式中,轮盘决策模块604在计算每个数据源的轮盘权重时,用于:In some implementations, the roulette decision module 604, when calculating the roulette weight of each data source, is used to:
基于每个数据源的价格和调用时延,计算每个数据源的轮盘权重。The roulette weight of each data source is calculated based on the price and call latency of each data source.
在一些实现方式中,装置还包括:In some implementations, the apparatus further includes:
结果判断模块606,用于判断目标数据源是否调用成功;Result judgment module 606, used to judge whether the target data source is successfully called;
替代计算模块607,用于在目标数据源调用不成功的情况下,计算多个数据源中除目标数据源之外的各替代数据源的选取概率;并基于各替代数据源的选取概率,确定并调用新的目标数据源。The alternative calculation module 607 is used to calculate the selection probability of each alternative data source other than the target data source among multiple data sources when the target data source is not successfully called; and determine and call a new target data source based on the selection probability of each alternative data source.
在一些实现方式中,替代计算模块607在计算多个数据源中除目标数据源之外的各数据源的选取概率时,具体用于:In some implementations, when calculating the selection probability of each data source other than the target data source among the multiple data sources, the alternative calculation module 607 is specifically configured to:
基于预设数据源选取规则,计算多个数据源中除目标数据源之外的各数据源的选取概率。Based on the preset data source selection rule, the selection probability of each data source among the multiple data sources except the target data source is calculated.
在一些实现方式中,目标确定模块605在基于多个数据源中各数据源的初始优先级以及各数据源的相关调用信息,获取各数据源的选取概率时,用于:In some implementations, when obtaining the selection probability of each data source based on the initial priority of each data source among the multiple data sources and the related call information of each data source, the target determination module 605 is used to:
基于多个数据源中各数据源的初始优先级、各数据源与第一产品之间的信息素以及各数据源的调用时延,获取各数据源的选取概率。Based on the initial priority of each data source among the multiple data sources, the pheromone between each data source and the first product, and the calling delay of each data source, the selection probability of each data source is obtained.
在一些实现方式中,轮盘决策模块604在获取该单一产品关联的多个数据源之后,还用于:In some implementations, after obtaining multiple data sources associated with the single product, the roulette decision module 604 is further configured to:
基于数据源黑名单,对多个数据源进行筛选,得到适用于第一产品的多个数据源。Based on the data source blacklist, multiple data sources are screened to obtain multiple data sources suitable for the first product.
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
本申请实施例的多数据源的调用装置,基于组合产品、单一产品以及数据源构建原始树样本,在数据源的路由信息基础上通过添加轮盘权重、优先级等属性形成决策树样本,基于决策树样本实现数据源的择优选择。在决策树形成的过程中,基于数据源的性能,价格等综合因素得到数据源的轮盘权重,在基于轮盘权重确定数据源的初始优先级,之后结合数据源的其他调用相关因素得到数据源的最终优先级,基于最终优先级实现多维度的数据源的择优调用。基于决策树能更好的综合数据源多个维度进行分析,从而选取出更优异的数据源进行服务调用,从一定程度上讲,节省了成本,提升了用户体验。当数据源调用失败时,提供了一种替代数据源的选取方式,在保证在数据源调用成功的情况下,可以尽量减少数据源的调用等待时间和调用成本。The calling device of multiple data sources in the embodiment of the present application constructs an original tree sample based on a combination product, a single product, and a data source, forms a decision tree sample by adding attributes such as a roulette weight and a priority based on the routing information of the data source, and implements the preferential selection of the data source based on the decision tree sample. In the process of forming the decision tree, the roulette weight of the data source is obtained based on comprehensive factors such as the performance and price of the data source, and the initial priority of the data source is determined based on the roulette weight. Then, the final priority of the data source is obtained in combination with other call-related factors of the data source, and the preferential call of the multi-dimensional data source is implemented based on the final priority. Based on the decision tree, the multiple dimensions of the data source can be better integrated for analysis, so as to select a better data source for service call, which saves costs and improves user experience to a certain extent. When the data source call fails, a method for selecting an alternative data source is provided, which can minimize the call waiting time and call cost of the data source while ensuring that the data source call is successful.
根据本申请的实施例,本申请还提供了一种电子设备和一种可读存储介质。According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.
如图7所示,是根据本申请实施例的用于实现多数据源的调用的方法的电子设备的框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本申请的实现。As shown in Figure 7, it is a block diagram of an electronic device for implementing a method for calling multiple data sources according to an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and/or required herein.
如图7所示,该电子设备包括:一个或多个处理器701、存储器702,以及用于连接各部件的接口,包括高速接口和低速接口。各个部件利用不同的总线互相连接,并且可以被安装在公共主板上或者根据需要以其它方式安装。处理器可以对在电子设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入/输出装置(诸如,耦合至接口的显示设备)上显示GUI的图形信息的指令。在其它实施方式中,若需要,可以将多个处理器和/或多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个电子设备,各个设备提供部分必要的操作(例如,作为服务器阵列、一组刀片式服务器、或者多处理器系统)。图7中以一个处理器701为例。As shown in Figure 7, the electronic device includes: one or more processors 701, memory 702, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input/output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and/or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). In Figure 7, a processor 701 is taken as an example.
存储器702即为本申请所提供的非瞬时计算机可读存储介质。其中,所述存储器存储有可由至少一个处理器执行的指令,以使所述至少一个处理器执行本申请所提供的多数据源的调用的方法。本申请的非瞬时计算机可读存储介质存储计算机指令,该计算机指令用于使计算机执行本申请所提供的多数据源的调用的方法。The memory 702 is a non-transitory computer-readable storage medium provided in the present application. The memory stores instructions executable by at least one processor to enable the at least one processor to perform the method for calling multiple data sources provided in the present application. The non-transitory computer-readable storage medium of the present application stores computer instructions, which are used to enable a computer to perform the method for calling multiple data sources provided in the present application.
存储器702作为一种非瞬时计算机可读存储介质,可用于存储非瞬时软件程序、非瞬时计算机可执行程序以及模块,如本申请实施例中的多数据源的调用的方法对应的程序指令/模块(例如,附图6所示的数据解析模块601、产品类型确定模块602、流程控制模块603、轮盘决策模块604和目标确定模块605)。处理器701通过运行存储在存储器702中的非瞬时软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例中的多数据源的调用的方法。The memory 702, as a non-transient computer-readable storage medium, can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions/modules corresponding to the method for calling multiple data sources in the embodiment of the present application (for example, the data parsing module 601, the product type determination module 602, the process control module 603, the roulette decision module 604 and the target determination module 605 shown in FIG. 6). The processor 701 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 702, that is, the method for calling multiple data sources in the above method embodiment is implemented.
存储器702可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据多数据源的调用的电子设备的使用所创建的数据等。此外,存储器702可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、或其他非瞬时固态存储器件。在一些实施例中,存储器702可选包括相对于处理器701远程设置的存储器,这些远程存储器可以通过网络连接至多数据源的调用的电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 702 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required by at least one function; the data storage area may store data created by the use of the electronic device called by multiple data sources, etc. In addition, the memory 702 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 702 may optionally include a memory remotely arranged relative to the processor 701, and these remote memories may be connected to the electronic device called by multiple data sources via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
多数据源的调用的方法的电子设备还可以包括:输入装置703和输出装置704。处理器701、存储器702、输入装置703和输出装置704可以通过总线或者其他方式连接,图7中以通过总线连接为例。The electronic device of the method for calling multiple data sources may further include: an input device 703 and an output device 704. The processor 701, the memory 702, the input device 703 and the output device 704 may be connected via a bus or other means, and FIG7 takes the bus connection as an example.
输入装置703可接收输入的数字或字符信息,以及产生与多数据源的调用的电子设备的用户设置以及功能控制有关的键信号输入,例如触摸屏、小键盘、鼠标、轨迹板、触摸板、指示杆、一个或者多个鼠标按钮、轨迹球、操纵杆等输入装置。输出装置704可以包括显示设备、辅助照明装置(例如,LED)和触觉反馈装置(例如,振动电机)等。该显示设备可以包括但不限于,液晶显示器(LCD)、发光二极管(LED)显示器和等离子体显示器。在一些实施方式中,显示设备可以是触摸屏。The input device 703 can receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device called by the multiple data sources, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 704 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.
此处描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、专用ASIC(专用集成电路)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various implementations may include: being implemented in one or more computer programs that can be executed and/or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
这些计算程序(也称作程序、软件、软件应用、或者代码)包括可编程处理器的机器指令,并且可以利用高级过程和/或面向对象的编程语言、和/或汇编/机器语言来实施这些计算程序。如本文使用的,术语“机器可读介质”和“计算机可读介质”指的是用于将机器指令和/或数据提供给可编程处理器的任何计算机程序产品、设备、和/或装置(例如,磁盘、光盘、存储器、可编程逻辑装置(PLD)),包括,接收作为机器可读信号的机器指令的机器可读介质。术语“机器可读信号”指的是用于将机器指令和/或数据提供给可编程处理器的任何信号。These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and/or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and/or data to a programmable processor.
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communications network). Examples of communications networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。A computer system may include clients and servers. Clients and servers are generally remote from each other and typically interact through a communication network. The relationship of client and server arises through computer programs running on the respective computers and having a client-server relationship to each other.
在示例性实施例中,还提供了一种计算机程序产品,当计算机程序产品中的指令由电子设备的处理器执行时,使得电子设备能够执行上述方法。In an exemplary embodiment, a computer program product is also provided. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to perform the above method.
还需要说明的是,本发明中提及的示例性实施例,基于一系列的步骤或者装置描述一些方法或系统。但是,本发明不局限于上述步骤的顺序,也就是说,可以按照实施例中提及的顺序执行步骤,也可以不同于实施例中的顺序,或者若干步骤同时执行。It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in a different order from the embodiments, or several steps can be performed simultaneously.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的。Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only.
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求来限制。It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims (11)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310953926.1A CN117082151B (en) | 2023-07-31 | 2023-07-31 | Method, device and storage medium for calling multiple data sources |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310953926.1A CN117082151B (en) | 2023-07-31 | 2023-07-31 | Method, device and storage medium for calling multiple data sources |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117082151A true CN117082151A (en) | 2023-11-17 |
CN117082151B CN117082151B (en) | 2024-09-24 |
Family
ID=88707095
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310953926.1A Active CN117082151B (en) | 2023-07-31 | 2023-07-31 | Method, device and storage medium for calling multiple data sources |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117082151B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118631904A (en) * | 2024-06-25 | 2024-09-10 | 天创信用服务有限公司 | Intelligent business-oriented traffic scheduling method and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020042579A1 (en) * | 2018-08-27 | 2020-03-05 | 平安科技(深圳)有限公司 | Group classification method and device, electronic device, and storage medium |
US20200228460A1 (en) * | 2019-01-10 | 2020-07-16 | International Business Machines Corporation | Scheduler utilizing normalized leaves of a weighted tree |
CN111753061A (en) * | 2019-03-27 | 2020-10-09 | 北京猎户星空科技有限公司 | Multi-turn conversation processing method and device, electronic equipment and storage medium |
CN113590603A (en) * | 2021-07-30 | 2021-11-02 | 未鲲(上海)科技服务有限公司 | Data processing method, device, equipment and medium based on intelligent selection of data source |
-
2023
- 2023-07-31 CN CN202310953926.1A patent/CN117082151B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020042579A1 (en) * | 2018-08-27 | 2020-03-05 | 平安科技(深圳)有限公司 | Group classification method and device, electronic device, and storage medium |
US20200228460A1 (en) * | 2019-01-10 | 2020-07-16 | International Business Machines Corporation | Scheduler utilizing normalized leaves of a weighted tree |
CN111753061A (en) * | 2019-03-27 | 2020-10-09 | 北京猎户星空科技有限公司 | Multi-turn conversation processing method and device, electronic equipment and storage medium |
CN113590603A (en) * | 2021-07-30 | 2021-11-02 | 未鲲(上海)科技服务有限公司 | Data processing method, device, equipment and medium based on intelligent selection of data source |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118631904A (en) * | 2024-06-25 | 2024-09-10 | 天创信用服务有限公司 | Intelligent business-oriented traffic scheduling method and device |
Also Published As
Publication number | Publication date |
---|---|
CN117082151B (en) | 2024-09-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11182746B2 (en) | Systems and methods for integrating third-party services with a client instance | |
US11036696B2 (en) | Resource allocation for database provisioning | |
US9065772B2 (en) | Dynamically modifying quality of service levels for resources running in a networked computing environment | |
CN104246741A (en) | Orchestrating hybrid cloud services | |
CN111741026A (en) | Cross-chain transaction request processing method, device, equipment and storage medium | |
US11843674B2 (en) | Virtual workspace experience visualization and optimization | |
US10541961B2 (en) | System and method for automating actions in distributed computing | |
US12182517B2 (en) | Systems and methods for a virtual agent in a cloud computing environment | |
US11928605B2 (en) | Techniques for cyber-attack event log fabrication | |
US11645507B2 (en) | Providing models to client devices | |
CN110011875A (en) | Dial-testing method, apparatus, device and computer-readable storage medium | |
US11765112B2 (en) | Context driven dynamic actions embedded in messages | |
US20230188620A1 (en) | Method of notifying of business audit, gateway, electronic device, and readable medium | |
CN117082151B (en) | Method, device and storage medium for calling multiple data sources | |
CN117271147A (en) | Data synchronous processing method and device | |
CN109213782A (en) | Configuration, display methods, device and the communication equipment of search interface | |
KR102785126B1 (en) | Action decisions for case management | |
WO2023169193A1 (en) | Method and device for generating smart contract | |
CN114448703A (en) | Request processing method and device, electronic equipment and storage medium | |
CN114610732A (en) | Back-end data processing method and device | |
CN114971503A (en) | Data processing method, device and storage medium | |
CN113448830B (en) | Method and device for managing software information | |
US20220230123A1 (en) | Quick case type selector | |
CN111401825B (en) | Instantiation method and device | |
WO2025022431A1 (en) | Method and system for network parameter change on multivendor network elements |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |