Regular freight rate route verification preprocessing method, device, equipment, medium and product

By preprocessing the route rule data, query combinations are generated, route encoding is decoded, and data structure tables are built, and data structure tables are cached in memory. The problems of complexity and inefficiency of freight rule verification are solved, and a fast response and high concurrency freight query system is realized.

CN119848085APending Publication Date: 2025-04-18TRAVELSKY TECHNOLOGY LIMITED
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411908023.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

In airline operations, the management and rapid verification of data related to freight rule faces challenges of huge data scale and huge verification volume, resulting in complex and inefficient verification of freight rule.

Method used

By generating a query combination of precise and fuzzy queries, query the route ID, and build a route data structure table with the origin and destination Key and the route ID Value, cache it into memory. At the same time, the applicable and exception route codes are queried through the rule freight number, decoded into the applicable and exception route ID, and a rule freight data structure table with the rule freight number as Key and the applicable and exception route ID is Value, and cached into memory.

Benefits of technology

By preprocessing route rule data, the calculation amount of subsequent queries and verification is reduced, the utilization rate of system resources is reduced, the request response speed of the ticket freight query system is significantly improved, and the system's concurrent processing capability in a big data environment is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119848085A_ABST
    Figure CN119848085A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of data processing, and particularly relates to a regular freight rate air route verification preprocessing method. Comprising the following steps: generating a query combination of accurate query and fuzzy query according to a starting place and a destination of an airline; inquiring the route ID corresponding to each combination, and if a default value of-1 does not exist; a route data structure table with the starting place and the destination as Key and the route ID as Value is constructed, and the route data structure table is cached in a memory; querying an applicable route code and an exceptional route code through a regular freight rate number; decoding the suitable route code and the exceptional route code, and converting the suitable route code and the exceptional route code into a suitable route ID and an exceptional route ID; and constructing a regular freight rate data structure table which takes the regular freight rate number as Key and takes the applicable route ID and the exceptional route ID as Value, and caching the regular freight rate data structure table into a memory. According to the invention, the request response speed of the passenger ticket freight rate query system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of data processing, and in particular relates to a preprocessing method for checking regular freight rates and routes. Background Art

[0002] In airline operations, the management and application of fare rule-related data is crucial. As the aviation market continues to develop, airlines need to develop complex and flexible fare strategies to attract all types of passengers, which requires the verification of a large number of rules, covering applicable and non-applicable routes, discount policies, seasonal adjustments, space management, and booking restrictions. The core challenge faced by the passenger fare query system when processing fare rule data is how to quickly verify the fare rules based on the query conditions specified by the user. The complexity of fare rule verification is mainly reflected in two aspects:

[0003] First, the data size is huge. The freight rate rules are composed of a main table and multiple sub-tables. The main table stores freight rate information, and the sub-tables store rule information, such as applicable or inapplicable routes, discount policies, and other rules. Each rule may correspond to multiple sub-tables, and the overall data volume is extremely considerable.

[0004] Second, the amount of data verification is huge. A user's itinerary query may result in a lot of freight rate data, and each freight rate data needs to be verified by multiple rules, and each rule needs to query multiple sub-tables and verify a large amount of data.

[0005] In view of the above two reasons, in order to quickly verify the applicable or non-applicable route rules of freight rates, it is necessary to pre-process the regular freight rate route data. Summary of the invention

[0006] In view of the shortcomings of the prior art, the present invention provides a regular freight rate route verification preprocessing method, comprising:

[0007] Generate a combination of exact and fuzzy queries based on the origin and destination of the route;

[0008] Query the route ID corresponding to each combination. If it does not exist, the default value is -1;

[0009] Construct a route data structure table with the origin and destination as the key and the route ID as the value, and cache the route data structure table in memory;

[0010] Check the applicable route code and exception route code through the regular freight rate number;

[0011] Decode the applicable route code and the exception route code and convert them into the applicable route ID and the exception route ID;

[0012] Construct a rule freight rate data structure table with the rule freight rate number as the key and the applicable route ID and exception route ID as the values, and cache the rule freight rate data structure table in memory.

[0013] Furthermore, the applicable route code and exception route code include:

[0014] For any given integer H in a set of integers, disassemble it in a way that takes 6 as the reference number, expressed as: N = 6k + r, where 0 < r ≤ 6, and the set of all k values is K;

[0015] Convert r into a binary string, and the converted binary string is represented as b n-1 b n-2 …b i …b1b0, where n is the number of bits of the binary string, n = 8, and each bit b i is determined by the following method:

[0016]

[0017] Group according to the k value, group the binary strings corresponding to the numbers with the same k value into the same group. For the binary strings within each group, follow the binary addition rule to perform an addition operation to obtain a new binary number, and then convert the new binary number into a decimal number;

[0018] Convert the converted decimal number into the corresponding character C through the encoding rule k ;

[0019] Determine the maximum value m in K, and construct the final string S = c m c m-1 ...c j …c2c1c0, where each bit c j is determined by the following method:

[0020]

[0021] Furthermore, the decoding of the applicable route code and exception route code into the applicable route ID and exception route ID includes:

[0022] Given the string S = c m c m-1 ...c j …c2c1c0, determine the length of the string S and each bit character c j , find all characters C in the string that are not equal to the character A k , and the position indices j corresponding to these C k form the set K, and at the same time determine the maximum value m in the set K;

[0023] Use the coding rules to convert C k Restore to decimal number;

[0024] Convert a decimal number to binary b n-1 b n-2 …b i …b1b0, n is the number of bits in the binary string, n=8;

[0025] Using the formula N = 6k + r, calculate the original integer N, where if b i =1, r=i+1, k is C k The corresponding position index.

[0026] Furthermore, the query combinations include: origin+destination, origin+"***", "***"+destination, "***"+"***", where *** is arbitrary and used for fuzzy query.

[0027] Furthermore, the route data structure table is cached in the memory, including:

[0028] The route data structure table is stored in a Map structure, and the data in the Map structure is cached in memory.

[0029] Furthermore, the regular freight rate data structure table is cached in the memory, including:

[0030] The regular freight rate data structure table is stored in a Map structure, and the data of the Map structure is cached in memory.

[0031] The present invention also provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and is characterized in that when the computer program is executed by the processor, the processor executes the steps of the regular freight rate route verification preprocessing method.

[0032] The present invention also provides a computer-readable storage medium storing a computer program, characterized in that when the computer program is executed by a processor, the processor executes the steps of the regular freight rate route verification preprocessing method according to any one of claims 1 to 6.

[0033] The present invention also provides a computer program product, including a computer program, characterized in that the computer program is executed by a processor to perform the regular freight rate route verification preprocessing method.

[0034] Compared with the prior art, the present invention has the following advantages:

[0035] In the scenario of large amounts of data, by preprocessing the route rules, this process covers the pre-query and calculation of most queries and business logic, and caches the corresponding intermediate results. With the help of the intermediate result caching mechanism, the real-time verification query volume and calculation volume of the ticket fare query system can be effectively reduced, thereby reducing the utilization rate of the CPU and memory resources of the search system cluster. This series of measures not only significantly improves the request response speed of the ticket fare query system, but also increases the concurrency of the query system cluster, laying a solid foundation for the efficient and stable operation of the system in a big data environment.

[0036] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. 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

[0037] 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.

[0038] Figure 1 A flow chart of a regular freight rate route verification preprocessing method provided in an embodiment of the present invention is shown;

[0039] Figure 2 A flowchart showing the coding steps of a regular freight rate route verification preprocessing method provided in an embodiment of the present invention;

[0040] Figure 3 A flowchart showing decoding steps of a regular freight rate route verification preprocessing method provided in an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution 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 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 are within the scope of protection of the present invention.

[0042] In the embodiment of the present invention, when a user initiates a route query request from the origin to the destination, and attaches a fare rule request such as travel time, fare discount, etc., the system will start the route verification process to determine whether the rule fare is applicable. This verification query is a real-time verification query, involving the processing of massive data and complex matching operations, and the amount of calculation is huge.

[0043] Specifically, if the queried route matches the exception route, it means that the user's query does not meet the regular freight rate requirements and the verification fails. If the queried route is not among the exception routes, it is further checked whether it is within the scope of applicable routes. If the applicable route can be successfully matched, it means that the user's query meets the regular freight rate and the verification is successful; otherwise, if no matching applicable route is found, the verification fails and the user may need to readjust the query conditions.

[0044] See also Figure 1 As shown, the embodiment of the present invention proposes a regular fare route verification preprocessing method to improve the request response speed of the ticket fare search system.

[0045] Table 1 lists 5 routes, and the route ID has been constructed in the database according to Orig+Dest. Orig is the origin, Dest is the destination, and *** is any place.

[0046] Table 1 Route table

[0047] Serial number Route ID Orig Dest 1 10 XMN SIA 2 11 CGO HTN 3 12 MIG CGO 4 13 *** SIA 5 14 MIG ***

[0048] S11: Generate a query combination of exact query and fuzzy query based on the origin and destination of the route.

[0049] The query combinations include: Orig+Dest, Orig+"***", "***"+Dest, "***"+"***", where Orig+Dest is used for precise query, and Orig+"***", "***"+Dest, "***"+"***" are used for fuzzy query. The query combinations generated by the origin and destination of the routes in Table 1 are shown in Table 2.

[0050] Table 2 Query combination table

[0051] Serial number result 1 XMN+SIA, XMN+***, ***+SIA, ***+*** 2 CGO+HTN, CGO+***, ***+HTN, ***+*** 3 MIG+CGO, MIG+***, ***+CGO, ***+*** 4 ***+SIA、***+*** 5 MIG+***、***+***

[0052] S12: Query the route ID corresponding to each combination. If it does not exist, the default value is -1.

[0053] Get the route IDs corresponding to the four combinations of each route. If the route ID does not exist, the default value is -1. See Table 3 for the results.

[0054] Table 3 Query combination corresponding route ID table

[0055]

[0056] S13: Construct a route data structure table with the origin and destination as the keys and the route ID as the value, and cache the route data structure table in memory. Refer to Table 4. When the origin and destination queried are the data in the Key column, the route ID that meets the conditions is the data in the Value column.

[0057] Table 4 Query Data Structure Table

[0058]

[0059] Preferably, the above data structure can be stored in a Map, and the data in the Map structure is cached in memory.

[0060] Before querying the freight rate rules, it is also necessary to sort out and store the freight rate rules and route regulations of the airline. A large amount of route data is included in one rule freight rate data, and the number of rule freight rate data is even larger. The large storage quantity increases the storage pressure. To reduce the amount of stored data, the encoding steps of the embodiments of the present invention are shown in Figure 2 as follows.

[0061] The encoding rule of the embodiments of the present invention is: capital letters A–Z correspond to numbers 0–5; lowercase letters a–z correspond to numbers 26–51; numbers 0–9 correspond to numbers 52–61; and the symbol “+” corresponds to number 62 and “ / ” corresponds to number 63. For example, the number of character A is 0, the number of character b is 27, the number of number 5 is 57, etc. Each character has a clear and fixed number corresponding to it.

[0062] S21: For any given integer N in the integer set, disassemble it in the way with 6 as the reference number, expressed as: N = 6k + r, where 0 < r ≤ 6, and the set composed of all k values is K.

[0063] Convert r into a binary string, and the converted binary string is expressed as b n-1 b n-2 …b i …b1b0, n is the number of bits of the binary string, n = 8, and each bit b i is determined by the following method:

[0064]

[0065] Exemplarily, encode the numbers 11, 12, 13, 14, 15, refer to Table 5:

[0066] Table 5 Binary String Encoding Table

[0067]

[0068] S22: Grouping is performed according to the k value, and the binary strings corresponding to the numbers with the same k value are classified into the same group. For the binary strings in each group, the binary addition rule is followed to perform an addition operation to obtain a new binary number, and then the new binary number is converted into a decimal number.

[0069] S23: Convert the converted decimal number into the corresponding character C according to the encoding rules k . See Table 6.

[0070] Table 6 Character conversion table

[0071] N k Binary Numbers Decimal Numbers <![CDATA[C k ]]> 11,12 1 00010000,00100000 00110000=48 <![CDATA[C1=w]]> 13,14,15 2 00000001,00000010,00000100 00000111=7 <![CDATA[C2=H]]>

[0072] S24: Determine the maximum value m in K and construct the final string S=c m c m-1 ...c j ...c2c1c0, each bit c j Determined by:

[0073]

[0074] After conversion, c j , see Table 7.

[0075] Table 7 Character correspondence table

[0076] j(m=2) <![CDATA[c j ]]> 0 <![CDATA[c0=A]]> 1 <![CDATA[c1=C1=w]]> 2 <![CDATA[c2=C2=H]]>

[0077] See Table 7, the encoded string is: S = c m c m-1 ...c j …c2c1c0=HwA.

[0078] In the embodiment of the present invention, after the airline's tariff rules and route regulations are sorted and stored, the stored route codes are used for pre-processing of verification.

[0079] S14: Query the applicable route code and the exception route code through the regular freight rate number. See Table 5.

[0080] Table 8 Regular freight rate table

[0081] Serial number Regular tariff number Applicable route code Exception route code 1 16287552747555400 HkDJ wxya 2 14013488448400 BnB none 3 14013489968500 none HA

[0082] S15: Decode the applicable route code and the exceptional route code, and convert them into an applicable route ID and an exceptional route ID.

[0083] See also Figure 3 As shown, the decoding of the embodiment of the present invention includes:

[0084] S151: Given a string S=c m c m-1 ...c j …c2c1c0, determine the length of string S and each character c in it j . Find all characters C that are not equal to character A in the string k , these C k The corresponding position indexes j form a set K, and the maximum value m in the set K is determined.

[0085] It should be noted that j is the index of string S, and k is the character C that is not equal to character A. k The index of j ≠A, then c j =C k ,j=k.

[0086] Exemplarily, HwA is decoded, see Table 9:

[0087] Table 9 String splitting table

[0088] <![CDATA[c j (m=2)]]> <![CDATA[C k ]]> k <![CDATA[c0=A]]> <![CDATA[c1=w]]> <![CDATA[C1=w]]> 1 <![CDATA[c2=H]]> <![CDATA[C2=H]]> 2

[0089] S152: Use the encoding rules to convert C k Restore to decimal.

[0090] S153: Convert decimal number to binary number b n-1 b n-2 …b i …b1b0, n is the number of bits of the binary string, n = 8. See Table 10.

[0091] Table 10 Binary string decoding table

[0092] <![CDATA[C k ]]> k Decimal Numbers <![CDATA[b n-1 b n-2 …b i …b1b0]]> <![CDATA[C1=w]]> 1 48 00110000 <![CDATA[C2=H]]> 2 7 00000111

[0093] S154: Calculate the original integer N using the formula N=6k+r, where if b i =1, r=i+1, k is C k The corresponding position index.

[0094] Table 11 Integer conversion table

[0095]

[0096] The decoded integers are 11, 12, 13, 14, 15.

[0097] After decoding the route codes in Table 8 according to the decoding method, the results are shown in Table 12.

[0098] Table 12 Regular freight rate decoding table

[0099] Serial number Regular tariff number Applicable routes Exception routes 1 16287552747555400 11、12、13、14、15 11、12 2 14013488448400 11、12、13 none 3 14013489968500 none 7、8、9

[0100] S16: construct a regular freight rate data structure table with the regular freight rate number as the key and the applicable route ID and the exception route ID as the value, and cache the regular freight rate data structure table in the memory.

[0101] Preferably, the above data structure can be stored in a Map, and the data of the Map structure can be cached in memory.

[0102] The user enters the requested departure point XMN (Xiamen) and destination SIA (Xi'an). The domestic regular fare number that meets the user's itinerary is 16287552747555400. The following will verify the applicable and exceptional routes of the regular fare 16287552747555400.

[0103] The origin and destination are combined into the key: XMN+SIA to search the route data cache. The result is shown in Table 13.

[0104] Table 13 Route data cache table

[0105] Serial number Key Value 1 XMN+SIA 10、-1、13、-1

[0106] The domestic regular freight rate data cache is searched according to the regular freight rate number 16287552747555400. The results are shown in Table 14.

[0107] Table 14 Regular freight rate cache table

[0108] Serial number Regular tariff number Applicable routes Exception routes 1 16287552747555400 11、12、13、14、15 11、12

[0109] Check if (10, -1, 13, -1) is in the exception routes (11, 12), and it does not exist. Continue to check if (10, -1, 13, -1) is in the applicable routes 11, 12, 13, 14, 15, and it exists. The check is successful, and the regular freight rate is applicable.

[0110] The application embodiment of the present invention provides a regular freight rate route verification preprocessing device, comprising:

[0111] Query combination generation module: used to generate query combinations of precise query and fuzzy query based on the origin and destination of the route;

[0112] Route query module: used to query the route ID corresponding to each combination. If it does not exist, the default value is -1;

[0113] Route data structure table construction module: used to construct a route data structure table with the origin and destination as the key and the route ID as the value, and cache the route data structure table into memory;

[0114] Code query module: used to query applicable route codes and exception route codes through regular freight rate numbers;

[0115] Decoding module: used to decode the applicable route code and the exception route code and convert them into the applicable route ID and the exception route ID;

[0116] Regular freight rate data structure table construction module: used to construct a regular freight rate data structure table with the regular freight rate number as the key, the applicable route ID and the exception route ID as the value, and cache the regular freight rate data structure table in the memory.

[0117] An application embodiment of the present invention provides a computer device, which includes a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor executes the steps of the regular freight rate route verification preprocessing method.

[0118] The application embodiment of the present invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps of the regular freight rate route verification preprocessing method.

[0119] An embodiment of the present invention further provides a computer program product corresponding to the regular freight rate route verification preprocessing method provided in the above embodiment, and the computer program product includes a computer program, and the computer program is executed by a processor to implement the regular freight rate route verification preprocessing method provided in the above embodiment.

[0120] The above description and the accompanying drawings fully illustrate the embodiments of the present invention so that those skilled in the art can practice them. Other embodiments may include structural and other changes. The embodiments represent only possible variations. Unless explicitly required, individual components and functions are optional, and the order of operations may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. The embodiments of the present invention are not limited to the structures described above and shown in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A regular freight rate route verification preprocessing method, characterized in that: Including: Generating query combinations for exact query and fuzzy query based on the origin and destination of the flight route; Querying the flight route ID corresponding to each combination, with a default value of -1 if not existent; Constructing a flight route data structure table with the origin and destination as the Key and the flight route ID as the Value, and caching the flight route data structure table in memory; Querying the applicable flight route code and the exception flight route code through the rule freight rate number; Decoding the applicable flight route code and the exception flight route code and converting them into the applicable flight route ID and the exception flight route ID; Constructing a rule freight rate data structure table with the rule freight rate number as the Key and the applicable flight route ID and the exception flight route ID as the Value, and caching the rule freight rate data structure table in memory.

2. The regular freight rate route verification preprocessing method according to claim 1 is characterized in that: The applicable flight route code and the exception flight route code include: For any given integer N in the integer set, disassembling it in the way with 6 as the reference number, expressed as: N = 6k + r, where 0 < r ≤ 6, and the set of all k values is K; Convert r to a binary string. The converted binary string is represented by b n-1 b n-2 …b i …b1b0, n is the number of bits in the binary string, n=8, each bit b i Determined by: Grouping according to the k value, classifying the binary strings corresponding to the numbers with the same k value into the same group. For the binary strings within each group, following the binary addition rule, performing the addition operation to obtain a new binary number, and then converting the new binary number into a decimal number; Convert the converted decimal number into the corresponding character C according to the encoding rules k ; Determine the maximum value m in K and construct the final string S = c m c m-1 ...c j ...c2c1c0, each bit c j Determined by:

3. The regular freight rate route verification preprocessing method according to claim 1 is characterized in that: The decoding of the applicable flight route code and the exception flight route code into the applicable flight route ID and the exception flight route ID includes: Given a string S = c m c m-1 ...c j …c2c1c0, determine the length of string S and each character c in it j , find all characters C that are not equal to character A from the string k , these C k The corresponding position indexes j form a set K, and the maximum value m in the set K is determined; Use the coding rules to convert C k Restore to decimal number; Convert a decimal number to binary b n-1 b n-2 …b i …b1b0, n is the number of bits in the binary string, n=8; Using the formula N = 6k + r, calculate the original integer N, where if b i =1, r=i+1, k is C k The corresponding position index.

4. The regular freight rate route verification preprocessing method according to claim 1 is characterized in that: The query combinations include: origin + destination, origin + "***", "***" + destination, "***" + "***", where *** is arbitrary and used for fuzzy query.

5. The regular freight rate route verification preprocessing method according to claim 1 is characterized in that: Caching the flight route data structure table in memory includes: Storing the flight route data structure table into a Map structure and caching the data of the Map structure in memory.

6. The regular freight rate route verification preprocessing method according to claim 1 is characterized in that: Caching the rule freight rate data structure table in memory includes: Storing the rule freight rate data structure table into a Map structure and caching the data of the Map structure in memory.

7. A regular freight rate route verification preprocessing device, characterized in that: Including: Query combination generation module: used to generate query combinations for exact query and fuzzy query based on the origin and destination of the flight route; Flight route query module: used to query the flight route ID corresponding to each combination, with a default value of -1 if not existent; Flight route data structure table construction module: used to construct a flight route data structure table with the origin and destination as the Key and the flight route ID as the Value, and caching the flight route data structure table in memory; Code query module: used to query the applicable flight route code and the exception flight route code through the rule freight rate number; Decoding module: used to decode the applicable flight route code and the exception flight route code and convert them into the applicable flight route ID and the exception flight route ID; Rule freight rate data structure table construction module: used to construct a rule freight rate data structure table with the rule freight rate number as the Key and the applicable flight route ID and the exception flight route ID as the Value, and caching the rule freight rate data structure table in memory.

8. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the computer program is executed by the processor, the processor executes the steps of the rule freight rate flight route verification preprocessing method described in any one of claims 1 - 6.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor executes the steps of the regular freight rate route verification preprocessing method as described in any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that The computer program is executed by a processor to implement the regular freight rate route verification preprocessing method according to any one of claims 1 to 6.