Query method and device based on multiple data sources, medium and electronic equipment
By adopting a multi-data source-based query method in the air ticketing system, using preset basic route database and data interface permissions, the problem of out-of-control search ratio is solved, and resource conservation and user experience improvement is achieved.
Patent Information
- Application Number
- CN202510248976.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-04-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the air ticketing system, a large number of interface calls cause the search ratio to get out of control, and there are problems with the system, and measures need to be taken to reasonably control the search ratio.
Using a query method based on multiple data sources, we determine the key executable routes through the preset basic route library, obtain the data sources to be updated, and obtain query data based on the permissions of the data interface, to avoid conducting full query of all data sources in each query.
Reduces the number of interface calls, controls the query ratio within a reasonable range, saves computer resources, and improves query speed and user experience.
Smart Images

Figure CN119759981A_ABST
Abstract
Description
Background Art
[0002] In the development of airline ticketing systems, there is a key indicator called the query-booking ratio. When the system is running, a large number of interface calls are triggered by user operations. When the user selects the departure and destination on the system interface, the system will send a query request to the corresponding airline interface based on the user input, obtain the corresponding air ticket quotation information, and display it to the user.
[0003] Domestic flight resources are abundant. Considering different travel dates, there may be millions of different query combinations every day. If you directly request the airline interface for each of these millions of queries, the query-booking ratio will easily get out of control, causing system problems. Therefore, effective measures must be taken during the R&D process to reasonably control the query-booking ratio to reduce the number of calls to the airline interface. Summary of the invention
[0004] In response to the above technical problems, the present application provides a query method, device, medium and electronic device based on multiple data sources, which at least partially solve the problems existing in the prior art.
[0005] In a first aspect of the present application, a query method based on multiple data sources is provided, the method comprising the following steps: S100, in response to receiving a target query request from a user, obtaining a target request server corresponding to the target query request from the user; wherein the target query request includes a target plan starting place, a target plan destination, and a target plan starting date; the target request server is used to query the user's target query request according to a corresponding data source; each data source has at least one data interface; each data interface has different permissions to obtain data from the corresponding data source; each data source sets a data interface for the target request server; S200, according to the target query request, determining at least one key executable route from a preset basic route library; wherein the preset basic route library contains a plurality of executable routes; each executable route has a corresponding executable date and a corresponding data source; the target plan start date is the same as any of the executable dates corresponding to the key executable routes, and the starting point and destination of the key executable route are respectively the same as the target plan start point and the target plan destination; S300, obtaining at least one data source to be updated according to each key executable route; wherein the data source to be updated is a data source corresponding to the key executable route; S400, controlling the target request server to obtain query data corresponding to the target query request according to the authority of the data interface set by each to-be-updated data source for the target request server.
[0006] In a second aspect of the present application, a query device based on multiple data sources is provided, the device comprising: The server acquisition unit is used to obtain the target request server corresponding to the user's target query request in response to receiving the user's target query request; wherein the target query request includes the target plan starting place, the target plan destination and the target plan starting date; the target request server is used to query the user's target query request according to the corresponding data source; each data source has at least one data interface; each data interface has different permissions to obtain data from the corresponding data source; each data source sets a data interface for the target request server; A task acquisition unit is used to determine at least one key executable route from a preset basic route library according to a target query request; wherein the preset basic route library contains a plurality of executable routes; each executable route has a corresponding executable date and a corresponding data source; the target plan start date is the same as any of the executable dates corresponding to the key executable routes, and the starting point and destination of the key executable route are respectively the same as the target plan start point and the target plan destination; A data source acquisition unit, configured to obtain at least one data source to be updated according to each key executable route; wherein the data source to be updated is a data source corresponding to the key executable route; The data acquisition unit is used to control the target request server to obtain the query data corresponding to the target query request according to the authority of the data interface set by each to-be-updated data source for the target request server.
[0007] In a third aspect of the present application, a non-transitory computer-readable storage medium is provided, in which at least one instruction or at least one program is stored, and the at least one instruction or at least one program is loaded and executed by a processor to implement the aforementioned query method based on multiple data sources.
[0008] In a fourth aspect of the present application, an electronic device is provided, comprising a processor and the above-mentioned non-transitory computer-readable storage medium.
[0009] This application has at least the following beneficial effects: The query method based on multiple data sources provided by the present application presets a basic route library so that when a user's query request is received, the data source to be updated can be determined according to the data source corresponding to the key executable route with the matching degree of the corresponding query request in the preset basic route library, so as to avoid full query of all data sources every time a query request is received, reduce the number of queries, control the query ratio within a reasonable range, save computer resource usage, save query time, and improve user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0011] Figure 1 A flowchart of a query method based on multiple data sources provided in an embodiment of the present application; Figure 2 A structural block diagram of a query device based on multiple data sources provided in an embodiment of the present application. DETAILED DESCRIPTION
[0012] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0013] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application 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 interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0014] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present application, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0015] Please refer to Figure 1As shown, an embodiment of the present application provides a query method based on multiple data sources, the method comprising the following steps: S100, in response to receiving a target query request from a user, obtaining a target request server corresponding to the target query request of the user; wherein the target query request includes a target plan starting place, a target plan destination and a target plan starting date; the target request server is used to query the user's target query request according to a corresponding data source; each data source has at least one data interface; each data interface has different permissions to obtain data from the corresponding data source; each data source sets a data interface for the target request server.
[0016] Specifically, the target query request includes the target plan starting place, the target plan destination and the target plan starting date. As an example: the target query request is: query the flights from place A to place B on December 31, 2024. The request server corresponding to the target query request can be any sales channel, which can be a mini program, APP, etc. Each request server can retrieve data from several data sources to process the user's query request. It has a corresponding display interface to display the corresponding query results for the user's query request. As an example: the data source can be a certain airline. Each data source has at least one data interface, which can be a direct sales interface or an indirect sales interface. Each data interface has different permissions to obtain data from the corresponding data source. As an example: the indirect sales interface of airline A can only obtain quotations for direct flights from airline A, but cannot obtain quotations for transfer routes provided by airline A.
[0017] It should be noted that each data source sets a data interface for each request server. That is, each request server has different permissions to obtain data from the corresponding data source. Therefore, each request server obtains different data from the corresponding data source, and the query results obtained by users for the same query request on different request servers may also be different.
[0018] S200, according to the target query request, determine at least one key executable route from a preset basic route library; wherein the preset basic route library contains a plurality of executable routes; each executable route has a corresponding executable date and a corresponding data source; the target plan start date is the same as any of the executable dates corresponding to the key executable route, and the starting point and destination of the key executable route are respectively the same as the target plan start point and the target plan destination.
[0019] Specifically, the preset basic route library includes several executable routes; wherein each executable route has a corresponding executable date and a corresponding data source. Further, several executable routes are divided into directly executable routes and indirectly executable routes. Among them, the directly executable route is a direct route, and the indirectly executable route is a transfer route. Among them, the data construction of the directly executable route comes from the AV database, and the AV database contains all flight plans for each route in the future planned time. In addition, due to the limitation of the authority of the airline, the airline data covered in the AV is incomplete. Therefore, the data construction of the directly executable route also enters all flight plans for the future planned time of each route through the airline interface. In addition, it is also manually supplemented through the management end. For the data construction of the directly executable route, on the one hand, it comes from the algorithm, which determines whether it can be executed according to the transfer route corresponding to the ticketed flight, so as to obtain the transfer plan corresponding to a part of the route. In addition, the guaranteed transfer plan of other platforms of the crawler can also be used as the transfer plan for a part of the route. It is also possible to access the transfer plan officially determined by the airline from the airline. Each executable route in the preset basic route library has a corresponding date or flight schedule, and also has a corresponding data source (airline). For example: query flights from A to B on December 31, 2024: the preset database includes executable route 1: on December 31, 2024, airline A can go directly from A to B; executable route 2: on December 31, 2024, airline A can go directly from A to B; executable route 3: on December 31, 2024, airline C can transfer from A to C and then arrive at B.
[0020] In this embodiment, according to the target planned starting place, the target planned destination and the target planned starting date in the target query request, at least one corresponding key executable route can be determined from the preset basic route library.
[0021] Here, the key executable route can be a direct route or a transit route, that is, the key executable route is a route that can satisfy the user's target query request.
[0022] S300, obtaining at least one data source to be updated according to each key executable route; wherein the data source to be updated is a data source corresponding to the key executable route.
[0023] Specifically, at least one data source to be updated is obtained according to each key executable route. Since each executable route in each preset basic route library has a corresponding data source, that is, each key executable route has a corresponding data source, as an example: the user's target query request is: query flights from A to B on December 31, 2024, and the preset database includes executable route 1: on December 31, 2024, airline B can go directly from A to B; executable route 2: on December 31, 2024, airline A can go directly from A to B; executable route 3: on December 31, 2024, airline C can transfer from A to C and then arrive at B. Then the data sources to be updated are airline A, airline B and airline C.
[0024] S400, controlling the target request server to obtain query data corresponding to the target query request according to the authority of the data interface set by each to-be-updated data source for the target request server.
[0025] Specifically, the query data comes from the data corresponding to the permissions of the data interface set by the target request server for the data source to be updated cached in the target request server, or the data obtained by the target request server from the data source to be updated according to the permissions of the data interface set by the target request server for the data source to be updated. As an example: the user's target query request is: query flights from A to B on December 31, 2024, and the preset database includes executable route 1: on December 31, 2024, airline B can go directly from A to B; executable route 2: on December 31, 2024, airline A can go directly from A to B; executable route 3: on December 31, 2024, airline C can transfer from A to C and then arrive at B. Then the data sources to be updated are airline B, airline A and airline C. The target request server corresponding to the target query request is the WeChat applet; the permission of airline B to the data interface of the WeChat applet is to only obtain the data of direct tasks; the permission of airline A and airline C to the data interface of the WeChat applet is to obtain all data; first, determine whether there is cache data of airline B's direct tasks and airline A and airline C's direct tasks and transfer tasks in the cache space of the WeChat applet. If so, update all direct task data of airline B on that date and all direct tasks and all transfer task data of airline A and airline C on that date according to the corresponding cache data, and obtain the corresponding query result from the updated data according to the target query request, wherein the query result includes the route of the corresponding flight (if it is a transfer, the transfer place is displayed), departure time and price (digital label). If there is no cached data of direct flights of airline B and direct flights and transfer flights of HNA in the WeChat applet, all direct flight data are obtained from airline B, and all direct flights and transfer flight data corresponding to the date are obtained from airline A and airline C, and the corresponding query results are obtained from the updated data according to the target query request.
[0026] In this embodiment, by presetting a basic route library, when a user's query request is received, the data source to be updated can be determined based on the data source corresponding to the key executable route with the corresponding query request matching degree in the preset basic route library, so as to avoid full query of all data sources every time a query request is received, thereby reducing the number of queries, controlling the query ratio within a reasonable range, saving computer resources, saving query time, and improving user experience.
[0027] In an exemplary embodiment of the present application, step S300 includes: S310, obtaining at least one initial data source to be updated according to the data source corresponding to each key executable route.
[0028] S320, if each key executable route corresponding to any initial data source to be updated is set with a preset label, then delete the initial data source to be updated to obtain at least one data source to be updated; wherein the preset label indicates that within a preset time period, the corresponding key executable route has no data to be queried in the corresponding data source.
[0029] The end time of the preset time period is the time when the user's target query request is received. The data to be queried is the digital label corresponding to the key executable route.
[0030] In this embodiment, the sources of executable routes in the preset basic route library are various. Due to the variability of planned tasks, there may be some executable routes that are no longer executed or are not executed within the current period of time due to changes in the plan. However, since the preset basic route library sets them as executable routes, when matching according to the user's query request, the key executable route may be matched. However, since it is no longer executed or is not executed within the current period of time, the corresponding data source has no corresponding data (digital label and specific execution information). At this time, in order to avoid waste of resources, a preset label is set for such data, and the preset label indicates that within the preset time period, the corresponding key executable route has no data to be queried in the corresponding data source. If each key executable route corresponding to any initial data source to be updated is set with a preset label, it means that each executable route corresponding to the initial data source to be updated is not currently executed, so the initial data source to be updated is deleted. In this way, the final valid data source to be updated is obtained.
[0031] In an exemplary embodiment of the present application, after step S400, the method further includes: S500: According to the user's target query request, a feature list T=(T1, T2, ..., T x , …, T y ); x = 1, 2, ..., y; where y is the number of date features of the target plan start date corresponding to the target query request; T x is the feature value corresponding to the x-th date feature.
[0032] Specifically, the feature value can be the day of the week: mark the day of the week corresponding to each target plan start date (0 represents Monday, 1 represents Tuesday, and so on, 6 represents Sunday; whether it is a weekend: generate binary features based on the mark of the day of the week, 1 represents the weekend (Saturday and Sunday), 0 represents the working day; whether it is a holiday: combine national statutory holidays, local special holidays and international holidays to mark whether the target plan start date is a holiday (1 represents yes, 0 represents no); and mark whether the target plan start date is within 3 days of the holiday. Get the corresponding feature value list.
[0033] S600, according to T, obtain the historical extension frequency corresponding to each date feature in the historical time window, so as to obtain the corresponding extension frequency list C=(C1, C2, ..., C x , …, C y ); where C x The historical extension frequency corresponding to the x-th date feature; C x =YC x / ZC x Among them, ZC x The number of query requests whose corresponding target plan start date in the historical time window meets the xth date feature; YC x The number of query requests that extended the target scheduled start date within the historical time window.
[0034] Specifically, as an example: if T x is the feature of "Whether the target plan start date is within 3 days of the holiday", and the corresponding feature value is 1, that is, within 3 days; then ZC x The number of query requests in the historical time window whose target plan start date is within 3 days of a holiday and which query the days before and after that day; x The total number of query requests within the historical time window whose target plan start date is within 3 days of a holiday.
[0035] S700, according to C, the comprehensive extension similarity ZH=(Σ y x=1 (α x ×C x )) / Σ y x=1 α x ; Among them, α x C x Corresponding feature weight; 0<α x <1.
[0036] Specifically, the larger the ZH is, the easier it is for the date feature of the date corresponding to the target query request of the above user to query not only the date, but also the data of the days before and after the date. At this time, due to some reasons, such as the proximity to holidays, the user's choice of travel time is flexible, so it is also easy to query the data of the days before and after the date. In addition, a corresponding weight is assigned to each feature. When the importance of the feature to the comprehensive extension similarity is different, the corresponding weight is different. The influence of important features is highlighted by weighted average.
[0037] S800, if ZH is greater than the preset similarity threshold, the target request server is controlled to obtain the query data within the preset time period before and after the target plan start date corresponding to the target query request according to the authority of the data interface set by each data source to be updated for the target request server.
[0038] Specifically, if ZH is greater than a preset similarity threshold, it means that the date feature of the date corresponding to the target query request of the above user is more likely to query not only the data of the date, but also the data of the days before and after the date. At this time, the target request server is controlled to obtain the query data within the preset time period before and after the target plan start date corresponding to the target query request according to the authority of the data interface set by each data source to be updated for the target request server. As an example: the preset time period can be one day.
[0039] In this embodiment, by obtaining the date feature in the user's target query request, it is determined whether the corresponding date is easy to control the target request server according to the authority of the data interface set by each data source to be updated for the target request server, and obtain the query data within the preset time period before and after the target plan start date corresponding to the target query request. When calling data, the data before and after the time are called at the same time, so that when the user queries the data before and after the time, it can be directly obtained without waiting for a long time, which can improve the user experience.
[0040] In an exemplary embodiment of the present application, the query and update of the query data (digital label) can also be based on the following steps: Sb1, in response to detecting that the target task has been executed, obtain the digital label corresponding to the target task; wherein, the target task has a corresponding executed server; the executed server is one of the multiple executable servers corresponding to the target task; the target task has a corresponding digital label on each executable server; the target task also has a corresponding target planned execution time, a target planned execution route and a target data source; the digital label corresponding to the target task on each executable server is provided by the target data source corresponding to the target task; each executable server has corresponding multiple planned tasks; the target task is a planned task executed by the executed server among the corresponding multiple planned tasks.
[0041] Specifically, as an example: the target task can be: a ticket issuance task for a ticket from A to C at 2:00 p.m. on December 31, 2024; the digital tag corresponding to the target task is the price of the ticket; the executed server corresponding to the target task is the platform for purchasing the ticket; wherein, the same ticket can be purchased from multiple platforms. And the price of the same ticket on different platforms may be different. The target plan execution time, target plan execution route and target data source corresponding to the target task are: planned departure time: 2:00 p.m. on December 31, 2024; route: A to C and airline: Airline B. The digital tag corresponding to the target task on each executable server is provided by the corresponding airline. As an example: the price of the ticket from A to C of Airline B at 2:00 p.m. on December 31, 2024 may be different on platform A and platform B, but both are provided by Airline B. Each ticket purchasing platform is an executable server, and there are multiple ticket issuance tasks that can be executed on each platform.
[0042] Sb2, if the digital label corresponding to the target task executed by the executed server is smaller than the target digital label corresponding to the target task in the cache of the server to be updated, then the planned time period to be updated corresponding to the server to be updated is obtained; wherein, the server to be updated is any executable server different from the executed server; the target planned execution time is the middle time point within the planned time period to be updated.
[0043] Specifically, as an example, if it is detected that the target task has been executed, as an example: it is detected that the ticket issuance task for a flight from A to C at 2 pm on December 31, 2024 has been executed, and the executed server corresponding to the ticket issuance task is platform A. At this time, the target server is platform B. If you search for flights from A to C on December 31, 2024 on platform B, based on the above search conditions, the price displayed on the current display interface of platform B is the lowest price of the day, that is, the target digital label. Platform B has a corresponding cache space. Based on the above search conditions, first search for all airfares from A to C on December 31, 2024 from the cache space of platform B, and display the lowest price on the current interface. If the lowest price displayed on the current interface is higher than the ticket price of the airfare from A to C at 2 pm on December 31, 2024 that has been executed by platform A, it means that the corresponding airline's airfare may have been updated at this time, but based on the preset update mechanism and other rules, the corresponding cache space of platform B has not timely retrieved the latest data from the airline to update the cache data. At this time, obtain the to-be-updated planned time period corresponding to the to-be-updated server. Here, the to-be-updated planned time period is a time period with the target plan execution time as the middle time point.
[0044] Sb3, obtain the key planned task list W=(W1, W2, ..., Wi , …, W n ); i = 1, 2, ..., n; where n is the number of key planned tasks corresponding to the planned time period to be updated; W i It is the task identifier corresponding to the i-th key planned task within the planned time period to be updated; the planned execution route of the key planned task is the same as the planned execution route of the target task, the planned execution time of the key planned task is different from the planned execution time of the target task, and the planned execution time of the key planned task is within the planned time period to be updated; the digital label corresponding to the key planned task in the cache of the execution server to be updated is greater than the digital label corresponding to the target task when the executed server executes the target task; the key planned task has a corresponding key data source.
[0045] Specifically, after determining the time period to be updated, obtain the key planned tasks in the time period that are the same as the route (target plan execution route) corresponding to the target task and whose corresponding digital labels are greater than the digital labels corresponding to the target task. That is, these key planned tasks are flights with a similar take-off time on the same day as the target task, and with the same take-off and landing places, and the prices of these flights are higher than the prices corresponding to the target task.
[0046] Sb4, controls the server to be updated to retrieve the corresponding digital label of each planned task from each data source to be updated, so as to update the digital label of each planned task on the display interface corresponding to each server to be updated; wherein the data source to be updated includes the target data source and each key data source.
[0047] Specifically, after determining W, in order to provide more air ticket options for this user or other subsequent users, platform B in this application retrieves data from the key data source (airline) and target data source (airline corresponding to the target task) corresponding to each key planning task in W, updates the displayed data on each executable server (platform), and updates the corresponding cached data at the same time.
[0048] In this embodiment, for any user of platform B, after detecting the low-price ticket purchase event on other platforms, according to the information corresponding to the low-price ticket purchase behavior, the platform B is triggered to retrieve the corresponding data of the low-price ticket purchase event from the airline corresponding to the low-price ticket purchase event. Under the control of the check ratio, the low-price ticket purchase event is used to trigger the retrieval of data from the airline, which is convenient for timely updating of data so that the user may re-select the platform to place an order. In addition, timely data update can avoid the platform from losing a large number of customers. On the other hand, in order to provide more travel time options for subsequent users, in this embodiment, not only the data of the airline corresponding to the low-price ticket purchase event is updated, but also the price data of the airline corresponding to the high-price ticket (the corresponding price is higher than the price of the low-price ticket purchase event) for a period of time before and after the scheduled departure time of the ticket corresponding to the low-price ticket purchase event is updated. In this way, more travel time options are provided for the user or other subsequent users, and more accurate prices are provided for the corresponding tickets. Improve the user experience.
[0049] In an exemplary embodiment of the present application, after step Sb1, the method further includes: Sb5, if the digital label corresponding to the target task executed by the executed server is smaller than the target digital label corresponding to the target task in the cache of the server to be updated, the server to be updated is controlled to retrieve the corresponding digital label of each planned task from each data source to be updated, so as to update the digital label of each planned task on the display interface corresponding to each server to be updated; wherein, the data source to be updated includes the target data source.
[0050] Specifically, in this embodiment, only the digital label of each planned task corresponding to the target data source is updated because in some cases, users have preference information for certain data sources. For example, a user may be a loyal user of a certain data source (airline). In this case, there is no need to update the data of other data sources (airlines), which saves resources and reduces the time for data retrieval.
[0051] In an exemplary embodiment of the present application, after step Sb2, the method further includes: Sb6, obtaining the historical task execution times N of the executing user corresponding to the target task.
[0052] Specifically, the number of times the executing user corresponding to the target task has purchased air tickets in history is obtained. Here, in this application, the executing user of the target task is a registered user of platform B (the server to be updated), so the air ticket purchase information on other platforms (executable servers) can be obtained. Here, the historical task may be executed on multiple platforms separately.
[0053] Sb7, if N is equal to or less than the preset number threshold Nc, it is determined that the executing user corresponding to the target task is a first type of user, and jump to step Sb3.
[0054] Specifically, if N is equal to or less than the preset number threshold Nc, it means that the user may seldom take a flight and buy tickets less frequently. For such users, not only the airline data corresponding to the low-price ticket purchase event is updated, but also the price data of the airline corresponding to the high-price ticket (the corresponding price is higher than the price of the low-price ticket purchase event) for a period of time before and after the scheduled departure time of the ticket corresponding to the low-price ticket purchase event is updated. In this way, more travel time options are provided for the user or other subsequent users, and more accurate prices are provided for the corresponding tickets. Improve the user experience.
[0055] In an exemplary embodiment of the present application, after step Sb6, the method further includes: Sb8, if N is greater than the preset number threshold Nc, then obtain the data source corresponding to the executing user of the target task when executing each historical task, so as to obtain the data source identification list Y=(Y1, Y2, ..., Y j , …, Y m ); j = 1, 2, ..., m; where m is the number of data sources corresponding to N historical tasks; Y j is the data source identifier of the corresponding j-th data source.
[0056] Specifically, if N is greater than a preset number threshold Nc, it means that the user corresponding to the target task may have taken a large number of flights. At this time, the data source (airline) corresponding to the executing user corresponding to the target task when executing each historical task is obtained.
[0057] Sb9, according to Y, get the data source ratio list B = (B1, B2, ..., B j , …, B m ); where B j is the proportion corresponding to the i-th data source; B j =BN j / N; BN j is the historical execution times corresponding to the j-th data source.
[0058] As an example: if N=50, B j is the proportion of passengers taking airline A, BNj=10, then B j =1 / 5.
[0059] Sb10, if the jth data source is the target data source, and B jIf the ratio is equal to or less than the preset ratio threshold, the digital label corresponding to each historical task of the executing user corresponding to the target task is obtained to obtain a historical digital label list S = (S1, S2, ..., S a , …, S N ); a = 1, 2, ..., N; where S a It is the numerical label corresponding to the executing user of the target task when executing the ath historical task; each historical task also has a corresponding departure date.
[0060] Specifically, if the jth data source is the target data source, and B j Equal to or less than a preset ratio threshold, that is, if the ratio corresponding to the target data source is less than the preset ratio threshold, it means that the user does not prefer to purchase flights from the target data source, and may prefer other flights or low-cost flights.
[0061] Sb11, according to S and the departure date corresponding to each historical task, obtain the first digital label list YP = (YP1, YP2, ..., YP a , …, YP N ); among which, YP a is the first average digital label corresponding to the a-th historical task; the first average digital label is the average of the digital labels corresponding to several first key historical tasks when they are executed; the execution route corresponding to the first key historical task is the same as the execution route of the corresponding historical task, and the execution date corresponding to the first key historical task is within the first time window before the departure date of the corresponding historical task; the end time of the first time window is the departure date of the corresponding historical task.
[0062] Sb12, according to S and the departure date corresponding to each historical task, obtain the second digital label list EP = (EP1, EP2, ..., EP a , …, EP N ); Among them, EP a is the second average digital label corresponding to the a-th historical task; the second average digital label is the average of the digital labels corresponding to several second key historical tasks when they are executed; the execution route corresponding to the second key historical task is the same as the execution route of the corresponding historical task, and the execution date corresponding to the second key historical task is within the second time window before the departure date of the corresponding historical task; the time length of the second time window is greater than the time length of the first time window, and the end time of the second time window is the departure date of the corresponding historical task.
[0063] Specifically, the average price paid by other users for purchasing the route within the first time window and the second time window before the execution date (departure date) corresponding to the historical task when the executing user corresponding to the target task executes each historical task is obtained respectively. The first time window may be one week before the execution date (departure date) corresponding to the historical task, and the second time window may be one month before the execution date (departure date) corresponding to the historical task.
[0064] Sb13, obtaining a third category preference score SP according to S, the first digital label list and the second label list.
[0065] SP meets the following conditions: SP=Σ N a=1 AI a / N Among them, AI a For S a Corresponding digital label advantage index, AI a Meet the following conditions: If S a ≤EP a , then AI a =1+(EP a -S a ) / EP a ; If EP a <S a ≤YP a , then AI a =(YP a -S a ) / YP a ; If S a >YP a , then AI a =0.
[0066] Specifically, if the digital label (purchase price) corresponding to the target task's executing user when executing the ath historical task is less than or equal to the monthly average price EP of the same route a, it means that the price advantage is relatively large, because in order to plan the flight occupancy rate in advance, airlines will launch some discounted tickets long before the flight takes off to encourage passengers to book in advance. One month in advance is relatively ample time, and airlines are more likely to release low-priced tickets to attract passengers to confirm their itineraries as early as possible and fill up the flight seats. As the departure date approaches, the number of remaining tickets decreases, and airlines may increase prices to obtain higher profits. Moreover, one month in advance, passengers' travel plans are relatively more scattered and market demand is relatively stable. In order to attract more customers, airlines will offer relatively low prices. One week in advance, the travel needs of many passengers have been determined, and the market demand is relatively concentrated. Airlines will take advantage of this increase in demand to increase ticket prices. If the digital label (purchase price) corresponding to the executing user of the target task is greater than the monthly average price EP of the same route when executing the ath historical task a However, if it is less than or equal to the weekly average price of the same route, it means that the price advantage is smaller than the monthly average price. Otherwise, the price advantage is 0.
[0067] Furthermore, the price advantage index of each ticket purchase price in history is summed up to obtain the third type preference score SP.
[0068] Sb14, if the third category preference score is greater than the preset preference score threshold, it is determined that the executing user corresponding to the target task is a second category user, and jump to step Sb3.
[0069] Specifically, if the third category preference score is greater than the preset preference score threshold, it means that the executing user corresponding to the target task prefers to buy low-priced tickets. At this time, not only the data of the airline corresponding to the low-priced ticket purchase event is updated, but also the price data of the airline corresponding to the high-priced tickets (the corresponding price is higher than the price of the low-priced ticket purchase event) before and after the scheduled departure time of the ticket corresponding to the low-priced ticket purchase event is updated. In this way, more travel time and ticket price options are provided for the user to change the ticket or other subsequent users, and more accurate prices are provided for the corresponding tickets. Improve the user experience.
[0070] In this embodiment, the user's multiple historical purchase behaviors corresponding to the target task are used to obtain the user's portrait, thereby obtaining the user's preferences and providing the user with a suitable ticket update plan. On the one hand, for the user, many options for changing the ticket can be provided, and more accurate prices can also be provided for other users who purchase tickets later.
[0071] In an exemplary embodiment of the present application, after step Sb9, the method further includes: Sb15, if B jIf the ratio is greater than a preset threshold and the j-th data source is the target data source, it is determined that the executing user corresponding to the target task is a third type of user, and the process jumps to step Sb5.
[0072] In this embodiment, if B j If the ratio is greater than the preset threshold and the jth data source is the target data source, it means that the executing user corresponding to the target task is a loyal user of the target data source, does not care much about the price factor, and gives priority to airlines. At this time, in order to save resources and improve update efficiency, only data is retrieved from the target data source to update the display interface of the corresponding platform. To provide the user with updated price information.
[0073] Please refer to Figure 2 As shown, an embodiment of the present application provides a query device 100 based on multiple data sources, the device comprising: The server acquisition unit 110 is used to obtain the target request server corresponding to the user's target query request in response to receiving the user's target query request; wherein the target query request includes the target plan starting place, the target plan destination and the target plan start date; the target request server is used to query the user's target query request according to the corresponding data source; each data source has at least one data interface; each data interface has different permissions to obtain data from the corresponding data source; each data source sets a data interface for the target request server.
[0074] The task acquisition unit 120 is used to determine at least one key executable route from a preset basic route library according to a target query request; wherein the preset basic route library contains a plurality of executable routes; each executable route has a corresponding executable date and a corresponding data source; the target plan start date is the same as any of the executable dates corresponding to the key executable route, and the starting point and destination of the key executable route are respectively the same as the target plan start point and the target plan destination.
[0075] The data source acquisition unit 130 is used to obtain at least one data source to be updated according to each key executable route; wherein the data source to be updated is a data source corresponding to the key executable route.
[0076] The data acquisition unit 140 is used to control the target request server to obtain the query data corresponding to the target query request according to the authority of the data interface set by each to-be-updated data source for the target request server.
[0077] An embodiment of the present application further provides a computer program product, which includes program code. When the program product is run on an electronic device, the program code is used to enable the electronic device to execute the steps of the method according to various exemplary embodiments of the present application described above in this specification.
[0078] In addition, although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0079] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation method of the present application.
[0080] In an exemplary embodiment of the present application, an electronic device capable of implementing the above method is also provided.
[0081] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.
[0082] The electronic device according to this embodiment of the present application is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0083] The electronic device is presented in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: the at least one processor mentioned above, the at least one storage device mentioned above, and a bus connecting different system components (including storage devices and processors).
[0084] The storage stores program codes, which can be executed by the processor, so that the processor executes the steps described in the above “Exemplary Method” section of this specification according to various exemplary embodiments of the present application.
[0085] The memory may include readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory, and may further include read only memory (ROM).
[0086] The storage may also include a program / utility having a set (at least one) of program modules, such program modules including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0087] The bus may represent one or more of several types of bus structures including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.
[0088] The electronic device may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may communicate with one or more devices that enable a user to interact with the electronic device, and / or may communicate with any device (e.g., routers, modems, etc.) that enables the electronic device to communicate with one or more other computing devices. This communication may be performed through an input / output (I / O) interface. In addition, the electronic device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter. As shown in the figure, the network adapter communicates with other modules of the electronic device through a bus. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0089] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation method of the present application.
[0090] In an exemplary embodiment of the present application, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present application can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present application described in the above "Exemplary Method" section of the present specification.
[0091] The program product may adopt any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0092] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0093] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0094] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0095] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present application, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0096] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0097] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A query method based on multiple data sources, characterized in that: The method comprises: S100, in response to receiving a target query request from a user, obtaining a target request server corresponding to the target query request from the user; wherein the target query request includes a target plan starting place, a target plan destination, and a target plan starting date; the target request server is used to query the user's target query request according to a corresponding data source; each data source has at least one data interface; each data interface has different permissions to obtain data from the corresponding data source; each data source sets a data interface for the target request server; S200, according to the target query request, determining at least one key executable route from a preset basic route library; wherein the preset basic route library contains a plurality of executable routes; each executable route has a corresponding executable date and a corresponding data source; the target plan start date is the same as any of the executable dates corresponding to the key executable routes, and the starting point and destination of the key executable route are respectively the same as the target plan start point and the target plan destination; S300, obtaining at least one data source to be updated according to each key executable route; wherein the data source to be updated is a data source corresponding to the key executable route; S400, controlling the target request server to obtain query data corresponding to the target query request according to the authority of the data interface set by each to-be-updated data source for the target request server.
2. The query method based on multiple data sources according to claim 1, characterized in that: The key executable routes include direct executable routes and indirect executable routes.
3. The query method based on multiple data sources according to claim 2, characterized in that: Step S300 includes: S310, obtaining at least one initial data source to be updated according to the data source corresponding to each key executable route; S320, if each key executable route corresponding to any initial data source to be updated is set with a preset label, then delete the initial data source to be updated to obtain at least one data source to be updated; wherein the preset label indicates that within a preset time period, the corresponding key executable route has no data to be queried in the corresponding data source.
4. The query method based on multiple data sources according to claim 3, characterized in that: The end time of the preset time period is the time when the user's target query request is received.
5. The query method based on multiple data sources according to claim 3, characterized in that: The data to be queried are digital labels corresponding to key executable routes.
6. The query method based on multiple data sources according to claim 1, characterized in that: After step S400, the method further includes: S500: According to the user's target query request, a feature list T=(T1, T2, ..., T x ,…,T y ); x = 1, 2, ..., y; where y is the number of date features of the target plan start date corresponding to the target query request; T x is the feature value corresponding to the x-th date feature; S600, according to T, obtain the historical extension frequency corresponding to each date feature in the historical time window, so as to obtain the corresponding extension frequency list C=(C1, C2, ..., C x , …, C y ); where C x The historical extension frequency corresponding to the x-th date feature; C x =YC x / ZC x Among them, ZC x The number of query requests whose corresponding target plan start date in the historical time window meets the xth date feature; YC x The number of query requests that extended the target scheduled start date within the historical time window; S700, according to C, the comprehensive extension similarity ZH=(Σ y x=1 (α x ×C x )) / Σ y x=1 α x ; Among them, α x C x Corresponding feature weight; 0<α x <1; S800, if ZH is greater than the preset similarity threshold, the target request server is controlled to obtain the query data within the preset time period before and after the target plan start date corresponding to the target query request according to the authority of the data interface set by each data source to be updated for the target request server.
7. A query device based on multiple data sources, characterized in that: The device comprises: The server acquisition unit is used to obtain the target request server corresponding to the user's target query request in response to receiving the user's target query request; wherein the target query request includes the target plan starting place, the target plan destination and the target plan starting date; the target request server is used to query the user's target query request according to the corresponding data source; each data source has at least one data interface; each data interface has different permissions to obtain data from the corresponding data source; each data source sets a data interface for the target request server; A task acquisition unit is used to determine at least one key executable route from a preset basic route library according to a target query request; wherein the preset basic route library contains a plurality of executable routes; each executable route has a corresponding executable date and a corresponding data source; the target plan start date is the same as any of the executable dates corresponding to the key executable routes, and the starting point and destination of the key executable route are respectively the same as the target plan start point and the target plan destination; A data source acquisition unit, configured to obtain at least one data source to be updated according to each key executable route; wherein the data source to be updated is a data source corresponding to the key executable route; The data acquisition unit is used to control the target request server to obtain the query data corresponding to the target query request according to the authority of the data interface set by each to-be-updated data source for the target request server.
8. A non-transitory computer-readable storage medium, characterized in that: The storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the method as claimed in any one of claims 1 to 6.
9. An electronic device, characterized in that: The invention comprises a processor and the non-transitory computer-readable storage medium as claimed in claim 8.
Citation Information
Patent Citations
Control method and device for check-order ratio of airline tickets, server and storage medium
CN108628998A
Air ticket recommendation method and device
CN113901351A
Method and device for identifying travel purpose of user and readable storage medium
CN113946757A
Data updating method, medium and electronic equipment
CN117216076A
Departure flight data updating method and related device
WO2023273518A1
Cited By
Method and device for determining setting position of movable green toilet, medium and equipment
CN120316199A
Method, device, medium and equipment for determining the location of movable green toilets
CN120316199B