Hotel data translation method and system, electronic equipment and storage medium
By adopting a framework based on feature extraction and cache in hotel data translation, regular expressions are built for data formatting and Chineseization, the problem of poor translation of hotel room types and policy descriptions in the hotel distribution industry is solved, and efficient and accurate hotel data translation is achieved.
Patent Information
- Application Number
- CN202411897721.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing translation technology has poor processing of abbreviations and professional terms for hotel room types and policy descriptions in the hotel distribution industry, resulting in poor English-Chinese translation.
Using a architecture based on feature extraction and caching, a regular expression is built for data formatting and Chineseization through the database and Redis cached secondary storage structure, priority is given to the processing of key hotel data with orders, and continuous maintenance and update feature extraction.
It realizes accurate and efficient translation of hotel data, reduces translation costs, provides reliable information basis, and ensures the latest and real-time translation results through real-time data updates and synchronization.
Smart Images

Figure CN119862894A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of language translation, and in particular relates to a hotel data translation method and system, electronic equipment, and a storage medium. Background Art
[0002] The hotel distribution industry has many suppliers, both domestic and international. The data information returned by domestic suppliers is in Chinese, which is in line with Chinese habits; however, the data information returned by international hotel suppliers is in English, and generally contains various abbreviations and professional terms in the hotel industry. Necessary translation operations are required to better provide hotel resources to cooperative distributors. However, because the hotel room types and policy descriptions in the hotel distribution industry contain many abbreviations and professional terms, the existing translation technology and equipment have no specific optimization for the hotel distribution industry, and the English-Chinese translation effect is not good. Therefore, an economical, real-time and efficient translation tool is needed to solve this problem. Summary of the invention
[0003] Aiming at the deficiencies of the prior art, the invention discloses a hotel data translation method and system, electronic equipment and storage medium.
[0004] The present invention is achieved through the following technical solutions:
[0005] In a first aspect, a hotel data translation method comprises:
[0006] Obtaining original hotel data, and persistently storing the original data in a local database;
[0007] Formatting the original data in the local database according to the rules, and extracting characteristic keywords and storing them in the formatting table;
[0008] Building a regular expression based on the characteristic keyword and using Redis for caching;
[0009] Obtain real-time commercial room type descriptions and real-time policy data from upstream suppliers, read the corresponding regular expression cache and translate it into Chinese.
[0010] In some embodiments, the hotel original data includes original room type descriptions and original policy data.
[0011] In some embodiments, the original room type description includes room area, bed type, bed area, network identifier, non-smoking room identifier, breakfast identifier, window identifier, and floor.
[0012] In some embodiments, the raw policy data includes a reservation policy, a cancellation policy, and a guarantee policy.
[0013] In some embodiments, the formatting performs hierarchical processing on the original data, giving priority to the original data of key hotels with orders.
[0014] In some embodiments, the regular expression is improved based on the requirements and data changes in actual applications.
[0015] In some embodiments, the Chinese localization method of the real-time room description of the upstream supplier includes complete hit and combined feature extraction.
[0016] In some embodiments, the complete hit is that the real-time room type description obtained from the upstream supplier matches the regular expression, and the corresponding room type is directly translated into Chinese;
[0017] The combined feature extraction extracts key information by combining multiple feature fields, and translates the combined features into corresponding room types.
[0018] In some embodiments, the Chinese translation of the real-time policy data of the upstream supplier divides the policies into guarantee policies, cancellation policies and reservation policies. The three policies are respectively feature extracted according to their respective keywords in the Redis cache and then combined for Chinese translation.
[0019] In a second aspect, a hotel data translation system includes:
[0020] The data collection module is used to obtain the original data of the hotel and store the original data persistently in the local database;
[0021] A data processing module, used to format the original data in the local database according to rules, and extract characteristic keywords and store them in a formatting table;
[0022] A regular expression building module, used to build a regular expression based on the characteristic keyword and use Redis for caching;
[0023] The Chinese localization module is used to obtain real-time commercial room type descriptions and real-time policy data from upstream suppliers, and read the corresponding regular expression cache for Chinese localization.
[0024] In a third aspect, a computer-readable storage medium stores one or more programs, which can implement the above method when the one or more programs are executed.
[0025] In a fourth aspect, a device comprises a processor, a communication interface, a memory and a communication bus; the processor, the communication interface and the memory communicate with each other via the communication bus; and the processor is used to execute a program stored in the above-mentioned computer-readable storage medium.
[0026] Compared with the prior art, the present invention has the following advantages:
[0027] 1. It adopts an architecture based on feature extraction and caching, and uses the secondary storage structure of database and Redis cache to ensure the convenience of storage and reading;
[0028] 2. Feature extraction is performed based on large amounts of data from upstream suppliers, and subsequent maintenance and updates are continuously performed to ensure the accuracy of the translation and provide a reliable information basis for the hotel industry. Combined with Redis cache technology, real-time data updates and synchronization are achieved to ensure the latest and real-time translation results;
[0029] 3. Targeted feature extraction method reduces translation costs.
[0030] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or be understood by implementing the present use information. The purpose and other advantages of the present invention can be realized and obtained by the structures pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] 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, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0032] Figure 1 This is a schematic diagram of a hotel data translation method flow in this embodiment.
[0033] Figure 2 Schematic diagram of a hotel data translation system according to this embodiment.
[0034] Figure 3 Schematic diagram of an electronic device of this embodiment. DETAILED DESCRIPTION
[0035] The drawings are only for illustrative purposes and cannot be construed as limiting the present invention. To better illustrate the present embodiment, some parts of the drawings may be omitted, enlarged, or reduced, and do not represent the size of the actual product. For those skilled in the art, it is understandable that some well-known structures and their descriptions may be omitted in the drawings. The positional relationships described in the drawings are only for illustrative purposes and cannot be construed as limiting the present invention.
[0036] In some embodiments, Figure 1 A hotel data translation method shown includes the following steps:
[0037] S1. Obtain the original data of the hotel and store the original data persistently in a local database;
[0038] Specifically, the original hotel data is obtained through the hotel supplier data interface, and the original hotel data includes original room type description and original policy data.
[0039] The original room description includes room area, bed type, bed area, network mark, non-smoking room mark, breakfast mark, window mark and floor.
[0040] The original policy data includes reservation policy, cancellation policy and guarantee policy.
[0041] Furthermore, the persistent storage needs to establish an original table of supplier hotel data, and store the original room type description and original policy data in the original table of hotel data respectively, so as to finally verify whether the translation function has achieved the final goal.
[0042] S2, formatting the original data in the local database according to the rules, and extracting characteristic keywords and storing them in the formatting table;
[0043] Specifically, the formatting is to process the original data in a hierarchical manner, and give priority to processing the original data of key hotels with orders.
[0044] Feature keywords are extracted from the original room description and original policy data respectively, and then persistently stored in the formatted feature database table.
[0045] S3, constructing a regular expression based on the characteristic keyword and using Redis for caching;
[0046] Specifically, for each feature keyword field, one or more regular expression dictionaries are constructed, the constructed dictionaries are stored in a database table, and cached in a Redis cache.
[0047] Furthermore, the construction of the regular expression is used to parse the feature keywords extracted from the key hotel data. Due to the needs and data changes in actual applications, the regular expression needs to be improved, including using the regular expression constructed based on the feature keywords to format the original data in the local database for feature extraction, and then further optimizing the regular expression. After the regular expression is improved, it is updated to the Redis cache for use in the Chinese output process.
[0048] S4. Obtain the real-time room description and real-time policy data from the upstream supplier, and read the corresponding feature keyword cache for Chinese translation.
[0049] Specifically, the Chinese localization methods for real-time room descriptions include complete hit and combined feature extraction.
[0050] The complete hit is to obtain a real-time room type description that matches the regular expression, and then translate the corresponding room type into Chinese. The combined feature extraction extracts key information by combining multiple feature fields, and translates the combined features into the corresponding room type, as shown in Table 1.
[0051] Table 1 Original data and its formatting and Chinese translation
[0052]
[0053] Furthermore, the Chinese translation of the real-time policy data is to divide the policies into guarantee policies, cancellation policies and reservation policies. The three policies are respectively subjected to feature extraction according to their respective keywords in the Redis cache, and then combined for Chinese translation, and finally the corresponding real-time policy data is obtained.
[0054] In some embodiments, the original hotel data provided by the supplier is obtained through the application program interface and stored in a local database. The original hotel data is graded and processed, with priority given to the original data of key hotels with orders. Feature extraction is performed for the characteristic fields of the room description, including room area, bed type, bed area, network identification, non-smoking room identification, breakfast identification, window identification and floor; feature extraction is performed for the characteristic fields of the policy data, including the three types of reservation, cancellation and guarantee, according to their respective keywords.
[0055] Furthermore, the extracted feature data is stored in a formatted feature database table, and a regular expression dictionary is constructed based on each feature field of the feature data, such as the room description regular expression dictionary shown in Table 2-10 and the policy keyword dictionary shown in Table 11-13.
[0056] Table 2 Room type keyword dictionary
[0057]
[0058] Table 3 Room area dictionary
[0059] ROOMAREA Room area ((\d+)(\s)*(-|TO|OR| / |OR|BY))*(\d+)(\s|-)*(SQFT|SQ.FT|SQF|FT|SQ|M2)
[0060] Table 4 Bed type dictionary
[0061]
[0062]
[0063] Table 5 Bed area dictionary
[0064] BEDAREA bed size ((\d+)|(\d+.\d+))((M|m){0,1})(\s*)(\*|X)(\s*)((\d+)|(\d+.\d+))(\s|\-)*((M|m|CM|\s))
[0065] Table 6 Network identification dictionary
[0066]
[0067] Table 7 Non-smoking room sign dictionary
[0068]
[0069] Table 8 Breakfast logo dictionary
[0070]
[0071] Table 9 Window identification dictionary
[0072]
[0073] Table 10 Floor dictionary
[0074]
[0075] Table 11 Booking policy keywords
[0076]
[0077] Table 12 Guarantee policy keywords
[0078]
[0079]
[0080] Table 13 Cancellation policy keywords
[0081]
[0082] Store the above dictionary in the database table and cache it in Redis cache.
[0083] Furthermore, the real-time room description and policy data provided by the supplier are obtained from the application interface and processed in combination with the keyword regular expression in the Redis cache.
[0084] In some embodiments, if the room description statement can directly match the regular expression, the corresponding room type will be directly translated into Chinese. For example, if the room description statement contains "**SUITE / STE" or "**ROOM / RM", the corresponding Chinese translation can be found in the room type dictionary, thereby quickly translating it into the Chinese room name.
[0085] In some embodiments, if the room type cannot be translated into Chinese through a complete hit method, a combined feature method is used to extract key information through a combination of multiple feature fields, and the room description is extracted into four dimensions, including A-economic level, B-layout style, C-geographical location, D-bed type / number of occupants. For multiple feature words in the same dimension, the first one is taken as the key feature according to the phrase sorting. For example, in the D-bed category, there are multiple feature words such as "1KING" and "BIG KING", then "1KING" is selected as the key feature according to the set rules.
[0086] Furthermore, feature extraction of different dimensional combinations is performed. For example, the combination of two dimensions “A+B|A+C|A+D|B+D|C+D|” indicates that there are words representing two dimensions in the room description. The feature information of these two dimensions is then processed comprehensively. In addition, there is a combination of three dimensions, such as “A+B+D|A+C+D|”. By extracting and combining multi-dimensional features, the room type is finally translated into the corresponding Chinese name, as shown in Table 14.
[0087] Table 14 Room Type Chinese Version
[0088]
[0089] Furthermore, the policy localization includes the localization of guarantee policy, cancellation policy and reservation policy. The localization of guarantee policy is based on the guarantee policy keywords in Table 12, and the guarantee policy is divided into multiple types, including Arrival (guarantee is required for arrival at the hotel after a certain time on the check-in day), Advance (guarantee is required for booking a few days in advance), Room (guarantee is required for more than a few rooms), Stay (guarantee is required for consecutive stays for more than a few days) and Always (guarantee is always required). Feature extraction is performed on the policy data according to their respective keywords. For example, for the "Arrival" type, relevant time keywords are extracted, such as "18:00LOCAL TIME (local time 18:00)", and then these extracted features are combined for localization, such as "GUESTS ARRIVING AFTER 18:00LOCAL TIME MUST PROVIDE A GUARANTEE (Guests arriving after 18:00 local time must provide a guarantee)", which is accurately translated into Chinese according to the extracted keywords and the set localization rules, as shown in Table 15.
[0090] Table 15 Guarantee Policy Chinese Version
[0091]
[0092] Furthermore, the Chinese translation of the cancellation policy extracts relevant information based on the cancellation policy keywords shown in Table 13, such as extracting time and cost related keywords in "CANCEL BY 2022-11-24T18:00:00CXL AFTER 180024NOV FORFEIT FIRST NITESTAY (cancellable before 18:00 on November 24, 2022, cancellation after 18:00 will forfeit the first night's accommodation fee)", and translates the cancellation policy into Chinese according to the set Chinese translation rules, as shown in Table 16, so that users can understand the relevant fees and restrictions for canceling orders at different time points.
[0093] Table 16 Cancellation policy Chinese version
[0094]
[0095]
[0096] Furthermore, the Chinese translation of the reservation policy performs feature extraction based on the reservation policy keywords shown in Table 11, such as extracting keyword information such as tax rate and charge type from "6.6PCT TAX PER NIGHT 6.6PCT VAT / GST TAX.10PCT SERVICE CHARGE PER NIGHT SVCCHARGE FOR RM FEE ON RM NIGHT BASIS.FOOD BEV OTHER FEES ON TOTAL AMTBASIS.EXCLUDES GRATUITY (6.6% tax per night; 6.6% VAT / commodity tax per night; 10% service charge per night; room rate includes evening service charge; food and other fees are included in the total amount; tips are not included)", and then combined and translated according to the Chinese translation rules, as shown in Table 17, so that the various terms of the reservation policy can be accurately presented in Chinese, which is convenient for customers and hotel operators to communicate and operate business.
[0097] In some embodiments, Figure 2 A hotel data translation system shown includes:
[0098] The data collection module is used to obtain the original data of the hotel and store the original data persistently in the local database;
[0099] A data processing module, used to format the original data in the local database according to rules, and extract characteristic keywords and store them in a formatting table;
[0100] A regular expression building module, used to build a regular expression based on the characteristic keyword and use Redis for caching;
[0101] The Chinese localization module is used to obtain real-time room descriptions and real-time policy data from upstream suppliers, and read the corresponding regular expression cache for Chinese localization.
[0102] The embodiment of the present disclosure also provides an electronic device, such as Figure 3 As shown, it includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus.
[0103] The memory is a computer-readable storage medium for storing one or more programs.
[0104] The processor is used to execute the program stored in the computer-readable storage medium.
[0105] The computer-readable storage medium may be included in the device / apparatus described in the above embodiments; or may exist independently without being assembled into the device / apparatus.
[0106] Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent substitutions for some of the technical features therein; and these modifications or substitutions do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A hotel data translation method, characterized in that: include: Obtaining original hotel data, and persistently storing the original data in a local database; Formatting the original data in the local database according to the rules, and extracting characteristic keywords and storing them in the formatting table; Building a regular expression based on the characteristic keyword and using Redis for caching; Obtain real-time commercial room type descriptions and real-time policy data from upstream suppliers, read the corresponding regular expression cache and translate it into Chinese.
2. A hotel data translation method according to claim 1, characterized in that: The original hotel data includes original room type description and original policy data.
3. A hotel data translation method according to claim 2, characterized in that, The original room description includes room area, bed type, bed area, network mark, non-smoking room mark, breakfast mark, window mark and floor.
4. A hotel data translation method according to claim 2, characterized in that: The original policy data includes reservation policy, cancellation policy and guarantee policy.
5. A hotel data translation method according to claim 1, characterized in that: The formatting processes the original data in a graded manner, giving priority to the original data of key hotels with orders.
6. A hotel data translation method according to claim 1, characterized in that: The regular expressions are improved based on the requirements in actual applications and the changes in data.
7. A hotel data translation method according to claim 1, characterized in that: The Chinese localization methods of the real-time room type descriptions of the upstream supplier include complete hit and combined feature extraction.
8. A hotel data translation method according to claim 7, characterized in that: The complete hit is that the real-time room type description obtained from the upstream supplier matches the regular expression, and the corresponding room type is directly translated into Chinese; The combined feature extraction extracts key information by combining multiple feature fields, and translates the combined features into corresponding room types.
9. A hotel data translation method according to claim 1, characterized in that: The Chinese translation of the real-time policy data of the upstream supplier divides the policies into guarantee policies, cancellation policies and reservation policies. The three policies are feature extracted according to their respective keywords in the Redis cache and then combined for Chinese translation.
10. A hotel data translation system, characterized in that: include: The data collection module is used to obtain the original data of the hotel and store the original data persistently in the local database; A data processing module, used to format the original data in the local database according to rules, and extract characteristic keywords and store them in a formatting table; A regular expression building module, used to build a regular expression based on the characteristic keyword and use Redis for caching; The Chinese localization module is used to obtain real-time commercial room type descriptions and real-time policy data from upstream suppliers, and read the corresponding regular expression cache for Chinese localization.
11. A computer-readable storage medium, characterized in that: One or more programs are stored, and when the one or more programs are executed, the methods described in claims 1 to 9 can be implemented.
12. A device comprising a processor, a communication interface, a memory and a communication bus; the processor, the communication interface and the memory communicate with each other via the communication bus; characterized in that: The processor is used to execute the program stored in the computer-readable storage medium according to claim 11.
Citation Information
Patent Citations
Hotel room type aggregating method and device, electronic equipment and storage medium
CN108491395A
Data extraction method and device for different data sources, equipment and storage medium
CN111858728A
Redis cache management method and device, computer equipment and storage medium
CN112347134A
Redis-based hotel information updating method, device and equipment and medium
CN113138993A
Method and system for fusing consumed time of hotel multi-supplier resource parallel query
CN117194438A