Hotel query method and device based on memory calculation, and electronic equipment

By adopting a memory-based computing method in the hotel search system and using memory cache shards to store hotel information, the existing technology problems of low hotel search efficiency, poor system scalability and data consistency are solved, achieving high efficiency, scalability and consistency. Excellent hotel search function.

CN119357238APending Publication Date: 2025-01-24TRAVELSKY TECHNOLOGY LIMITED
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411495221.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

Existing hotel search methods are difficult to support large concurrent and high-performance queries under massive data, poor system scalability, and data consistency between cache and database is difficult to ensure.

Method used

Adopting a hotel query method based on memory computing, by setting up N memory cache shards on the cache end, each shard corresponds to at least one city area, stores information in all registered hotels in the urban area in advance to achieve fuzzy and precise search, and and also searches. Evaluate the amount of memory cache occupation in each city area based on hotel data and housing prices, and synchronize sharding and data to ensure data consistency.

Benefits of technology

It improves the query efficiency and response time of hotel search, supports large concurrency query, enhances the scalability of the system, and ensures high data consistency between the cache and the database.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357238A_ABST
    Figure CN119357238A_ABST
Patent Text Reader

Abstract

The invention discloses a hotel query method and device based on memory calculation and electronic equipment, and relates to the field of hotel search or other related technical fields, and the method comprises the following steps: responding to a hotel query request, searching hotel information in a cache end to obtain a fuzzy search result, and based on the fuzzy search result, searching the hotel information in the cache end; the method comprises the following steps: searching hotel information corresponding to a search condition of a specified area to obtain an accurate search result, screening hotel sets to be recommended which meet hotel sales plan field requirements from the accurate search result, sorting the hotel sets to be recommended, and outputting recommended hotel interface information, hotel information of all registered hotels in the urban area is pre-stored in the memory cache fragment. The technical problems of low query efficiency and long query response time during hotel search in related technologies are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of hotel recommendation or other related fields, and in particular to a hotel query method based on memory calculation, a device thereof, and an electronic device. Background Art

[0002] There are many sources of suppliers in the hotel distribution industry. The hotel distribution platform needs to aggregate a large number of hotel resources from different suppliers and sell them uniformly to distribution channels. Hotel search is the core function of the hotel distribution platform.

[0003] In the related technologies, the industry generally directly uses the database to implement the search function, or uses the construction of a distributed cache system to improve query performance. However, this hotel search method has the following problems: first, the database query efficiency is low in large-scale data and multi-level connections, the query response time is long, and it cannot support large concurrent data queries; second, the distributed cache belongs to a remote cache system, and hotel queries need to retrieve a large amount of data, which will affect the system query performance; third, the scalability is relatively poor, and it cannot quickly support the horizontal expansion of large-scale data storage; fourth, it cannot guarantee the data consistency between the high-level cache and the database.

[0004] It can be seen that the current hotel search method cannot support large concurrency and high-performance queries under massive data, the system scalability is poor, and the consistency of cached data is difficult to ensure.

[0005] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0006] The embodiment of the present invention provides a hotel query method based on memory calculation, a device thereof, and an electronic device, so as to at least solve the technical problems of low query efficiency and long query response time when searching for hotels in the related art.

[0007] According to one aspect of an embodiment of the present invention, a hotel query method based on memory computing is provided, comprising: responding to a hotel query request, searching for hotel information in a cache end, and obtaining fuzzy search results, wherein the cache end includes N memory cache slices, each of the memory cache slices corresponds to at least one city area, and the memory cache slices pre-store hotel information of all registered hotels in the city area, and the fuzzy search results at least include: a hotel code list, a hotel name, and a hotel address, where N is a positive integer greater than 1; based on the fuzzy search results, retrieving hotel information corresponding to a search condition in a specified area to obtain precise search results, wherein the precise search results at least include: the city area to which the hotel belongs, and the hotel grade; filtering out a set of proposed recommended hotels that meet the requirements of the hotel sales plan field from the precise search results; sorting the set of proposed recommended hotels, and outputting recommended hotel interface information.

[0008] Optionally, the hotel query method based on memory calculation also includes: counting hotel data and room price data of each type of room in each urban area, and evaluating the memory cache occupancy of each urban area based on the hotel data and the room price data; accumulating the memory cache occupancy of all urban areas to obtain the total memory cache occupancy; determining the number of shards based on the total memory cache occupancy, server memory capacity and memory usage rate; sorting according to the memory cache occupancy of each urban area, and allocating each urban area to a corresponding memory cache shard according to a preset serpentine grouping strategy; and storing the mapping relationship between the urban area and the memory cache shard to the cache end.

[0009] Optionally, the step of evaluating the occupancy of the memory cache by each of the city areas based on the hotel data and the housing price data also includes: obtaining a first occupancy coefficient corresponding to the hotel data of each of the city areas, and obtaining a second occupancy coefficient corresponding to the housing price data of each type of room; combining the hotel data of each of the city areas and the corresponding first occupancy coefficient, the housing price data of each type of room and the corresponding second occupancy coefficient, to calculate the occupancy of the memory cache by each of the city areas.

[0010] Optionally, in response to a hotel query request, searching for hotel information in the cache end to obtain a fuzzy search result step also includes: starting a search engine call entry; using the search engine call entry to access the global shard in the cache end; indexing a specified shard according to the city code carried in the hotel query request, performing a hotel query operation in the specified shard, and obtaining a fuzzy search result.

[0011] Optionally, the hotel query method based on memory computing also includes: obtaining original hotel data of the hotel to be sold; preprocessing the original hotel data to obtain hotel standardized data, wherein the preprocessing includes: extracting multi-dimensional features of the original hotel data, the multi-dimensional features include at least one of the following: static information, dynamic information; and persistently storing the hotel standardized data in a database.

[0012] Optionally, the step of preprocessing the original hotel data to obtain hotel standardized data includes: extracting the hotel name, hotel address, hotel city area, hotel business district, hotel brand, hotel grade, and hotel code from the original hotel data to obtain static information; extracting the room price data, bed type data, payment method, guarantee method, and price range of each type of room in each query interval from the original hotel data to obtain dynamic information; and generating the hotel standardized data based on the static information and the dynamic information.

[0013] Optionally, after persistently storing the hotel standardized data in the database, the method further includes: synchronously storing the hotel standardized data in the cache end and the memory cache.

[0014] According to another aspect of an embodiment of the present invention, a hotel query device based on memory computing is also provided, including: a hotel search unit, used to respond to hotel query requests, search for hotel information in a cache end, and obtain fuzzy search results, wherein the cache end includes N memory cache slices, each of which corresponds to at least one city area, and the memory cache slices pre-store hotel information of all registered hotels in the city area, and the fuzzy search results at least include: a hotel code list, a hotel name, and a hotel address, where N is a positive integer greater than 1; a hotel retrieval unit, based on the fuzzy search results, retrieves hotel information corresponding to a specified area search condition to obtain an accurate search result, wherein the accurate search results at least include: the city area to which the hotel belongs, and the hotel grade; a screening unit, used to screen out a set of recommended hotels that meet the requirements of the hotel sales plan field from the accurate search results; a sorting unit, used to sort the set of recommended hotels and output recommended hotel interface information.

[0015] Optionally, the hotel query device based on memory calculation also includes: a room price statistics unit, which is used to count the hotel data of each city area and the room price data of each type of room, and evaluate the occupancy of each city area for the memory cache based on the hotel data and the room price data; an occupancy accumulation unit, which is used to accumulate the occupancy of all the city areas for the memory cache to obtain the total memory cache occupancy; a sharding unit, which is used to determine the number of shards according to the total memory cache occupancy, the server memory amount and the memory usage rate; a city grouping unit, which is used to sort according to the occupancy of each city area for the memory cache, and according to a preset serpentine grouping strategy, assign each of the city areas to a corresponding memory cache shard; a mapping relationship storage unit, which is used to store the mapping relationship between the city area and the memory cache shard to the cache end.

[0016] Optionally, the house price statistics unit includes: a coefficient acquisition module, used to obtain a first occupancy coefficient corresponding to the hotel data of each of the urban areas, and to obtain a second occupancy coefficient corresponding to the house price data of each type of room; an occupancy calculation module, used to calculate the occupancy of the memory cache of each of the urban areas by combining the hotel data of each of the urban areas and the corresponding first occupancy coefficient, the house price data of each type of room and the corresponding second occupancy coefficient.

[0017] Optionally, the hotel search unit includes: a call entry startup module, used to start the search engine call entry; a shard access module, used to use the search engine call entry to access the global shard in the cache end; a hotel query module, used to specify the shard according to the city code index carried in the hotel query request, perform a hotel query operation in the specified shard, and obtain fuzzy search results.

[0018] Optionally, the hotel query device based on memory computing also includes: an original hotel data acquisition unit, used to acquire the original hotel data of the hotel to be sold; a hotel data preprocessing unit, used to preprocess the original hotel data to obtain hotel standardized data, wherein the preprocessing includes: extracting multi-dimensional features of the original hotel data, and the multi-dimensional features include at least one of the following: static information, dynamic information; a hotel standardized data storage unit, used to persistently store the hotel standardized data in a database.

[0019] Optionally, the hotel data preprocessing unit includes: a first hotel information extraction module, used to extract the hotel name, hotel address, hotel city area, hotel business district, hotel brand, hotel grade, and hotel code from the original hotel data to obtain static information; a second hotel information extraction module, used to extract the room price data, bed type data, payment method, guarantee method, and price range of each type of room in each query interval from the original hotel data to obtain dynamic information; and a standardized data generation module, which generates the hotel standardized data based on the static information and the dynamic information.

[0020] Optionally, the hotel query device based on memory computing further includes: a data synchronization unit, which is used to synchronously store the hotel standardized data in the cache end and the memory cache after persistently storing the hotel standardized data in the database.

[0021] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium including a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned hotel query methods based on memory computing.

[0022] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement any one of the above-mentioned hotel query methods based on memory computing.

[0023] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, which implements any one of the steps of the above-mentioned hotel query method based on memory computing when executed by a processor.

[0024] In the present disclosure, in response to a hotel query request, hotel information is searched in the cache end to obtain fuzzy search results, based on the fuzzy search results, hotel information corresponding to the search conditions in the specified area is retrieved to obtain precise search results, and a set of proposed recommended hotels that meet the requirements of the hotel sales plan field are screened out from the precise search results; the set of proposed recommended hotels is sorted, and recommended hotel interface information is output, wherein the cache end includes N memory cache shards, each memory cache shard corresponds to at least one city area, and the memory cache shards pre-store hotel information of all registered hotels in the city area, the fuzzy search results include at least: hotel code list, hotel name, hotel address, and the precise search results include at least: the city area to which the hotel belongs and the hotel grade.

[0025] Based on the above public content, it is possible to traverse the hotel information in the cache end, first obtain fuzzy search results that meet the basic search conditions, further query the hotel information of the specified area search conditions, obtain accurate search results, and filter out recommended hotels that meet the requirements of the hotel sales plan field. Finally, sort and page the result list according to the sorting method, and return the final query result, thereby solving the technical problems of low query efficiency and long query response time when searching for hotels in related technologies.

[0026] The present disclosure can be applied to a hotel distribution platform, and the data sources accessed include: different types of suppliers such as hotel groups and hotel wholesalers. Compared with the prior art, different types of supplier interfaces have different data standards and cannot achieve data sharing. In this embodiment, a unified data standard may be formulated in the hotel distribution platform, and the supplier data is standardized and stored in a local database. Then, a search engine is built based on the local data to achieve a combined search function including multiple dimensions such as city, administrative area, star rating, name, address, keyword, location information, price range, etc. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0028] Figure 1 is a flow chart of an optional hotel query method based on memory calculation according to an embodiment of the present invention;

[0029] Figure 2 is a flowchart of another optional hotel search method based on memory calculation according to an embodiment of the present invention;

[0030] Figure 3 is another optional flowchart of multi-level cache construction and data synchronization according to an embodiment of the present invention;

[0031] Figure 4 is a flow chart of an optional cache sharding method according to an embodiment of the present invention;

[0032] Figure 5 is a schematic diagram of allocating city areas to memory cache shards according to an embodiment of the present invention;

[0033] Figure 6 is a schematic diagram of an optional memory cache cluster according to an embodiment of the present invention;

[0034] Figure 7 is a schematic diagram of an optional hotel query system based on memory computing according to an embodiment of the present invention;

[0035] Figure 8 is a schematic diagram of an optional hotel query device based on memory computing according to an embodiment of the present invention;

[0036] Fig. 9 The present invention is a hardware structure block diagram of an electronic device (or mobile device) that executes a hotel query method based on memory calculation according to an embodiment of the present invention. DETAILED DESCRIPTION

[0037] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings 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 interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0039] It should be noted that the hotel query method based on memory computing and the device thereof in the present disclosure can be used in the field of hotel search technology. When realizing precise hotel search based on memory computing, it can also be used in any field other than the field of hotel search technology. When realizing precise hotel search based on memory computing, the present disclosure does not limit the application field of the hotel query method based on memory computing and the device thereof.

[0040] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) collected by this disclosure are information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with the relevant laws, regulations and standards of the relevant regions, necessary confidentiality measures are taken, and public order and good customs are not violated, and corresponding operation portals are provided for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.

[0041] It should be noted that in the present disclosure, when collecting and analyzing customer information, corresponding operation entrances are provided for users to choose to agree or reject the automated decision results; if the user chooses to reject, the expert decision-making process is entered.

[0042] The following embodiments of the present invention can be applied to various hotel distribution platforms, or systems / applications / devices for hotel queries based on memory computing. The present invention can establish a multi-level cache structure (including a three-level structure of memory, distributed cache, and database), use the multi-level cache structure to persistently store the original hotel data that has been acquired, and perform shard storage according to the city area to which the hotel belongs. Further, after receiving a hotel query request, a fuzzy search can be performed first, and a hotel code list can be returned. Then, the hotel code list can be added to the static precise search conditions for further search, and the static information of each hotel can be traversed in the memory cache. For hotels that meet the conditions, the dynamic information cache is further queried. If the dynamic search conditions are met, the query result of the hotel is generated and added to the result list. Finally, the result list is sorted and paginated according to the sorting method, and the final query result is returned.

[0043] At the same time, in the present invention, the data sources accessed by the hotel distribution platform include: hotel groups, hotel wholesalers and other different types of suppliers. Compared with the prior art, different types of supplier interfaces have different data standards and cannot achieve data sharing. In this embodiment, a unified data standard may be formulated in the hotel distribution platform, and the supplier data is standardized and stored in a local database. Then, a search engine is built based on the local data to achieve a combined search function including multiple dimensions such as city, administrative area, star rating, name, address, keyword, location information, price range, etc.

[0044] The present invention is described in detail below in conjunction with various embodiments.

[0045] Embodiment 1

[0046] According to an embodiment of the present invention, an embodiment of a hotel query method based on memory computing is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0047] Figure 1 is a flowchart of an optional hotel query method based on memory computing according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:

[0048] Step S101, responding to a hotel query request, searching for hotel information in a cache, and obtaining fuzzy search results.

[0049] Among them, the cache end includes N memory cache shards, each memory cache shard corresponds to at least one city area, and the memory cache shard pre-stores hotel information of all registered hotels in the city area. The fuzzy search results at least include: hotel code list, hotel name, hotel address, and N is a positive integer greater than 1.

[0050] Optionally, step S101 includes: starting a search engine call entry; using the search engine call entry to access the global shard in the cache end; indexing a specified shard according to the city code carried in the hotel query request, performing a hotel query operation in the specified shard, and obtaining fuzzy search results.

[0051] It should be noted that the search engine calling entry mentioned in this embodiment may refer to the calling entry used by the hotel distribution platform, through which each memory cache shard can be connected to realize subsequent hotel information query.

[0052] In step S101, what needs to be achieved is to realize a preliminary query of hotel information through the hotel static fuzzy query conditions, and the static fuzzy conditions include name, address, keywords, etc., which are fuzzy matched with the corresponding fields of the target hotel.

[0053] Specifically, when implementing the search, the fuzzy search may be implemented through a server that supports the fuzzy search to obtain the fuzzy search results.

[0054] Step S102, based on the fuzzy search results, hotel information corresponding to the search conditions in the designated area is retrieved to obtain precise search results, wherein the precise search results at least include: the city area to which the hotel belongs and the hotel grade.

[0055] In step S102, hotel information is queried through hotel static precise query conditions, and accurately matched with corresponding fields of target hotels, wherein static precise conditions include city, administrative district, business district, brand, star rating, location information and hotel code list.

[0056] Step S103, screening out a set of recommended hotels that meet the requirements of the hotel sales plan field from the precise search results.

[0057] In step S103, dynamic condition query of hotel data is implemented, and dynamic conditions are filtered and calculated for hotel price plan information. The hotel sales plan fields include check-in and check-out dates, bed type, whether breakfast is included, payment method, guarantee method, price range, sorting and paging methods, etc.

[0058] Step S104, sorting the proposed recommended hotel set and outputting recommended hotel interface information.

[0059] Through the above steps, a hotel query request can be responded to, hotel information can be searched in the cache end, fuzzy search results can be obtained, hotel information corresponding to the search conditions of the specified area can be retrieved based on the fuzzy search results, accurate search results can be obtained, and a set of recommended hotels that meet the requirements of the hotel sales plan field can be screened out from the accurate search results; the set of recommended hotels can be sorted, and the recommended hotel interface information can be output, wherein the cache end includes N memory cache slices, each memory cache slice corresponds to at least one city area, and the memory cache slice pre-stores the hotel information of all registered hotels in the city area, and the fuzzy search results at least include: hotel code list, hotel name, hotel address, and accurate search results at least include: the city area to which the hotel belongs, and the hotel grade. In this embodiment, each hotel information can be traversed in the cache end, fuzzy search results that meet the basic search conditions can be obtained first, and hotel information that meets the search conditions of the specified area can be further queried to obtain accurate search results, and recommended hotels that meet the requirements of the hotel sales plan field can be screened out, and finally the result list can be sorted and paginated according to the sorting method, and the final query result can be returned, thereby solving the technical problems of low query efficiency and long query response time when searching for hotels in the related technology.

[0060] The embodiment of the present invention is described in detail below in combination with the above steps.

[0061] It should be noted that due to the large number of hotels, there are many data elements used to build a search engine, and these data need to be loaded into the cache end, and the system performance is improved through memory computing technology. Therefore, before realizing the hotel search based on memory computing, this embodiment needs to first slice the city area to which the hotel belongs, and store the mapping relationship between the city area and each memory cache slice. Optionally, the hotel query method based on memory computing includes: counting the hotel data and the price data of each type of room in each city area, and evaluating the occupancy of each city area for the memory cache based on the hotel data and the price data; accumulating the occupancy of all city areas for the memory cache to obtain the total memory cache occupancy; determining the number of slices according to the total memory cache occupancy, the server memory amount and the memory usage rate; sorting according to the occupancy of each city area for the memory cache, and according to the preset snake grouping strategy, allocating each city area to the corresponding memory cache slice; storing the mapping relationship between the city area and the memory cache slice to the cache end.

[0062] In this embodiment, considering that the vertical expansion solution of a single server has a performance ceiling and is costly, the Dubbo microservice framework is used to implement a distributed sharding deployment solution to support horizontal expansion of query processing capabilities. In this embodiment, the query service is sharded according to the hotel city, and each memory cache shard only loads the hotel data of the corresponding city. The city area contained in each memory cache shard can be one or more.

[0063] It should be noted that the cache end mentioned in this embodiment can adopt a distributed cache strategy, for example, using the Redis distributed cache strategy to improve the loading efficiency of the memory cache. Redis is constructed according to data types, and hotel data can be stored in different Redis clusters according to categories. Data classification is relatively flexible, such as static information and room prices and room status. For a single type with a large amount of data, a horizontal sharding solution can be further adopted, and distributed deployment can be carried out in different Redis clusters.

[0064] This embodiment uses coefficients corresponding to the number of hotels and housing price data when estimating the memory cache occupancy of each city. Optionally, the step of evaluating the memory cache occupancy of each city area based on the hotel data and housing price data also includes: obtaining a first occupancy coefficient corresponding to the hotel data of each city area, and obtaining a second occupancy coefficient corresponding to the housing price data of each type of room; combining the hotel data of each city area and the corresponding first occupancy coefficient, the housing price data of each type of room and the corresponding second occupancy coefficient, to calculate the memory cache occupancy of each city area.

[0065] For example, the size of a hotel's static hotel data is Xh (KB) (i.e., the first occupancy coefficient), and the dynamic information is mainly room rate and room status data, and the size of a room rate data is about Xp (KB) (i.e., the second occupancy coefficient). Then the memory cache data occupancy Csize of the city is:

[0066] Csize=Hcount*Xh+Pcount*Xp;

[0067] Among them, Hcount is hotel data and Pcount is room price data.

[0068] After obtaining the city memory cache usage, the number of shards required for the memory cache can be determined. The number of memory cache shards can be determined based on the total memory cache, server memory, and memory usage. If the estimated total memory cache is Tsize, the available memory per server is Msize, and the maximum memory usage is Musage, the number of shards Scount is calculated as follows:

[0069] Scount=Ceiling(Tsize(MSize*Musage));

[0070] Among them, Ceiling is a rounding operation.

[0071] Afterwards, the cities are sorted according to their estimated memory cache volume, and each city is assigned to each shard using the snake grouping method, and the mapping relationship between city areas and shards is saved in the database.

[0072] After completing the city area and shard mapping operation, execute the hotel query request initiated by the user.

[0073] In addition, the hotel query method based on memory computing also includes: obtaining original hotel data of the hotel to be sold; preprocessing the original hotel data to obtain hotel standardized data, wherein the preprocessing includes: extracting multi-dimensional features of the original hotel data, the multi-dimensional features include at least one of the following: static information, dynamic information; and persistently storing the hotel standardized data in a database.

[0074] Among them, when preprocessing the original hotel data to obtain hotel standardized data, it includes: extracting the hotel name, hotel address, hotel city area, hotel business district, hotel brand, hotel grade, and hotel code from the original hotel data to obtain static information; extracting the room price data, bed type data, payment method, guarantee method, and price range of each type of room in each query interval from the original hotel data to obtain dynamic information; and generating hotel standardized data based on the static information and dynamic information.

[0075] Optionally, after persistently storing the hotel standardized data in the database, the method further includes: synchronously storing the hotel standardized data in a cache end and a memory cache.

[0076] In this embodiment, the original hotel data of the hotel to be sold can be obtained and preprocessed to obtain the standardized hotel data. The preprocessing includes extracting the multi-dimensional features of the original hotel data, including static information, dynamic information, etc. The standardized hotel data is persistently stored in the database, and the data synchronization from the database to the distributed cache and the memory cache is realized, the data consistency between the cache and the database is ensured, and the horizontal expansion and cluster management of the memory cache are supported. Finally, according to the hotel query conditions, high-performance hotel search is realized through the memory calculation method.

[0077] Another optional specific implementation is described in detail below.

[0078] The present invention provides a hotel search method based on memory computing, which aims to support hotel search functions with high performance, high concurrency, high scalability and high data consistency. The hotel search method based on memory computing includes:

[0079] 1. Obtain the original hotel data of the hotel and store it persistently.

[0080] The original hotel data is obtained through the supplier data interface for standardization processing. After obtaining the hotel data, it is persistently stored in the local database. Among them, the standardization processing includes: establishing a mapping between the supplier hotel and the platform's local hotel, and obtaining the hotel's room rate and room status information on a daily basis; the persistent storage includes: storing the mapping relationship between the supplier hotel and the local hotel and the hotel's daily room rate and room status information in the database.

[0081] 2. Establish a multi-level cache structure.

[0082] In this implementation, the established multi-level cache structure includes a three-level structure of memory, distributed cache, and database, including two cache forms: memory cache and distributed cache. The cache query can adopt the "get-if-absent-compute" mode, that is, if there is no data in the current cache, the next level is called to obtain data until the database is queried.

[0083] 3. Flexibly scalable distributed sharding deployment.

[0084] Due to the large number of hotels, there are many data elements used to build the search engine. These data need to be loaded into the server memory to improve system performance through in-memory computing technology. The vertical expansion solution based on a single server has a performance ceiling and is costly. This application uses the Dubbo microservice framework to implement a distributed sharding deployment solution, which supports horizontal expansion of query processing capabilities and can also be replaced by other microservice frameworks during specific implementation.

[0085] The query service is sharded according to the hotel city, and each service shard only loads the hotel data of the corresponding city. In this embodiment, Redis distributed cache is used. Redis distributed cache is a large-capacity cache between memory cache and database. It is between memory cache and database in terms of speed and capacity to improve the loading efficiency of memory cache. Redis is constructed according to data types. Hotel data can be stored in different Redis clusters according to categories. Data classification is more flexible, such as static information and room prices and room status. For single types with large data volumes, horizontal sharding solutions can be further adopted and distributed in different Redis clusters.

[0086] 4. Hotel search method based on memory computing.

[0087] There are many hotel search conditions, which are divided into three categories according to the background processing method: static fuzzy conditions, static precise conditions and dynamic conditions. Static fuzzy conditions include name, address, keywords, etc., which are fuzzily matched with the corresponding fields of the target hotel; static precise conditions include city, administrative area, business district, brand, star rating, location information and hotel code list, etc., which are precisely matched with the corresponding fields of the target hotel; dynamic conditions filter and calculate hotel price plan information, including check-in and check-out dates, bed type, whether breakfast is included, payment method, guarantee method, price range, sorting and paging method, etc.

[0088] In order to realize the static fuzzy search function of the hotel, a full-text search server can be pre-built in this embodiment, and the hotel city, administrative area, name, and address can be loaded into the full-text search server. It supports querying the hotel code list based on fuzzy search fields such as name, address, and keywords, and exposes the call entry and search engine integration.

[0089] If the search conditions include static fuzzy search conditions, first perform a fuzzy search through the engine search call interface to return a list of hotel codes, then add the hotel code list to the static precise search conditions for further search, traverse the static information of each hotel in the memory cache, and further query the dynamic information cache for hotels that meet the conditions. If the dynamic search conditions are met, generate the query result for the hotel and add it to the result list. Finally, sort and page the result list according to the sorting method, and return the final query result.

[0090] The hotel search method based on memory computing provided in the embodiment of the present application is suitable for a hotel distribution system. Since the local data volume of the hotel distribution system is very large and the number of hotels available for sale worldwide reaches millions, it is necessary to establish a multi-level cache structure to support data sharding and horizontal expansion. Through real-time updates, timed increments and full update mechanisms, high consistency of data between the cache and the database is guaranteed to improve the performance and accuracy of the hotel search engine.

[0091] Figure 2 is a flowchart of another optional hotel search method based on memory computing according to an embodiment of the present invention, such as Figure 2 As shown, the hotel search method includes:

[0092] Step 01: Obtain the original hotel data of the hotel to be matched and store it locally.

[0093] The hotel data provided by the supplier is obtained through the Application Program Interface (API), the data is standardized and persistently stored in the local database.

[0094] Step 02: Build distributed cache and memory cache.

[0095] Due to the huge amount of hotel data and the large number of data elements used for search, the database has low query efficiency in terms of large-scale data and multi-level connections, and cannot quickly respond to and support large concurrent data queries. Therefore, a multi-level cache mechanism is established to improve query and computing performance. At the same time, considering the memory cache capacity limitation, the cache service is sharded to form a distributed cluster to support horizontal expansion.

[0096] To ensure the eventual consistency of data between the database and the cache, the methods used include but are not limited to: writing to the cache at the same time as writing to the database, incrementally updating the cache based on the database data timestamp, and regularly updating the cache in full.

[0097] Data objects are created in memory according to the hotel, containing various static and dynamic information for search and calculation purposes.

[0098] Step 03: Build a hotel fuzzy search engine.

[0099] In this embodiment, the hotel name, address and keyword search supports fuzzy matching, which involves Chinese word segmentation and other technologies. For example, the present invention uses Solr to build a fuzzy search engine, and files are formed into files of fields involving fuzzy search, such as hotel code, hotel city, hotel name, address, etc., and submitted to the Solr search engine server. Solr is a high-performance, full-text search server based on Lucene, and can also be replaced by other servers that support fuzzy search.

[0100] Step 04: Perform a fuzzy search of static information based on the search criteria.

[0101] When the query service receives a search request, if the request contains fuzzy search conditions such as hotel name, address, and keywords, the query service calls the Solr search service through the API interface to perform a fuzzy search and obtain a list of hotel codes that meet the conditions.

[0102] Step 05: Perform precise search for static information based on the search criteria.

[0103] According to the city information in the search conditions, all hotels in the city in the memory cache are traversed, and each field of the static information is judged one by one. If all conditions are met, the next step of dynamic information screening and calculation is carried out.

[0104] If the search condition includes a fuzzy search condition, only the hotel list obtained in step 04 is traversed instead of all hotels.

[0105] Step 06: Filter and calculate dynamic information based on the search criteria.

[0106] For hotels that meet the static information search conditions, dynamic information is screened and calculated. Dynamic information includes hotel sales related fields, which are mainly divided into price plan fields and price fields.

[0107] Among them, price plan fields include supplier, payment method, guarantee method, etc. The price plan attributes are traversed for judgment. If the conditions are met, further price field search is performed.

[0108] Price fields include check-in date, check-out date, price, service fee, inventory, etc., which are extracted and merged in the memory cache according to the date and price plan code. There are price plans for sales prices and inventory for all dates between the check-in and check-out dates. If the first-day price is within the query price range, then the price plan meets the conditions, and the price plan and first-day price are added to the intermediate results. For all price plans that meet the conditions, the lowest price is calculated as the starting price for the hotel's sales, and the hotel is added to the result list.

[0109] Step 07: Sort and paginate the list of hotel results that meet the criteria.

[0110] For the hotel result list that meets the static and dynamic search conditions, sort and paginate according to the query conditions and return the final results.

[0111] Figure 3 is another optional flowchart of multi-level cache construction and data synchronization according to an embodiment of the present invention, such as Figure 3As shown in the figure, the multi-level cache built includes: memory cache (to implement query service), distributed cache (using Redis distributed cache) and local database.

[0112] It should be noted that in the process of building a multi-level cache structure, it is necessary to first build a distributed cache and a memory cache. Due to the huge amount of hotel data and the large number of data elements used for search, the database has low query efficiency in large-scale data and multi-level connections, and cannot quickly respond to and support large concurrent data queries. Therefore, a multi-level cache mechanism is established to improve query and computing performance. At the same time, considering the memory cache capacity limitation, the cache service is sharded to form a distributed cluster to support horizontal expansion.

[0113] To ensure the eventual consistency of data between the database and the cache, the methods used include but are not limited to: writing to the cache at the same time as writing to the database, incrementally updating the cache based on the database data timestamp, and regularly updating the cache in full.

[0114] Data objects are created in memory according to the hotel, containing various static and dynamic information for search and calculation purposes.

[0115] At the same time, the hotel name, address and keyword search mentioned in this embodiment support fuzzy matching, which involves Chinese word segmentation and other technologies. For example, the present invention uses Solr to build a fuzzy search engine, and forms a file with the fields involving fuzzy search such as hotel code, hotel city, hotel name, address, etc., and submits it to the Solr search engine server. Solr is a full-text search server, and can also be replaced by other servers that support fuzzy search.

[0116] like Figure 3 As shown, during the data synchronization process, the method includes:

[0117] S201: Acquire hotel source data through the supplier data access interface.

[0118] For example, the hotel data provided by the supplier is obtained through the Application Program Interface (API).

[0119] S202: Standardized storage: The hotel data is standardized and persistently stored in the local database.

[0120] S203: Update the data to the distributed cache Resdis.

[0121] S204: Send the hotel update message to the message queue.

[0122] S205: Read updated hotel data from the distributed cache Redis. Synchronously, the query service will also monitor the data update data in the message queue in real time, monitor the updated hotel data, and then enter the updated hotel data into the memory cache.

[0123] S206: For the full data or incremental data of the memory cache scheduled update, enter it into the distributed cache Redis. For the cache scheduled update service, the full or incremental update data can be synchronized to the distributed cache Redis. Furthermore, the cache scheduled update service also supports full or incremental query, and realizes the lowest level query of hotel data through the local database.

[0124] S207: For incremental data that is updated periodically in the memory cache, an incremental update message is sent to a message queue.

[0125] S208: Synchronize and update the incremental data between the memory cache and the distributed cache. Synchronize, for the updated incremental data, it can be synchronized to the distributed cache.

[0126] S209: Synchronize and update all data between the memory cache and the distributed cache.

[0127] Figure 4 is a flow chart of an optional cache sharding method according to an embodiment of the present invention. Figure 4 As shown, the cache sharding method includes:

[0128] S401: Estimate the memory cache usage of each city.

[0129] According to the number of hotels and prices in each city, multiply it by the preset coefficient to estimate the memory cache usage of each city. For example, if the static information size of a hotel is Xh (KB), and the dynamic information is mainly the price and room status data, and the size of a price and room status data is about Xp (KB), then the memory cache data usage Csize of the city is:

[0130] Csize=Hcount*Xh+Pcount*Xp;

[0131] Where Hcount is the number of hotels and Pcount is the number of room rates.

[0132] S402: Determine the number of memory cache shards.

[0133] Determine the number of memory cache shards based on the total memory cache, server memory, and memory usage. If the estimated total memory cache is Tsize, the available memory on each server is Msize, and the maximum memory usage is Musage, the number of shards Scount is calculated as follows, where Ceiling is a round-up operation.

[0134] Scount=Ceiling(Tsize(MSize*Musage));

[0135] S403: Slice according to city and save configuration information.

[0136] Sort the cities by their estimated memory cache volume, assign each city to each shard using the snake grouping method, and save the mapping between cities and shards to the database.

[0137] Figure 5 is a schematic diagram of allocating city areas to memory cache slices according to an embodiment of the present invention, through Figure 5 The schematic snake grouping method allocates city areas to each memory cache shard, such as Figure 5 As shown in the figure, when performing city area sharding, four memory cache shards are constructed, which are defined as shard 1, shard 2, shard 3 and shard 4 respectively. Then the data is sharded according to the city, and the city is sharded in a serpentine grouping manner in the sharding order from left to right and from top to bottom. After sharding, the data capacity of shard 1 reaches 2.3GB, the data capacity of shard 2 reaches 2.4GB, the data capacity of shard 3 reaches 2.5GB, and the data capacity of shard 4 reaches 2.4GB.

[0138] S404: Each shard loads memory cache information.

[0139] Each shard query service obtains the global shard information according to the shard number in the local configuration file, loads the city hotel cache data contained in the shard, and starts the query service.

[0140] In order to improve the system's horizontal scalability and ensure high availability, each shard will be composed of multiple identical nodes to jointly handle query requests.

[0141] S405: Divert query traffic according to the city query condition.

[0142] The search engine calls the entry point to access the global shard information, accesses the specified shard query service according to the city code in the query condition, and executes the query logic.

[0143] The search engine calls the entry point to access the global shard information, accesses the specified shard query service according to the city code in the query condition, and executes the query logic.

[0144] Figure 6 is a schematic diagram of an optional memory cache cluster according to an embodiment of the present invention, such as Figure 6 As shown, the cluster consists of m shards, each cluster shard contains n nodes (such as Figure 6In the example, from search service 1.1 to search service 1.n, each search service corresponds to a memory cache). Since the access popularity of each shard may be different, the number of nodes in each shard can be different.

[0145] Combine the following Figure 7 , introduces a hotel search system provided by an embodiment of the present application, Figure 7 is a schematic diagram of an optional hotel query system based on memory computing according to an embodiment of the present invention, such as Figure 7 As shown, the hotel search system includes: an acquisition module 71, a processing module 72, a storage module 73 and a search calculation module 74.

[0146] The acquisition module 71 is used to acquire the original hotel data of the hotel to be sold.

[0147] The processing module 72 is used to pre-process the original hotel data to obtain hotel standardized data. The pre-processing includes extracting multi-dimensional features of the original hotel data, including static information, dynamic information, etc.

[0148] The storage module 73 is used to persistently store the standardized hotel data in the database, realize data synchronization from the database to the distributed cache and the memory cache, ensure data consistency between the cache and the database, and support horizontal expansion and cluster management of the memory cache.

[0149] The search calculation module 74 is used to implement high-performance hotel search based on hotel query conditions through an in-memory calculation method.

[0150] Through the above embodiments, a hotel search method based on memory computing is provided, which aims to support hotel search functions with high performance, high concurrency, high scalability and high data consistency, and has the following advantages:

[0151] 1. Based on a multi-level cache architecture, including memory, distributed cache, and database three-level storage structure, it supports two cache forms: memory cache and distributed cache. It uses in-memory computing technology and supports high-performance queries with large concurrency.

[0152] 2. Use a variety of data synchronization methods, including real-time writing, scheduled full and incremental updates, to achieve high data consistency among the three-level storage structures of memory cache, distributed cache and database, and improve the accuracy of the query system.

[0153] 3. Support good scalability. Based on data sharding solutions and microservice architecture, the storage and access of large amounts of data can be dynamically expanded horizontally to meet the needs of business development.

[0154] The following is a detailed description in conjunction with another embodiment.

[0155] Embodiment 2

[0156] A hotel query device based on memory calculation provided in this embodiment includes multiple implementation units, each of which corresponds to each implementation step in the above-mentioned embodiment 1.

[0157] Figure 8 is a schematic diagram of an optional hotel query device based on memory computing according to an embodiment of the present invention, such as Figure 8 As shown, the hotel query device based on memory calculation may include: a hotel search unit 81, a hotel retrieval unit 82, a screening unit 83, and a sorting unit 84.

[0158] Among them, the hotel search unit 81 is used to respond to hotel query requests, search for hotel information in the cache end, and obtain fuzzy search results, wherein the cache end includes N memory cache slices, each memory cache slice corresponds to at least one city area, and the memory cache slice pre-stores the hotel information of all registered hotels in the city area. The fuzzy search results at least include: hotel code list, hotel name, hotel address, and N is a positive integer greater than 1.

[0159] The hotel search unit 82 searches for hotel information corresponding to the search condition in the designated area based on the fuzzy search results to obtain accurate search results, wherein the accurate search results at least include: the city area to which the hotel belongs and the hotel grade.

[0160] The screening unit 83 is used to screen out a set of recommended hotels that meet the requirements of the hotel sales plan field from the precise search results.

[0161] The sorting unit 84 is used to sort the proposed recommended hotel set and output recommended hotel interface information.

[0162] The above-mentioned hotel query device based on memory computing can respond to hotel query requests through the hotel search unit 81, search for hotel information in the cache end, obtain fuzzy search results, and retrieve hotel information corresponding to the specified area search conditions based on the fuzzy search results through the hotel retrieval unit 82 to obtain precise search results. The screening unit 83 screens out a set of recommended hotels that meet the requirements of the hotel sales plan field from the precise search results, and the sorting unit 84 sorts the set of recommended hotels to output recommended hotel interface information, wherein the cache end includes N memory cache slices, each memory cache slice corresponds to at least one city area, and the memory cache slice pre-stores hotel information of all registered hotels in the city area. The fuzzy search results at least include: hotel code list, hotel name, hotel address, and the precise search results at least include: the city area to which the hotel belongs and the hotel grade. In this embodiment, the hotel information can be traversed in the cache end to first obtain fuzzy search results that meet the basic search conditions, and then further query the hotel information of the specified area search conditions to obtain accurate search results, and filter out recommended hotels that meet the requirements of the hotel sales plan field. Finally, the result list is sorted and paged according to the sorting method, and the final query result is returned, thereby solving the technical problems of low query efficiency and long query response time when searching for hotels in related technologies.

[0163] Optionally, the hotel query device based on memory calculation also includes: a room price statistics unit, which is used to count the hotel data of each city area and the room price data of each type of room, and evaluate the occupancy of each city area for the memory cache based on the hotel data and the room price data; an occupancy accumulation unit, which is used to accumulate the occupancy of all city areas for the memory cache to obtain the total memory cache occupancy; a sharding unit, which is used to determine the number of shards according to the total memory cache occupancy, the server memory amount and the memory utilization rate; a city grouping unit, which is used to sort according to the occupancy of each city area for the memory cache, and according to a preset serpentine grouping strategy, assign each city area to a corresponding memory cache shard; a mapping relationship storage unit, which is used to store the mapping relationship between the city area and the memory cache shard to the cache end.

[0164] Optionally, the room price statistics unit includes: a coefficient acquisition module, used to obtain a first occupancy coefficient corresponding to the hotel data of each urban area, and to obtain a second occupancy coefficient corresponding to the room price data of each type of room; an occupancy calculation module, used to calculate the occupancy of the memory cache of each urban area by combining the hotel data of each urban area and the corresponding first occupancy coefficient, the room price data of each type of room and the corresponding second occupancy coefficient.

[0165] Optionally, the hotel search unit includes: a call entry startup module, used to start the search engine call entry; a shard access module, used to use the search engine call entry to access the global shard in the cache end; a hotel query module, used to specify the shard according to the city code index carried in the hotel query request, perform the hotel query operation in the specified shard, and obtain fuzzy search results.

[0166] Optionally, the hotel query device based on memory computing also includes: an original hotel data acquisition unit, used to acquire the original hotel data of the hotel to be sold; a hotel data preprocessing unit, used to preprocess the original hotel data to obtain hotel standardized data, wherein the preprocessing includes: extracting multi-dimensional features of the original hotel data, the multi-dimensional features include at least one of the following: static information, dynamic information; a hotel standardized data storage unit, used to persistently store the hotel standardized data in a database.

[0167] Optionally, the hotel data preprocessing unit includes: a first hotel information extraction module, used to extract the hotel name, hotel address, hotel city area, hotel business district, hotel brand, hotel grade, and hotel code from the original hotel data to obtain static information; a second hotel information extraction module, used to extract the room price data, bed type data, payment method, guarantee method, and price range of each type of room in each query interval from the original hotel data to obtain dynamic information; and a standardized data generation module, which generates hotel standardized data based on static information and dynamic information.

[0168] Optionally, the hotel query device based on memory computing further includes: a data synchronization unit, which is used to synchronously store the hotel standardized data in a cache end and a memory cache after persistently storing the hotel standardized data in a database.

[0169] The above-mentioned hotel query device based on memory calculation can also include a processor and a memory. The above-mentioned hotel search unit 81, hotel retrieval unit 82, screening unit 83, sorting unit 84, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.

[0170] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the hotel search based on memory calculation is realized by adjusting the kernel parameters to obtain the recommended hotel display information.

[0171] The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one storage chip.

[0172] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, the computer-readable storage medium including a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the hotel query methods based on memory computing in the above-mentioned embodiment 1.

[0173] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement the hotel query method based on memory computing of any one of the above-mentioned embodiments one.

[0174] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the hotel query method based on memory calculation described in each embodiment of the present application.

[0175] The present application also provides a computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the hotel query method based on memory calculation described in each embodiment of the present application are implemented.

[0176] Fig. 9 1 is a hardware structure block diagram of an electronic device (or mobile device) for executing a hotel query method based on memory calculation according to an embodiment of the present invention. Fig. 9 As shown, the electronic device may include one or more ( Fig. 9 902a, 902b, ..., 902n are used to illustrate) a processor (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 904 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply and / or a camera. A person of ordinary skill in the art can understand that Fig. 9 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig. 9 More or fewer components as shown, or with Fig. 9 Different configurations are shown.

[0177] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0178] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0179] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0180] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0181] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0182] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0183] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A hotel query method based on memory computing, characterized in that: include: In response to the hotel query request, the hotel information is searched in the cache end to obtain a fuzzy search result, wherein the cache end includes N memory cache slices, each of which corresponds to at least one city area, and the memory cache slices pre-store hotel information of all registered hotels in the city area, and the fuzzy search result at least includes: a hotel code list, a hotel name, and a hotel address, and N is a positive integer greater than 1; Based on the fuzzy search results, hotel information corresponding to the search conditions in the specified area is retrieved to obtain accurate search results, wherein the accurate search results at least include: the city area to which the hotel belongs and the hotel grade; Filtering a set of recommended hotels that meet the requirements of the hotel sales plan field from the precise search results; The proposed recommended hotel set is sorted, and recommended hotel interface information is output.

2. The hotel query method according to claim 1, characterized in that: Also includes: Collecting hotel data and room price data of each type of room in each urban area, and evaluating the memory cache usage of each urban area based on the hotel data and room price data; Accumulate the memory cache usage of all the city areas to obtain the total memory cache usage; Determine the number of shards according to the total memory cache occupancy, server memory capacity, and memory usage; Sort the city areas according to the amount of memory cache occupied by each city area, and assign each city area to a corresponding memory cache shard according to a preset snake grouping strategy; The mapping relationship between the city area and the memory cache slice is stored in the cache end.

3. The hotel query method according to claim 2, characterized in that: The step of evaluating the occupancy of the memory cache by each of the city areas based on the hotel data and the room rate data further includes: Obtaining a first occupancy coefficient corresponding to hotel data of each of the urban areas, and obtaining a second occupancy coefficient corresponding to room price data of each type of room; The occupancy of the memory cache of each of the urban areas is calculated by combining the hotel data of each of the urban areas and the corresponding first occupancy coefficient, the room price data of each type of room and the corresponding second occupancy coefficient.

4. The hotel query method according to claim 1, characterized in that: In response to the hotel query request, searching the cache for hotel information to obtain fuzzy search results also includes: Start the search engine call entry; Using the search engine to call the entry to access the global shard in the cache end; A designated slice is indexed according to the city code carried in the hotel query request, and a hotel query operation is performed in the designated slice to obtain a fuzzy search result.

5. The hotel query method according to claim 1, characterized in that: Also includes: Obtain the original hotel data of the hotel to be sold; Preprocessing the original hotel data to obtain hotel standardized data, wherein the preprocessing includes: extracting multi-dimensional features of the original hotel data, the multi-dimensional features including at least one of the following: static information and dynamic information; The hotel standardized data is persistently stored in a database.

6. The hotel query method according to claim 5, characterized in that: The step of preprocessing the original hotel data to obtain hotel standardized data includes: Extracting the hotel name, hotel address, city area to which the hotel belongs, business district to which the hotel belongs, hotel brand, hotel grade, and hotel code from the original hotel data to obtain static information; Extracting the price data, bed type data, payment method, guarantee method, and price range of each type of room in each query interval from the original hotel data to obtain dynamic information; The hotel standardized data is generated based on the static information and the dynamic information.

7. The hotel query method according to claim 5, characterized in that: After the hotel standardized data is persistently stored in the database, it also includes: The hotel standardized data is synchronously stored in the cache end and the memory cache.

8. A hotel query device based on memory computing, characterized in that: include: A hotel search unit, configured to respond to a hotel query request, search for hotel information in a cache end, and obtain a fuzzy search result, wherein the cache end includes N memory cache slices, each of which corresponds to at least one city area, and the memory cache slices pre-store hotel information of all registered hotels in the city area, and the fuzzy search result at least includes: a hotel code list, a hotel name, and a hotel address, and N is a positive integer greater than 1; A hotel search unit, based on the fuzzy search results, searches for hotel information corresponding to the search conditions in the specified area to obtain accurate search results, wherein the accurate search results at least include: the city area to which the hotel belongs and the hotel grade; A screening unit, used to screen out a set of recommended hotels that meet the requirements of the hotel sales plan field from the precise search results; The sorting unit is used to sort the proposed recommended hotel set and output recommended hotel interface information.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the hotel query method based on memory calculation according to any one of claims 1 to 7.

10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the hotel query method based on memory computing as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Hotel data processing method and device and electronic equipment

    CN120780928A

  • Hotel data processing method and device, and electronic equipment

    CN120780928B