Movatterモバイル変換


[0]ホーム

URL:


CN118277423A - Query processing method, device, system, electronic device and storage medium - Google Patents

Query processing method, device, system, electronic device and storage medium
Download PDF

Info

Publication number
CN118277423A
CN118277423ACN202211713914.3ACN202211713914ACN118277423ACN 118277423 ACN118277423 ACN 118277423ACN 202211713914 ACN202211713914 ACN 202211713914ACN 118277423 ACN118277423 ACN 118277423A
Authority
CN
China
Prior art keywords
query
query request
query processing
cluster
cache cluster
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211713914.3A
Other languages
Chinese (zh)
Inventor
何磊
何荣光
孙松
陈浩
林君委
朱国荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Youzhuju Network Technology Co Ltd
Original Assignee
Beijing Youzhuju Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Youzhuju Network Technology Co LtdfiledCriticalBeijing Youzhuju Network Technology Co Ltd
Priority to CN202211713914.3ApriorityCriticalpatent/CN118277423A/en
Publication of CN118277423ApublicationCriticalpatent/CN118277423A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本公开涉及一种查询处理方法、装置、系统、电子设备以及存储介质,方法包括:获取客户端发送的查询请求;查询请求包括查询对象的标识信息和上游服务类型信息;基于查询对象的标识信息和上游服务类型信息,从N个缓存集群中,确定与查询请求对应的目标缓存集群;N为大于或等于2的正整数;将查询请求发送至目标缓存集群;接收目标缓存集群发送的第一查询处理结果,第一查询处理结果由目标缓存集群对查询请求进行处理得到;将第一查询处理结果发送至客户端。对于任一缓存集群,其不需要处理所有的查询请求,仅需要处理少部分分配至其处的查询请求,可以充分降低单个缓存集群的流量压力,可以降低网络拥塞;可实现无上限支撑流量增长。

The present disclosure relates to a query processing method, device, system, electronic device and storage medium, the method comprising: obtaining a query request sent by a client; the query request comprises identification information of the query object and upstream service type information; based on the identification information of the query object and the upstream service type information, determining the target cache cluster corresponding to the query request from N cache clusters; N is a positive integer greater than or equal to 2; sending the query request to the target cache cluster; receiving a first query processing result sent by the target cache cluster, the first query processing result being obtained by the target cache cluster processing the query request; sending the first query processing result to the client. For any cache cluster, it does not need to process all query requests, but only needs to process a small number of query requests assigned to it, which can substantially reduce the traffic pressure of a single cache cluster, can reduce network congestion; and can achieve unlimited support for traffic growth.

Description

Translated fromChinese
查询处理方法、装置、系统、电子设备以及存储介质Query processing method, device, system, electronic device and storage medium

技术领域Technical Field

本公开涉及查询处理技术领域,尤其涉及一种查询处理方法、装置、系统、电子设备以及存储介质。The present disclosure relates to the technical field of query processing, and in particular to a query processing method, device, system, electronic device and storage medium.

背景技术Background technique

随着电商查询蓬勃发展,电商商品查询流量快速增加。预期未来电商商品查询流量将达到千万级别。但目前,单个redis物理集群最多支撑到百万级别流量,无法满足日益增长的查询流量需求。With the booming development of e-commerce queries, the query traffic of e-commerce products has increased rapidly. It is expected that the query traffic of e-commerce products will reach tens of millions in the future. However, at present, a single Redis physical cluster can only support a traffic of millions at most, which cannot meet the growing query traffic demand.

发明内容Summary of the invention

为了解决上述技术问题或者至少部分地解决上述技术问题,本公开提供了一种查询处理方法、装置、系统、电子设备以及存储介质。In order to solve the above technical problem or at least partially solve the above technical problem, the present disclosure provides a query processing method, device, system, electronic device and storage medium.

第一方面,本公开提供了一种查询处理方法,包括:In a first aspect, the present disclosure provides a query processing method, comprising:

获取客户端发送的查询请求;所述查询请求包括查询对象的标识信息和上游服务类型信息;Obtaining a query request sent by a client; the query request includes identification information of a query object and upstream service type information;

基于所述查询对象的标识信息和上游服务类型信息,从N个缓存集群中,确定与所述查询请求对应的目标缓存集群;N为大于或等于2的正整数;Based on the identification information of the query object and the upstream service type information, determine the target cache cluster corresponding to the query request from N cache clusters; N is a positive integer greater than or equal to 2;

将所述查询请求发送至所述目标缓存集群;Sending the query request to the target cache cluster;

接收所述目标缓存集群发送的第一查询处理结果,所述第一查询处理结果由所述目标缓存集群对所述查询请求进行处理得到;receiving a first query processing result sent by the target cache cluster, where the first query processing result is obtained by the target cache cluster processing the query request;

将所述第一查询处理结果发送至所述客户端。The first query processing result is sent to the client.

第二方面,本公开还提供了一种查询处理系统,包括:客户端、总控设备及N个缓存集群;所述总控设备与所述客户端、以及N个所述缓存集群均通讯连接;N为大于或等于2的正整数;In a second aspect, the present disclosure further provides a query processing system, comprising: a client, a master control device, and N cache clusters; the master control device is in communication connection with the client, and the N cache clusters; N is a positive integer greater than or equal to 2;

所述客户端生成查询请求,并将所述查询请求发送至所述总控设备;所述查询请求包括查询对象的标识信息和上游服务类型信息;The client generates a query request and sends the query request to the master control device; the query request includes identification information of the query object and upstream service type information;

所述总控设备接收所述查询请求和上游服务类型信息,并基于所述查询对象的标识信息,从N个所述缓存集群中,确定与所述查询请求对应的目标缓存集群;将所述查询请求发送至所述目标缓存集群;The master control device receives the query request and the upstream service type information, and determines a target cache cluster corresponding to the query request from the N cache clusters based on the identification information of the query object; and sends the query request to the target cache cluster;

所述缓存集群对其接收到的所述查询请求进行处理,形成第一查询处理结果;The cache cluster processes the query request received by it to form a first query processing result;

所述总控设备接收所述目标缓存集群发送的第一查询处理结果,以及将所述第一查询处理结果发送至所述客户端。The master control device receives a first query processing result sent by the target cache cluster, and sends the first query processing result to the client.

第三方面,本公开还提供了一种查询处理装置,包括:In a third aspect, the present disclosure further provides a query processing device, including:

获取模块,用于获取客户端发送的查询请求;所述查询请求包括查询对象的标识信息和上游服务类型信息;An acquisition module, used to acquire a query request sent by a client; the query request includes identification information of a query object and upstream service type information;

路由控制模块,用于基于所述查询对象的标识信息和上游服务类型信息,从N个缓存集群中,确定与所述查询请求对应的目标缓存集群;N为大于或等于2的正整数;A routing control module, configured to determine, based on the identification information of the query object and the upstream service type information, a target cache cluster corresponding to the query request from N cache clusters; N is a positive integer greater than or equal to 2;

第一发送模块,用于将所述查询请求发送至所述目标缓存集群;A first sending module, configured to send the query request to the target cache cluster;

接收模块,用于接收所述目标缓存集群发送的第一查询处理结果,所述第一查询处理结果由所述目标缓存集群对所述查询请求进行处理得到;A receiving module, configured to receive a first query processing result sent by the target cache cluster, where the first query processing result is obtained by the target cache cluster processing the query request;

第二发送模块,用于将所述第一查询处理结果发送至所述客户端。The second sending module is used to send the first query processing result to the client.

第四方面,本公开还提供了一种电子设备,所述电子设备包括:In a fourth aspect, the present disclosure further provides an electronic device, the electronic device comprising:

一个或多个处理器;one or more processors;

存储装置,用于存储一个或多个程序;A storage device for storing one or more programs;

当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如上所述的查询处理方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the query processing method as described above.

第五方面,本公开还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上所述的查询处理方法。In a fifth aspect, the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which implements the query processing method as described above when executed by a processor.

本公开实施例提供的技术方案与现有技术相比具有如下优点:Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:

本公开实施例提供的技术方案通过设置获取客户端发送的查询请求;查询请求包括查询对象的标识信息;基于查询对象的标识信息,从N个缓存集群中,确定与查询请求对应的目标缓存集群;N为大于或等于2的正整数;将查询请求发送至目标缓存集群。上述技术方案中,由于并不会将每一个查询请求发送至所有的缓存集群,对于任一缓存集群,其不需要处理所有的查询请求,仅需要处理少部分分配至其处的查询请求,可以充分降低单个缓存集群的流量压力,可以降低网络拥塞,进而避免因网络拥塞导致的卡顿和延时。采用上述技术方案,通过增加缓存集群的数目,可以实现任意扩容,即可实现无上限支撑流量增长。The technical solution provided by the embodiment of the present disclosure is configured to obtain the query request sent by the client; the query request includes the identification information of the query object; based on the identification information of the query object, the target cache cluster corresponding to the query request is determined from N cache clusters; N is a positive integer greater than or equal to 2; and the query request is sent to the target cache cluster. In the above technical solution, since not every query request is sent to all cache clusters, for any cache cluster, it does not need to process all query requests, but only needs to process a small number of query requests assigned to it, which can substantially reduce the traffic pressure of a single cache cluster, can reduce network congestion, and thus avoid freezes and delays caused by network congestion. With the above technical solution, arbitrary capacity expansion can be achieved by increasing the number of cache clusters, that is, unlimited support for traffic growth can be achieved.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

图1为现有的一种查询处理系统的结构示意图;FIG1 is a schematic diagram of the structure of an existing query processing system;

图2为本公开实施例提供的一种查询处理系统的结构示意图;FIG2 is a schematic diagram of the structure of a query processing system provided by an embodiment of the present disclosure;

图3为本公开实施例提供的一种查询处理方法的流程图;FIG3 is a flow chart of a query processing method provided by an embodiment of the present disclosure;

图4为本公开实施例中的一种查询处理装置的结构示意图;FIG4 is a schematic diagram of the structure of a query processing device in an embodiment of the present disclosure;

图5为本公开实施例中的一种电子设备的结构示意图。FIG. 5 is a schematic diagram of the structure of an electronic device in an embodiment of the present disclosure.

具体实施方式Detailed ways

为了能够更清楚地理解本公开的上述目的、特征和优点,下面将对本公开的方案进行进一步描述。需要说明的是,在不冲突的情况下,本公开的实施例及实施例中的特征可以相互组合。In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

在下面的描述中阐述了很多具体细节以便于充分理解本公开,但本公开还可以采用其他不同于在此描述的方式来实施;显然,说明书中的实施例只是本公开的一部分实施例,而不是全部的实施例。In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

图1为现有的一种查询处理系统的结构示意图。该查询处理系统包括客户端、总控设备及redis物理集群。客户端与总控设备通讯连接,总控设备与redis物理集群通讯连接。当客户端向总控设备发送商品查询请求后,总控设备将该商品查询请求转发至redis物理集群,redis物理集群对该商品查询请求进行处理,得到商品查询结果,并将该商品查询结果反馈至总控设备,总控设备再将该查询结果反馈至客户端。FIG1 is a schematic diagram of the structure of an existing query processing system. The query processing system includes a client, a master control device and a redis physical cluster. The client is connected to the master control device, and the master control device is connected to the redis physical cluster. When the client sends a product query request to the master control device, the master control device forwards the product query request to the redis physical cluster, and the redis physical cluster processes the product query request to obtain the product query result, and feeds the product query result back to the master control device, and the master control device feeds the query result back to the client.

由于单个redis物理集群的商品查询请求处理能力限制在百万级别,往上无法突破,无法满足日益增长的查询流量需求。Since the product query request processing capacity of a single Redis physical cluster is limited to the million level and cannot be increased, it cannot meet the growing query traffic demand.

图2为本公开实施例提供的一种查询处理系统的结构示意图。参见图2,该查询处理系统包括客户端、总控设备及N个缓存集群;总控设备与客户端、以及N个缓存集群均通讯连接;N为大于或等于2的正整数。客户端生成查询请求,并将查询请求发送至总控设备;查询请求包括查询对象的标识信息和上游服务类型信息;总控设备接收该查询请求,并基于查询对象的标识信息和上游服务类型信息,从N个缓存集群中,确定与查询请求对应的目标缓存集群;将查询请求发送至目标缓存集群;缓存集群对其接收到的查询请求进行处理,形成第一查询处理结果;总控设备还接收目标缓存集群发送的第一查询处理结果,以及将第一查询处理结果发送至客户端。FIG2 is a schematic diagram of the structure of a query processing system provided by an embodiment of the present disclosure. Referring to FIG2 , the query processing system includes a client, a master control device, and N cache clusters; the master control device is in communication connection with the client and the N cache clusters; N is a positive integer greater than or equal to 2. The client generates a query request and sends the query request to the master control device; the query request includes identification information of the query object and upstream service type information; the master control device receives the query request, and based on the identification information of the query object and the upstream service type information, determines the target cache cluster corresponding to the query request from the N cache clusters; sends the query request to the target cache cluster; the cache cluster processes the query request it receives to form a first query processing result; the master control device also receives the first query processing result sent by the target cache cluster, and sends the first query processing result to the client.

查询请求是指在电商运营、商品导购或商品交易等场景下,为了实现查询目的,由客户端生成,并向总控设备发送的查询请求。在一些实施例中,查询请求为包括查询任务的查询请求。其中,客户端具体可以为商品销售方(如商家)的客户端,也可以为商品购买方(如买家或观看直播的用户)的客户端,还可以为商品推荐方(如直播团队、达人)的客户端等。A query request refers to a query request generated by a client and sent to a master control device in order to achieve a query purpose in scenarios such as e-commerce operations, product shopping guides, or product transactions. In some embodiments, the query request is a query request that includes a query task. The client may be a client of a product seller (such as a merchant), a client of a product buyer (such as a buyer or a user watching a live broadcast), or a client of a product recommender (such as a live broadcast team, an expert), etc.

查询对象是指查询请求所关注的、针对的、查询的对象。可选地,查询对象包括但不限于商品、商家以及用户的购物记录等。示例性地,查询请求为对A商品的搜索请求,查询对象为A商品。The query object refers to the object that the query request focuses on, targets, and queries. Optionally, the query object includes but is not limited to commodities, merchants, and user shopping records. Exemplarily, the query request is a search request for commodity A, and the query object is commodity A.

若查询对象为商品。示例性地,查询对象具体为物品或者服务等。If the query object is a commodity, illustratively, the query object is specifically an item or a service.

进一步地,商品包括多种属性。商品的属性是商品特征信息,如因商品自身构造、组成所具有的特征,或人为赋予的特征。如果商品为物品,其属性为商品名称、商品ID、商品链接、样式、尺寸、材质、功能、商标、类型、价格、颜色和包装等。如果商品为服务,其属性包括商品名称、商品ID、商品所包括的内容以及注意事项等。商品的属性信息是对商品的属性进行描述的信息。Furthermore, commodities include multiple attributes. The attributes of commodities are characteristic information of commodities, such as the characteristics of the commodity itself due to its structure and composition, or the characteristics given by humans. If the commodity is an article, its attributes include commodity name, commodity ID, commodity link, style, size, material, function, trademark, type, price, color and packaging, etc. If the commodity is a service, its attributes include commodity name, commodity ID, the contents included in the commodity and precautions, etc. The attribute information of commodities is the information describing the attributes of commodities.

查询对象的标识信息是指,能够将查询对象与其他对象进行区别的信息。可选地,查询对象的标识信息包括商品的部分属性信息,如查询对象的标识信息为商品ID。The identification information of the query object refers to information that can distinguish the query object from other objects. Optionally, the identification information of the query object includes part of the attribute information of the commodity, such as the identification information of the query object is the commodity ID.

上游服务类型信息,是指能够反映查询请求是在何种场景(或服务)下生成的信息,即能够反映查询请求的来源的信息。或者,上游服务类型信息用于描述该查询请求生成前客户端所显示的页面的类型的信息。示例性,上游服务类型信息包括描述通过达人橱窗页面而形成的查询请求的信息、通过商家店铺页面而形成的查询请求的信息、通过引流短视频而形成的查询请求的信息、通过营销活动查询页面而形成的查询请求的信息以及通过下单页面而形成的查询请求的信息。Upstream service type information refers to information that can reflect the scenario (or service) in which the query request is generated, that is, information that can reflect the source of the query request. Alternatively, the upstream service type information is used to describe the type of page displayed by the client before the query request is generated. Exemplarily, the upstream service type information includes information describing query requests formed through the influencer showcase page, query requests formed through the merchant store page, query requests formed through short video diversion, query requests formed through the marketing campaign query page, and query requests formed through the order page.

可选地,查询请求包括商品查询任务的请求,查询对象为待查询商品,查询对象的标识信息包括商品ID。Optionally, the query request includes a request for a commodity query task, the query object is the commodity to be queried, and the identification information of the query object includes the commodity ID.

目标缓存集群是指用于处理该查询请求的缓存集群。The target cache cluster refers to the cache cluster used to process the query request.

用于实现“基于查询对象的标识信息和上游服务类型信息,从N个缓存集群中,确定与查询请求对应的目标缓存集群”的方法有多种,本申请对此不作限制,用于实现“基于查询对象的标识信息和上游服务类型信息,从N个缓存集群中,确定与查询请求对应的目标缓存集群”的方法包括:基于查询对象的标识信息和上游服务类型信息,结合路由规则,从N个缓存集群中,确定与查询请求对应的目标缓存集群;路由规则包括标识信息、上游服务类型信息以及缓存集群三者的对应关系。There are many methods for implementing "determining the target cache cluster corresponding to the query request from N cache clusters based on the identification information and upstream service type information of the query object", and the present application does not limit this. The method for implementing "determining the target cache cluster corresponding to the query request from N cache clusters based on the identification information and upstream service type information of the query object" includes: based on the identification information and upstream service type information of the query object, combined with routing rules, determining the target cache cluster corresponding to the query request from N cache clusters; the routing rules include the correspondence between the identification information, the upstream service type information and the cache cluster.

路由规则需要预先配置。路由规则包括多组对应关系,不同对象关系中查询对象标识信息和/或上游服务类型信息不同。Routing rules need to be pre-configured. Routing rules include multiple sets of corresponding relationships, and the query object identification information and/or upstream service type information in different object relationships are different.

示例性地,假设先后接收到两个查询请求,分别为查询请求1和查询请求2。其中,查询请求1和查询请求2均是对商品ID为010的商品的查询请求,但是查询请求1的上游服务类型信息表明查询请求1为通过达人橱窗页面而形成的商品查询请求,查询请求2的上游服务类型信息表明查询请求2为通过下单页面而形成的商品查询请求。该查询处理系统包括缓存集群1和缓存集群2,缓存集群1和缓存集群2均可以对查询请求1和查询请求2进行处理。但是,因缓存集群1的故障率较高,而缓存集群2的故障率较低。Exemplarily, assume that two query requests are received successively, namely query request 1 and query request 2. Among them, query request 1 and query request 2 are both query requests for the product with product ID 010, but the upstream service type information of query request 1 indicates that query request 1 is a product query request formed through the expert showcase page, and the upstream service type information of query request 2 indicates that query request 2 is a product query request formed through the order page. The query processing system includes cache cluster 1 and cache cluster 2, and cache cluster 1 and cache cluster 2 can both process query request 1 and query request 2. However, the failure rate of cache cluster 1 is higher, while the failure rate of cache cluster 2 is lower.

由于通过下单页面形成的商品查询请求的重要程度高于通过其他页面形成的商品查询请求的重要程度,设置路由规则包括对应关系3和对应关系4,其中对应关系3指示商品ID为001的商品至025的商品,且由下单页面形成的商品查询请求与缓存集群2对应;对应关系4指示商品ID为001的商品至025的商品,且由非下单页面形成的商品查询请求与缓存集群1对应。Since the importance of product query requests formed through the order page is higher than that of product query requests formed through other pages, the routing rules are set to include correspondence 3 and correspondence 4, wherein correspondence 3 indicates products with product IDs from 001 to 025, and product query requests formed by the order page correspond to cache cluster 2; correspondence 4 indicates products with product IDs from 001 to 025, and product query requests formed by non-order pages correspond to cache cluster 1.

基于该路由规则中的对应关系3,确定缓存集群2为查询请求2的目标缓存集群。基于该路由规则中的对应关系4,确定缓存集群1为查询请求1的目标缓存集群。Based on the corresponding relationship 3 in the routing rule, cache cluster 2 is determined as the target cache cluster for query request 2. Based on the corresponding relationship 4 in the routing rule, cache cluster 1 is determined as the target cache cluster for query request 1.

在上述技术方案的基础上,可选地,该总控设备配置路由规则。可选地,缓存集群标识信息为缓存集群编号。配置路由规则包括,为各缓存集群配置编号,并建立查询对象标识信息、上游服务类型信息与缓存集群编号的对应关系。Based on the above technical solution, optionally, the master control device configures routing rules. Optionally, the cache cluster identification information is a cache cluster number. Configuring routing rules includes configuring numbers for each cache cluster and establishing a correspondence between query object identification information, upstream service type information and cache cluster number.

缓存集群用于对其接收到的查询请求进行处理,是指,缓存集群基于其接受到的查询对象的标识信息,查询到除查询对象的标识信息所包括的属性信息之外的其他属性信息。如基于商品ID查询商品的详情信息(即商品的全部属性信息)。The cache cluster is used to process the query request it receives, which means that the cache cluster queries other attribute information besides the attribute information included in the query object's identification information based on the query object it receives, such as querying the detailed information of a product (i.e., all the attribute information of the product) based on the product ID.

需要指出的是,在实际中,查询请求可能仅包括商品查询任务,也可能除包括商品查询任务外还包括其他任务。It should be pointed out that, in practice, the query request may include only the product query task, or may include other tasks in addition to the product query task.

示例性地,商家希望创建某营销活动,将商品A与商品B搭配在一起以活动价进行销售,商家通过其所持终端的客户端向总控设备发送搭配创建请求,搭配创建请求包括商品A与商品B的标识信息(如商品A的链接与商品B的链接)。响应于该搭配创建请求,总控设备需要向客户端返回可搭配商品最小库存单元列表,以辅助商家进一步选择将哪些最小库单元作为参与营销活动的商品,或者为各最小库单元设置活动价格等,进而实现营销活动的创建。此处,搭配创建请求包括商品查询任务,属于本申请提及的查询查询请求,且搭配创建请求仅包括商品查询任务。For example, a merchant wants to create a marketing campaign to sell product A and product B together at a promotional price. The merchant sends a combination creation request to the master control device through the client of the terminal held by the merchant. The combination creation request includes the identification information of product A and product B (such as the link of product A and the link of product B). In response to the combination creation request, the master control device needs to return a list of minimum inventory units of combinable products to the client to assist the merchant in further selecting which minimum inventory units to use as products participating in the marketing campaign, or setting promotional prices for each minimum inventory unit, etc., so as to realize the creation of the marketing campaign. Here, the combination creation request includes a product query task, which belongs to the query request mentioned in this application, and the combination creation request only includes the product query task.

又或者,在购买商品场景中,买家通过其所持终端的客户端打开待购买商品的商品详情页,选择商品属性(如颜色、尺码等),锁定最小库存单元后,选择“立即购买”选项,生成下单请求。下单请求包括买家希望购买的商品的标识信息。客户端将下单请求发送至总控设备。响应于该下单请求,总控设备需要向客户端返回该商品的查询结果,已实现确定该商品的可买态和/或进行客户端的页面渲染等事项。此外,总控设备还需要向客户端返回该商品所参与的营销活动。此处,下单请求包括商品查询任务,属于本申请提及的查询查询请求。此外,该下单请求还包括营销活动查询任务。Alternatively, in a commodity purchase scenario, the buyer opens the commodity details page of the commodity to be purchased through the client of the terminal held by the buyer, selects the commodity attributes (such as color, size, etc.), locks the minimum inventory unit, and selects the "Buy Now" option to generate an order request. The order request includes identification information of the commodity that the buyer wishes to purchase. The client sends the order request to the master control device. In response to the order request, the master control device needs to return the query result of the commodity to the client to determine the purchasable state of the commodity and/or perform page rendering on the client. In addition, the master control device also needs to return the marketing activities in which the commodity participates to the client. Here, the order request includes a commodity query task, which belongs to the query request mentioned in this application. In addition, the order request also includes a marketing activity query task.

上述技术方案通过设置查询处理系统包括N个缓存集群均通讯连接;N为大于或等于2的正整数,并设置总控设备用于接收查询请求,并基于查询对象的标识信息和上游服务类型信息,从N个缓存集群中,确定与查询请求对应的目标缓存集群;将查询请求发送至目标缓存集群。上述技术方案中,由于并不会将每一个查询请求发送至所有的缓存集群,对于任一缓存集群,其不需要处理所有的查询请求,仅需要处理少部分分配至其处的查询请求,可以充分降低单个缓存集群的流量压力,可以降低网络拥塞,进而避免因网络拥塞导致的卡顿和延时。采用上述技术方案,通过增加缓存集群的数目,可以实现任意扩容,即可实现无上限支撑流量增长。The above technical solution is provided by setting up a query processing system including N cache clusters that are all communicatively connected; N is a positive integer greater than or equal to 2, and a master control device is provided to receive query requests, and based on the identification information of the query object and the upstream service type information, the target cache cluster corresponding to the query request is determined from the N cache clusters; the query request is sent to the target cache cluster. In the above technical solution, since not every query request is sent to all cache clusters, for any cache cluster, it does not need to process all query requests, but only needs to process a small number of query requests assigned to it, which can substantially reduce the traffic pressure of a single cache cluster, can reduce network congestion, and thus avoid freezes and delays caused by network congestion. By adopting the above technical solution, arbitrary capacity expansion can be achieved by increasing the number of cache clusters, that is, unlimited support for traffic growth can be achieved.

此外,从图1中的查询处理系统升级改造为本申请提及的查询处理系统,升级改造的难度较小,改造投入较小,改造耗时短。In addition, upgrading the query processing system in FIG. 1 to the query processing system mentioned in the present application is less difficult, requires less investment, and takes less time.

在上述技术方案中,可选地,各缓存集群均包括M个缓存数据存储设备,各缓存数据存储设备均与总控设备通讯连接;隶属于同一缓存集群中的任意两个缓存数据存储设备所存储的数据至少部分不同;M为大于或等于2的正整数;当目标缓存集群对其接收到的查询请求进行处理时,隶属于目标缓存集群中的各缓存数据存储设备均对查询请求进行处理,得到M个第一子查询处理结果,将M个第一子查询处理结果汇总,作为第一查询处理结果。In the above technical scheme, optionally, each cache cluster includes M cache data storage devices, and each cache data storage device is communicatively connected to the master control device; the data stored in any two cache data storage devices belonging to the same cache cluster are at least partially different; M is a positive integer greater than or equal to 2; when the target cache cluster processes the query request it receives, each cache data storage device belonging to the target cache cluster processes the query request to obtain M first sub-query processing results, and the M first sub-query processing results are summarized as the first query processing result.

在一个实施例中,缓存数据存储设备具体可以为redis物理集群。In one embodiment, the cache data storage device may specifically be a redis physical cluster.

通过设置各缓存集群均包括M个缓存数据存储设备,是指,利用多个缓存数据存储设备,共同对商品的属性信息进行存储,M个缓存数据存储设备在该查询处理系统中的地位是平等的。By setting each cache cluster to include M cache data storage devices, it means that multiple cache data storage devices are used to jointly store the attribute information of the commodity, and the M cache data storage devices have equal status in the query processing system.

隶属于同一缓存集群中的任意两个缓存数据存储设备所存储的数据至少部分不同,是指,同一缓存集群中的任意两个缓存数据存储设备所存储的数据不完全相同。示例性地,某缓存集群包括2个缓存数据存储设备,其中一个缓存数据存储设备用于存储商品的用户评价信息,另一个缓存数据存储设备用于存储商品的名称及用于展示商品属性的图片信息。显然,与图1中的方案相比,这样设置可以实现扩容的目的,可以解决单个redis物理集群数据存储容量有限的问题。The data stored in any two cache data storage devices belonging to the same cache cluster are at least partially different, which means that the data stored in any two cache data storage devices in the same cache cluster are not exactly the same. Exemplarily, a cache cluster includes 2 cache data storage devices, one of which is used to store user evaluation information of goods, and the other is used to store the name of the goods and picture information for displaying the attributes of the goods. Obviously, compared with the solution in Figure 1, such a setting can achieve the purpose of capacity expansion and solve the problem of limited data storage capacity of a single redis physical cluster.

在上述各技术方案的基础上,可选地,该查询处理系统还包括源集群,源集群与总控设备通讯连接;总控设备基于第一查询处理结果,判断目标缓存集群对查询请求是否处理成功。若目标缓存集群对查询请求处理成功,总控设备将第一查询处理结果发送至客户端。若目标缓存集群对查询请求处理失败,总控设备将查询请求发送至源集群;源集群对该查询请求进行处理,得到第二查询处理结果,并将第二查询处理结果发送至总控设备;总控设备将第二查询处理结果发送至客户端。On the basis of the above technical solutions, optionally, the query processing system further includes a source cluster, which is in communication connection with the master control device; the master control device determines whether the target cache cluster successfully processes the query request based on the first query processing result. If the target cache cluster successfully processes the query request, the master control device sends the first query processing result to the client. If the target cache cluster fails to process the query request, the master control device sends the query request to the source cluster; the source cluster processes the query request to obtain a second query processing result, and sends the second query processing result to the master control device; the master control device sends the second query processing result to the client.

本领域技术人员可以理解,目标缓存集群对查询请求处理的处理结果包括两种情况,查询请求处理成功和查询请求处理失败。查询请求处理成功,是指查询到查询请求中查询对象的其他属性信息。查询请求处理失败,是指未查询到查询请求中查询对象的其他属性信息。出现查询请求处理失败的原因有多种,如,目标缓存集群中未存储有查询对象的属性信息,或者,目标缓存集群故障。Those skilled in the art can understand that the processing results of the query request by the target cache cluster include two situations, successful query request processing and failed query request processing. Successful query request processing means that other attribute information of the query object in the query request is queried. Failed query request processing means that other attribute information of the query object in the query request is not queried. There are many reasons for the failure of query request processing, such as the target cache cluster does not store the attribute information of the query object, or the target cache cluster fails.

源集群可以持久化地对商品的属性信息进行存储。源集群包括全部的商品信息。通过设置在目标缓存集群对查询请求处理失败的情况下,利用源集群对查询请求进行处理,可以确保最终返回至客户端的查询处理结果(即第二查询处理结果),是对用户有用的,是用户需要的结果。The source cluster can store the attribute information of the product persistently. The source cluster includes all the product information. By setting the source cluster to process the query request when the target cache cluster fails to process the query request, it can be ensured that the query processing result (i.e., the second query processing result) finally returned to the client is useful to the user and is the result the user needs.

进一步地,将第二查询处理结果保存至各缓存集群中。对于目标缓存集群中未存储有查询对象的属性信息的情况,由于在查询查询对象时,优先查询缓存集群,将第二查询处理结果保存至各缓存集群中,可以确保后续再次出现查询该查询对象的查询请求时,能够快速得到该查询对象的查询结果,提高该查询对象的查询效率。Furthermore, the second query processing result is saved in each cache cluster. In the case where the target cache cluster does not store the attribute information of the query object, since the cache cluster is queried first when querying the query object, the second query processing result is saved in each cache cluster, which can ensure that when a query request for querying the query object appears again in the future, the query result of the query object can be quickly obtained, thereby improving the query efficiency of the query object.

在一个实施例中,源集群通过MySQL实现。In one embodiment, the source cluster is implemented by MySQL.

在实际中,N个缓存集群存储的缓存数据可以相同,也可以不同。In practice, the cache data stored in the N cache clusters may be the same or different.

若N个缓存集群存储的缓存数据相同,在对路由规则进行配置时,可以降低路由规则的配置难度,提高路由规则的配置效率。在某个缓存集群故障时,便于更新该路由规则。If the cache data stored in N cache clusters is the same, when configuring routing rules, the difficulty of configuring routing rules can be reduced and the efficiency of configuring routing rules can be improved. When a cache cluster fails, it is easy to update the routing rules.

图3为本公开实施例提供的一种查询处理方法的流程图。参见图3,该查询处理方法由图2中查询处理系统中的总控设备执行。参见图3,该查询处理方法包括:FIG3 is a flow chart of a query processing method provided by an embodiment of the present disclosure. Referring to FIG3 , the query processing method is executed by a master control device in the query processing system in FIG2 . Referring to FIG3 , the query processing method includes:

S110、获取客户端发送的查询请求;查询请求包括查询对象的标识信息和上游服务类型信息。S110, obtaining a query request sent by the client; the query request includes identification information of the query object and upstream service type information.

S120、基于查询对象的标识信息和上游服务类型信息,从N个缓存集群中,确定与查询请求对应的目标缓存集群;N为大于或等于2的正整数。S120 . Determine a target cache cluster corresponding to the query request from N cache clusters based on the identification information of the query object and the upstream service type information; N is a positive integer greater than or equal to 2.

S130、将查询请求发送至目标缓存集群。S130: Send the query request to the target cache cluster.

S140、接收目标缓存集群发送的第一查询处理结果,第一查询处理结果由目标缓存集群对查询请求进行处理得到。S140: Receive a first query processing result sent by a target cache cluster, where the first query processing result is obtained by the target cache cluster processing the query request.

S150、将第一查询处理结果发送至客户端。S150: Send the first query processing result to the client.

上述技术方案通过设置获取客户端发送的查询请求;查询请求包括查询对象的标识信息和上游服务类型信息;基于查询对象的标识信息和上游服务类型信息,从N个缓存集群中,确定与查询请求对应的目标缓存集群;N为大于或等于2的正整数;将查询请求发送至目标缓存集群。上述技术方案中,由于并不会将每一个查询请求发送至所有的缓存集群,对于任一缓存集群,其不需要处理所有的查询请求,仅需要处理少部分分配至其处的查询请求,可以充分降低单个缓存集群的流量压力,可以降低网络拥塞,进而避免因网络拥塞导致的卡顿和延时。采用上述技术方案,通过增加缓存集群的数目,可以实现任意扩容,即可实现无上限支撑流量增长。The above technical solution is set to obtain the query request sent by the client; the query request includes the identification information of the query object and the upstream service type information; based on the identification information of the query object and the upstream service type information, the target cache cluster corresponding to the query request is determined from N cache clusters; N is a positive integer greater than or equal to 2; the query request is sent to the target cache cluster. In the above technical solution, since not every query request is sent to all cache clusters, for any cache cluster, it does not need to process all query requests, but only needs to process a small number of query requests assigned to it, which can fully reduce the traffic pressure of a single cache cluster, reduce network congestion, and thus avoid freezes and delays caused by network congestion. By adopting the above technical solution, arbitrary capacity expansion can be achieved by increasing the number of cache clusters, which can achieve unlimited support for traffic growth.

进一步地,N个缓存集群存储的缓存数据相同。Furthermore, the cache data stored in the N cache clusters are the same.

进一步地,S120可替换为:基于查询对象的标识信息和上游服务类型信息,结合路由规则,从N个缓存集群中,确定与查询请求对应的目标缓存集群;路由规则包括标识信息、上游服务类型信息以及缓存集群三者的对应关系。Furthermore, S120 can be replaced by: based on the identification information and upstream service type information of the query object, combined with routing rules, determine the target cache cluster corresponding to the query request from N cache clusters; the routing rules include the correspondence between the identification information, upstream service type information and cache clusters.

进一步地,S150之前,该方法还包括:Furthermore, before S150, the method further includes:

基于第一查询处理结果,判断目标缓存集群对查询请求是否处理成功;S150可替换为:若目标缓存集群对查询请求处理成功,将第一查询处理结果发送至客户端;若目标缓存集群对查询请求处理失败,将查询请求发送至源集群;接收源集群发送的第二查询处理结果,第二查询处理结果由源集群对查询请求进行处理得到;将第二查询处理结果发送至客户端。Based on the first query processing result, determine whether the target cache cluster processes the query request successfully; S150 can be replaced by: if the target cache cluster processes the query request successfully, send the first query processing result to the client; if the target cache cluster fails to process the query request, send the query request to the source cluster; receive the second query processing result sent by the source cluster, the second query processing result is obtained by the source cluster processing the query request; send the second query processing result to the client.

进一步地,该方法还包括:将第二查询处理结果保存至各缓存集群中。Furthermore, the method also includes: saving the second query processing result in each cache cluster.

进一步地,各缓存集群均包括M个缓存数据存储设备,隶属于同一缓存集群中的任意两个缓存数据存储设备所存储的数据至少部分不同;M为大于或等于2的正整数;Further, each cache cluster includes M cache data storage devices, and data stored in any two cache data storage devices belonging to the same cache cluster are at least partially different; M is a positive integer greater than or equal to 2;

第一查询处理结果为M个第一子查询处理结果的汇总结果,第一子查询处理结果由目标缓存集群中一个缓存数据存储设备对查询请求进行处理得到。The first query processing result is a summary result of M first sub-query processing results, and the first sub-query processing result is obtained by processing the query request by a cache data storage device in the target cache cluster.

进一步地,查询请求为包括商品查询任务的请求,查询对象为待查询商品,查询对象的标识信息为商品ID。Furthermore, the query request is a request including a commodity query task, the query object is the commodity to be queried, and the identification information of the query object is the commodity ID.

需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

图4为本公开实施例中的一种查询处理装置的结构示意图。本公开实施例所提供的查询处理装置可以配置于图2中的总控设备中。参见图4,该查询处理装置具体包括:FIG4 is a schematic diagram of the structure of a query processing device in an embodiment of the present disclosure. The query processing device provided in the embodiment of the present disclosure can be configured in the master control device in FIG2. Referring to FIG4, the query processing device specifically includes:

获取模块310,用于获取客户端发送的查询请求;所述查询请求包括查询对象的标识信息和上游服务类型信息;The acquisition module 310 is used to acquire the query request sent by the client; the query request includes the identification information of the query object and the upstream service type information;

路由控制模块320,用于基于所述查询对象的标识信息和上游服务类型信息,从N个缓存集群中,确定与所述查询请求对应的目标缓存集群;N为大于或等于2的正整数;The routing control module 320 is used to determine a target cache cluster corresponding to the query request from N cache clusters based on the identification information of the query object and the upstream service type information; N is a positive integer greater than or equal to 2;

第一发送模块330,用于将所述查询请求发送至所述目标缓存集群;A first sending module 330, configured to send the query request to the target cache cluster;

接收模块340,用于接收所述目标缓存集群发送的第一查询处理结果,所述第一查询处理结果由所述目标缓存集群对所述查询请求进行处理得到;A receiving module 340 is configured to receive a first query processing result sent by the target cache cluster, where the first query processing result is obtained by the target cache cluster processing the query request;

第二发送模块350,用于将所述第一查询处理结果发送至所述客户端。The second sending module 350 is used to send the first query processing result to the client.

进一步地,N个所述缓存集群存储的缓存数据相同。Furthermore, the cache data stored in the N cache clusters are the same.

进一步地,路由控制模块320,用于基于所述查询对象的标识信息和上游服务类型信息,结合路由规则,从N个缓存集群中,确定与所述查询请求对应的目标缓存集群;所述路由规则包括标识信息、上游服务类型信息以及缓存集群三者的对应关系。Furthermore, the routing control module 320 is used to determine the target cache cluster corresponding to the query request from N cache clusters based on the identification information and upstream service type information of the query object in combination with routing rules; the routing rules include the correspondence between the identification information, upstream service type information and cache cluster.

进一步地,该装置还包括判断模块,判断模块用于在将所述第一查询处理结果发送至所述客户端之前,基于所述第一查询处理结果,判断所述目标缓存集群对所述查询请求是否处理成功;Furthermore, the device further includes a judgment module, which is used to judge whether the target cache cluster successfully processes the query request based on the first query processing result before sending the first query processing result to the client;

所述第二发送模块,用于若所述目标缓存集群对所述查询请求处理成功,将所述第一查询处理结果发送至所述客户端。The second sending module is configured to send the first query processing result to the client if the target cache cluster processes the query request successfully.

所述第一发送模块,还用于若所述目标缓存集群对所述查询请求处理失败,将所述查询请求发送至源集群;The first sending module is further configured to send the query request to the source cluster if the target cache cluster fails to process the query request;

所述接收模块,还用于接收所述源集群发送的第二查询处理结果,所述第二查询处理结果由所述源集群对所述查询请求进行处理得到;The receiving module is further configured to receive a second query processing result sent by the source cluster, where the second query processing result is obtained by the source cluster processing the query request;

所述第二发送模块,还用于将所述第二查询处理结果发送至所述客户端。The second sending module is further used to send the second query processing result to the client.

进一步地,所述装置还包括保存模块,所述保存模块还用于将所述第二查询处理结果保存至各所述缓存集群中。Furthermore, the device further comprises a saving module, and the saving module is further used to save the second query processing result to each of the cache clusters.

进一步地,各所述缓存集群均包括M个缓存数据存储设备,隶属于同一所述缓存集群中的任意两个所述缓存数据存储设备所存储的数据至少部分不同;M为大于或等于2的正整数;Furthermore, each cache cluster includes M cache data storage devices, and data stored in any two cache data storage devices belonging to the same cache cluster are at least partially different; M is a positive integer greater than or equal to 2;

所述第一查询处理结果为M个第一子查询处理结果的汇总结果,所述第一子查询处理结果由所述目标缓存集群中一个所述缓存数据存储设备对所述查询请求进行处理得到。The first query processing result is a summary result of M first sub-query processing results, and the first sub-query processing result is obtained by processing the query request by one of the cache data storage devices in the target cache cluster.

进一步地,所述查询请求为包括商品查询任务的请求,所述查询对象为待查询商品,所述查询对象的标识信息包括商品ID。Furthermore, the query request is a request including a commodity query task, the query object is a commodity to be queried, and the identification information of the query object includes a commodity ID.

本公开实施例提供的查询处理装置,可执行本公开方法实施例所提供的查询处理方法中客户端或服务端所执行的步骤,具备执行步骤和有益效果,此处不再赘述。The query processing device provided in the embodiment of the present disclosure can execute the steps executed by the client or server in the query processing method provided in the embodiment of the method of the present disclosure, and has execution steps and beneficial effects, which will not be repeated here.

图5为本公开实施例中的一种电子设备的结构示意图。下面具体参考图5,其示出了适于用来实现本公开实施例中的电子设备1000的结构示意图。本公开实施例中的电子设备1000可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)、可穿戴电子设备等等的移动终端以及诸如数字TV、台式计算机、智能家居设备等等的固定终端。图5示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。FIG5 is a schematic diagram of the structure of an electronic device in an embodiment of the present disclosure. Referring specifically to FIG5 below, it shows a schematic diagram of the structure of an electronic device 1000 suitable for implementing an embodiment of the present disclosure. The electronic device 1000 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), wearable electronic devices, etc., and fixed terminals such as digital TVs, desktop computers, smart home devices, etc. The electronic device shown in FIG5 is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.

如图5所示,电子设备1000可以包括处理装置(例如中央处理器、图形处理器等)1001,其可以根据存储在只读存储器(ROM)1002中的程序或者从存储装置1008加载到随机访问存储器(RAM)1003中的程序而执行各种适当的动作和处理以实现如本公开所述的实施例的查询处理方法。在RAM 1003中,还存储有电子设备1000操作所需的各种程序和信息。处理装置1001、ROM 1002以及RAM 1003通过总线1004彼此相连。输入/输出(I/O)接口1005也连接至总线1004。As shown in FIG5 , the electronic device 1000 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 into a random access memory (RAM) 1003 to implement the query processing method of the embodiment described in the present disclosure. In the RAM 1003, various programs and information required for the operation of the electronic device 1000 are also stored. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input/output (I/O) interface 1005 is also connected to the bus 1004.

通常,以下装置可以连接至I/O接口1005:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置1006;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置1007;包括例如磁带、硬盘等的存储装置1008;以及通信装置1009。通信装置1009可以允许电子设备1000与其他设备进行无线或有线通信以交换信息。虽然图5示出了具有各种装置的电子设备1000,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。Typically, the following devices may be connected to the I/O interface 1005: input devices 1006 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1008 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication devices 1009 may allow the electronic device 1000 to communicate wirelessly or wired with other devices to exchange information. Although FIG. 5 shows an electronic device 1000 with various devices, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have alternatively.

特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码,从而实现如上所述的查询处理方法。在这样的实施例中,该计算机程序可以通过通信装置1009从网络上被下载和安装,或者从存储装置1008被安装,或者从ROM 1002被安装。在该计算机程序被处理装置1001执行时,执行本公开实施例的方法中限定的上述功能。In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart, thereby implementing the query processing method as described above. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1009, or installed from the storage device 1008, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的信息信号,其中承载了计算机可读的程序代码。这种传播的信息信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include an information signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated information signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

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

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

上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:

获取客户端发送的查询请求;所述查询请求包括查询对象的标识信息和上游服务类型信息;Obtaining a query request sent by a client; the query request includes identification information of a query object and upstream service type information;

基于所述查询对象的标识信息和上游服务类型信息,从N个缓存集群中,确定与所述查询请求对应的目标缓存集群;N为大于或等于2的正整数;Based on the identification information of the query object and the upstream service type information, determine the target cache cluster corresponding to the query request from N cache clusters; N is a positive integer greater than or equal to 2;

将所述查询请求发送至所述目标缓存集群;Sending the query request to the target cache cluster;

接收所述目标缓存集群发送的第一查询处理结果,所述第一查询处理结果由所述目标缓存集群对所述查询请求进行处理得到;receiving a first query processing result sent by the target cache cluster, where the first query processing result is obtained by the target cache cluster processing the query request;

将所述第一查询处理结果发送至所述客户端。The first query processing result is sent to the client.

可选的,当上述一个或者多个程序被该电子设备执行时,该电子设备还可以执行上述实施例所述的其他步骤。Optionally, when the above one or more programs are executed by the electronic device, the electronic device may also execute other steps described in the above embodiments.

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

附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and/or flow chart, and the combination of the square boxes in the block diagram and/or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

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

本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

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

根据本公开的一个或多个实施例,本公开提供了一种电子设备,包括:According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device, including:

一个或多个处理器;one or more processors;

存储器,用于存储一个或多个程序;A memory for storing one or more programs;

当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如本公开提供的任一所述的查询处理方法。When the one or more programs are executed by the one or more processors, the one or more processors implement any query processing method provided in the present disclosure.

根据本公开的一个或多个实施例,本公开提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本公开提供的任一所述的查询处理方法。According to one or more embodiments of the present disclosure, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the query processing method as described in any one of the above is implemented.

本公开实施例还提供了一种计算机程序产品,该计算机程序产品包括计算机程序或指令,该计算机程序或指令被处理器执行时实现如上所述的查询处理方法。The embodiments of the present disclosure further provide a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the query processing method described above is implemented.

需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

以上所述仅是本公开的具体实施方式,使本领域技术人员能够理解或实现本公开。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文所述的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. 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 disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims (13)

CN202211713914.3A2022-12-292022-12-29 Query processing method, device, system, electronic device and storage mediumPendingCN118277423A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202211713914.3ACN118277423A (en)2022-12-292022-12-29 Query processing method, device, system, electronic device and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202211713914.3ACN118277423A (en)2022-12-292022-12-29 Query processing method, device, system, electronic device and storage medium

Publications (1)

Publication NumberPublication Date
CN118277423Atrue CN118277423A (en)2024-07-02

Family

ID=91636574

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202211713914.3APendingCN118277423A (en)2022-12-292022-12-29 Query processing method, device, system, electronic device and storage medium

Country Status (1)

CountryLink
CN (1)CN118277423A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN118503295A (en)*2024-07-122024-08-16宁波银行股份有限公司Service processing method and service processing device
CN118820536A (en)*2024-09-192024-10-22杭州悦数科技有限公司 A graph database load balancing method and device based on request type

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN118503295A (en)*2024-07-122024-08-16宁波银行股份有限公司Service processing method and service processing device
CN118820536A (en)*2024-09-192024-10-22杭州悦数科技有限公司 A graph database load balancing method and device based on request type

Similar Documents

PublicationPublication DateTitle
CN102810193B (en)Method and system for displaying information of associated product
US20190295036A1 (en)Method and apparatus for planning route
EP4425413A1 (en)Information display method and apparatus, electronic device, and storage medium
CN118277423A (en) Query processing method, device, system, electronic device and storage medium
CN107463675B (en)Data processing method and system
CN112884405A (en)Inquiry system and scheduling method thereof
CN111309254B (en) Data processing method, device, readable medium and electronic device
CN114418697A (en) Information display method, device and electronic device
CN112036802A (en)Article replenishment information display method and device, electronic equipment and readable medium
CN114066363A (en)Order information processing method and device, electronic equipment and computer readable medium
CN111552715B (en)User query method and device
CN113554493B (en)Interactive ordering method, device, electronic equipment and computer readable medium
CN118264821A (en) A method, device, equipment and medium for recommending live broadcast rooms
CN114817409A (en)Label generation method, device, equipment and medium
CN111861293B (en)Method and device for transmitting information
CN118277436A (en) Information query method, device, equipment and medium
CN110826948B (en) Warehouse product selection methods and devices
CN112102043A (en)Item recommendation page generation method and device, electronic equipment and readable medium
CN113256362A (en)Method and apparatus for outputting information
CN112348427A (en) Order processing method, apparatus, computer system and readable storage medium
CN118674513A (en) Object display method, device, equipment, storage medium and program product
CN111652694B (en)Order processing method and device and electronic equipment
CN110956514A (en)Method and device for generating order information
CN110956478A (en) Method and device for determining incoming quantity of items
CN113112285B (en)Data analysis method and device

Legal Events

DateCodeTitleDescription
PB01Publication

[8]ページ先頭

©2009-2025 Movatter.jp