Methods, devices, media, and electronic equipment for updating display attribute values from multiple data sources
By optimizing the update frequency and resource utilization of data sources in a multi-data source hotel booking system, the problem of untimely price display was solved, and the rational allocation of resources and timely price updates were achieved.
Patent Information
- Application Number
- CN202410482233.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-22
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-04-22
AI Technical Summary
In multi-data source hotel booking systems, existing technologies struggle to accurately determine the price update frequency of each data source, leading to resource waste and untimely display updates.
The system obtains the retrieval time of the target data source by pre-setting a polling time interval, calculates the target time interval, determines the data source to be retrieved, and displays the lowest price on the display interface, thereby optimizing the update frequency and resource utilization of the data source.
This approach enables the rational allocation of data source resources, ensuring the timeliness and accuracy of price display, reducing resource waste, and improving user experience.
Smart Images

Figure CN118365394B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and in particular to methods, apparatus, media, and electronic devices for updating display attribute values from multiple data sources. Background Technology
[0002] When booking hotels, users often compare prices from multiple data sources. This has led to the development of multi-data-source hotel booking systems. Users can obtain prices for the same hotel from different data sources within the same system to book at the best price. Due to the large number of hotels, to provide users with a better price comparison solution, the lowest price is displayed on the initial screen for each hotel. However, updating the lowest price across different data sources within a multi-data-source hotel booking system requires retrieving the corresponding prices from the servers of those data sources. Since different data sources have different server configurations, and users have varying levels of interest or usage frequency, there is a pressing need for a data retrieval method for multiple data sources that ensures the lowest price for each hotel is updated at an appropriate frequency while conserving resources. Summary of the Invention
[0003] To address the aforementioned technical problems, this application provides a method, apparatus, medium, and electronic device for updating display attribute values from multiple data sources, which at least partially solves the problems existing in the prior art.
[0004] In a first aspect of this application, a method for updating display attribute values from multiple data sources is provided, the method comprising the following steps:
[0005] S100, at each preset polling time interval, obtain the most recent retrieval time of each target data source corresponding to the target subject with respect to the target's bookable date, to obtain the retrieval time set T = (T1, T2, ..., T...). i ,…,T n ); i = 1, 2, ..., n; where n is the number of target data sources corresponding to the target subject; Ti is the time when the target attribute value corresponding to the target subject was last retrieved from the i-th target data source; the same target data source has a corresponding preset update time interval on different pre-bookable dates; the target subject has a corresponding currently displayed attribute value and a currently cached attribute value, and the currently displayed attribute value is the minimum value among the currently cached attribute values.
[0006] S200, based on T, obtain the target time interval set G = (G1, G2, ..., G...). i , ..., G n ); where G i For T i The corresponding target time interval; G i =Tnow -T i ;T now The start time of the current target polling event.
[0007] S300, based on G, obtain the target data source set S = (S1, S2, ..., S...) corresponding to the current target polling event. j S m ); j = 1, 2, ..., m; where m is the number of target data sources whose corresponding target time interval is greater than the corresponding preset update time interval; S j The j-th target data source has a target time interval greater than the corresponding preset update time interval.
[0008] S400, if S is not empty, then retrieve the target attribute values corresponding to the target subject from the corresponding target data source to obtain the target attribute value list set X = (X1, X2, ..., X...). j , ..., X m ); X j For S j The corresponding list of target attribute values; X j =(X j1 X j2 , ..., X jp , ..., X jq ); p = 1, 2, ..., q; q is the number of target sub-sub ... jp For S j The target attribute value corresponding to the p-th target sub-sub ...
[0009] S500, if the target attribute value corresponding to MIN(X) is less than the current display attribute value of the target entity, then the current display attribute value is replaced with the target attribute value corresponding to MIN(X) and displayed on the corresponding display interface; MIN() is a preset minimum value determination function.
[0010] In a second aspect of this application, a display attribute value updating device with multiple data sources is provided, the device comprising:
[0011] The retrieval time acquisition unit is used to acquire the most recent retrieval time of each target data source corresponding to the target subject with respect to the target's bookable date at preset polling time intervals, so as to obtain the retrieval time set T = (T1, T2, ..., T...). i ,…,T n); i = 1, 2, ..., n; where n is the number of target data sources corresponding to the target subject; Ti is the time when the target attribute value corresponding to the target subject was last retrieved from the i-th target data source; the same target data source has a corresponding preset update time interval on different pre-bookable dates; the target subject has a corresponding currently displayed attribute value and a currently cached attribute value, and the currently displayed attribute value is the minimum value among the currently cached attribute values.
[0012] The interval acquisition unit is used to obtain the target time interval set G = (G1, G2, ..., G...) based on T. i , ..., G n ); where G i For T i The corresponding target time interval; G i =T now -T i ;T now The start time of the current target polling event.
[0013] The data source determination unit is used to obtain, based on G, the set of target data sources to be retrieved, S = (S1, S2, ..., S...). j S m ); j = 1, 2, ..., m; where m is the number of target data sources whose corresponding target time interval is greater than the corresponding preset update time interval; S j The j-th target data source has a target time interval greater than the corresponding preset update time interval.
[0014] The retrieval unit is used to retrieve the target attribute values corresponding to the target subject from the corresponding target data source if S is not empty, so as to obtain a list set of target attribute values X = (X1, X2, ..., X...). j , ..., X m ); X j For S j The corresponding list of target attribute values; X j =(X j1 X j2 , ..., X jp , ..., X jq ); p = 1, 2, ..., q; q is the number of target sub-sub ... jp For S j The target attribute value corresponding to the p-th target sub-sub ...
[0015] The display unit is used to replace the current display attribute value with the target attribute value corresponding to MIN(X) if the target attribute value corresponding to MIN(X) is less than the current display attribute value of the target entity, and then display it on the corresponding display interface; MIN() is a preset minimum value determination function.
[0016] In a third aspect of this application, a non-transitory computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored in the storage medium, and the at least one instruction or at least one program is loaded and executed by a processor to implement the aforementioned method for updating display attribute values of multiple data sources.
[0017] In a fourth aspect of this application, an electronic device is provided, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0018] This application has at least the following beneficial effects:
[0019] The method for updating display attribute values from multiple data sources provided in this application involves a preset polling time interval. It retrieves the most recent call time for each target data source corresponding to the target subject with respect to a target pre-bookable date. For the same target data source, there are corresponding preset update time intervals for different pre-bookable dates; similarly, there are preset update time intervals for different target data sources. The preset update time interval represents a suitable time interval between two updates of the corresponding target data source. This ensures reasonable utilization of target data source resources while maintaining a suitable update frequency. Secondly, it obtains a set of target time intervals G. If a target data source has a target time interval greater than its corresponding preset update time interval, it indicates that the target data source has not been updated within the time interval greater than the corresponding preset update time interval. In this case, an update should be performed. In other words, the target polling event in this application is to detect whether each target data source is being used appropriately. In summary, if S is not empty, the list of target attribute values corresponding to the target subject is retrieved from the corresponding target data source. Since the same target subject in this application corresponds to multiple target data sources, and for clarity when finally displayed to the user, it is preferable to display the minimum attribute value among all target attribute values from all target data sources on the initial display interface corresponding to the target subject. Therefore, in this application, if the target attribute value corresponding to MIN(X) is less than the current display attribute value of the target subject, the current display attribute value is replaced with the target attribute value corresponding to MIN(X). The multi-data source display attribute value update method disclosed in this application achieves a reasonable allocation of target data source configuration resources and determines a more reasonable calling frequency for each different target data source, ensuring a reasonable update frequency for the current display attribute value. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 A flowchart of a method for updating display attribute values from multiple data sources provided in this application embodiment;
[0022] Figure 2 This is a structural block diagram of a multi-data source display attribute value update device provided in an embodiment of this application. Detailed Implementation
[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0025] It should be noted that the following description covers various aspects of embodiments within the scope of the appended claims. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this application, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.
[0026] Please refer to Figure 1 As shown, embodiments of this application provide a method for updating display attribute values from multiple data sources, the method comprising the following steps:
[0027] S100, at each preset polling time interval, obtain the most recent retrieval time of each target data source corresponding to the target subject with respect to the target's bookable date, to obtain the retrieval time set T = (T1, T2, ..., T...). i ,…,T n ); i = 1, 2, ..., n; where n is the number of target data sources corresponding to the target subject; Ti is the time when the target attribute value corresponding to the target subject was last retrieved from the i-th target data source; the same target data source has a corresponding preset update time interval on different pre-bookable dates; the target subject has a corresponding currently displayed attribute value and a currently cached attribute value, and the currently displayed attribute value is the minimum value among the currently cached attribute values.
[0028] Specifically, a target polling time is initiated at each preset polling interval. For example: the target entity is Hotel A; the target bookable date is the bookable date corresponding to Hotel A; the target data source is a data source that allows booking Hotel A, such as Meituan or Ctrip; the target attribute value is price. In this application, when a user queries or places an order for a specific target data source, the target attribute value of the target entity is retrieved from the corresponding target data source. When a target polling event occurs for each target data source, the target attribute value of the target entity may be retrieved from the corresponding target data source. Furthermore, when the current target polling event begins, the most recent retrieval time for each target data source corresponding to the target entity regarding the target bookable date is first obtained (e.g., the most recent retrieval time for the price data corresponding to Hotel A on March 20, 2024 is obtained). For the same target data source, there are corresponding preset update intervals for different bookable dates. For different target data sources, there are corresponding preset update intervals. The preset update interval represents a suitable time interval between two updates of the corresponding target data source. This ensures reasonable utilization of target data source resources while maintaining a relatively appropriate update frequency.
[0029] S200, based on T, obtain the target time interval set G = (G1, G2, ..., G...). i , ..., G n ); where G i For T i The corresponding target time interval; G i =T now -T i ;T now The start time of the current target polling event.
[0030] Specifically, G i For T i The corresponding target time interval represents the time difference between the current target polling event and the time when the i-th target data source retrieves the target attribute value corresponding to the target subject.
[0031] S300, based on G, obtain the target data source set S = (S1, S2, ..., S...) corresponding to the current target polling event. j S m ); j = 1, 2, ..., m; where m is the number of target data sources whose corresponding target time interval is greater than the corresponding preset update time interval; S j The j-th target data source has a target time interval greater than the corresponding preset update time interval.
[0032] S400, if S is not empty, then retrieve the target attribute values corresponding to the target subject from the corresponding target data source to obtain the target attribute value list set X = (X1, X2, ..., X...). j , ..., X m ); X j For S j The corresponding list of target attribute values; X j =(X j1 X j2 , ..., X jp , ..., X jq ); p = 1, 2, ..., q; q is the number of target sub-sub ... jp For S j The target attribute value corresponding to the p-th target sub-sub ...
[0033] Specifically, if a target data source has a target time interval greater than its corresponding preset update time interval, it indicates that the target data source has not been updated within that time interval. In this case, an update should be performed. That is, the target polling event in this application is to detect whether each target data source is being called appropriately. In summary, if S is not empty, the target attribute value list corresponding to the target subject is retrieved from the corresponding target data source. Here, it should be noted that, as an example, the target sub-subject can be a specific room type included in Hotel A, and each room type has a corresponding target attribute value (price). The target attribute value list of Hotel A is the price list for each room type of Hotel A.
[0034] S500, if the target attribute value corresponding to MIN(X) is less than the current display attribute value of the target entity, then the current display attribute value is replaced with the target attribute value corresponding to MIN(X) and displayed on the corresponding display interface; MIN() is a preset minimum value determination function.
[0035] Specifically, the current displayed attribute value of the target entity is the minimum attribute value among all currently cached attribute values corresponding to the target entity. For example, the current displayed attribute value of Hotel A is 260 yuan, which is the price of room type A1 of Hotel A on the Meituan data source; and this 260 yuan is the lowest price corresponding to Hotel A. That is, for Hotel A, except for the price of room type A1 on the Meituan data source, there is currently no price of any room type from any data source that is less than 260 yuan.
[0036] The target attribute value corresponding to MIN(X) is the minimum attribute value among all target attribute values corresponding to the target subject. If it is less than the current displayed attribute value of the target subject, that is, the minimum price of Hotel A has changed, the current displayed attribute value is replaced with the target attribute value corresponding to MIN(X) and displayed on the corresponding display interface.
[0037] The method for updating the data source retrieval time set in this application realizes the reasonable allocation of target data source configuration resources and determines a more reasonable call frequency for each different target data source, thus ensuring a reasonable update frequency for target attribute data.
[0038] In one exemplary embodiment of this application, after step S400, the method further includes:
[0039] S600, if MIN(X) j The corresponding target attribute value is less than S. j The corresponding current minimum target attribute value will then be T. i Replace with T now MIN() is a preset function for determining the minimum value.
[0040] Specifically, since the same target entity in this application corresponds to multiple target data sources, and for clarity when ultimately displayed to the user, it is preferable to display the minimum attribute value (i.e., the lowest price of Hotel A) among all target attribute values from all target data sources on the initial interface corresponding to the target hotel. This minimum price may be the price corresponding to room type A1 on Meituan. Therefore, if the minimum attribute value of any target data source is updated, it may lead to an update of the minimum price of the corresponding target entity. Thus, in this application, when the minimum attribute value of any target data source is updated, its corresponding retrieval time is updated, rather than updating the retrieval time for each target attribute value update, saving resources. After the retrieval time is updated, when a user queries or places an order for any room type of the target data source, and at the start of the next target polling event, the updated retrieval time is used as a reference to determine whether to retrieve the corresponding target attribute value.
[0041] In one exemplary embodiment of this application, after step S400, the method further includes:
[0042] S700, iterate through X to obtain a list set of key target attribute values M = (M1, M2, ..., M...). x M y ); x = 1, 2, ..., y; where y is the number of target data sources including key target attribute values; key target attribute values are target attribute values that are different from the corresponding currently cached attribute values; M x M is the list of key target attribute values corresponding to the x-th target data source that includes key target attribute values; x =(M x1 M x2 M xr M xf(x) ); r = 1, 2, ..., f(x); f(x) is the number of key target attribute values included in the x-th target data source that includes key target attribute values; M xr For the x-th key target attribute value in the target data source that includes key target attribute values;
[0043] S800: Replace the corresponding current cached attribute value with the key target attribute value in M to obtain the updated cached attribute value.
[0044] Specifically, several target data sources, including key target attribute values, are identified from X. These key target attribute values differ from the corresponding currently cached attribute values, representing changes in the price of a particular room type. The current price is updated based on the updated price to obtain updated cached attribute values. These updated cached attribute values and the unupdated current cached attribute values are displayed to the user when they click on the tab corresponding to the target entity. That is, when the user clicks on the tab corresponding to Hotel A, the latest price of each room type in Hotel A is displayed to the user across each data source.
[0045] In an exemplary embodiment of this application, each target data source corresponds to multiple entities; the preset update time interval is determined based on the initial update time interval; the same target data source corresponds to multiple entities (e.g., hotel A, hotel B, hotel C, etc.), and their initial update time intervals are initially consistent, but as the specific price changes of different entities corresponding to the same target data source differ, their initial update time intervals are also updated accordingly. The specific update steps are as follows:
[0046] S110, Obtain the data source interval list set LT = (LT1, LT2, ..., LT3) for each target data source. i , ..., LT n ); where LT i This is the list of data source intervals corresponding to the i-th target data source; LT i =(LT i1 LT i2 , ..., LT ic , ..., LT if(c) ); c = 1, 2, ..., f(c); f(c) is the number of entities corresponding to the i-th target data source; LT ic The initial update time interval is the c-th subject corresponding to the i-th target data source; the initial update time interval is the same for each subject corresponding to the same target data source; each target data source has a corresponding preset query rate per second.
[0047] S120, obtain the number of times each target data source is retrieved within the target time window, to obtain a list set of retrieval counts DC = (DC1, DC2, ..., DC...). i DC n DC i DC is a list of the number of times the i-th target data source is retrieved within the target time window. i =(DC) i1 DC i2 DC ic DC if(c) DC icThis represents the number of times the c-th subject corresponding to the i-th target data source retrieves the i-th target data source within the target time window; the end time of the target time window is the current time.
[0048] S130, if DC ie >DCY; then obtain DC ie The average retrieval time interval (DCP) within the target time window ie DCY is the preset threshold for the number of times data can be retrieved.
[0049] S140, LT ic Replace with DCP ie .
[0050] Specifically, the system retrieves the number of times each target data source is accessed by each corresponding entity within a certain period prior to the current time. If a target entity accesses a target data source a high number of times within that period, it indicates a high update frequency for that entity and potentially high user engagement. Therefore, the system obtains the average access interval within the target time window and updates the initial update interval for that entity, allowing for differentiated updates to the initial update intervals for different entities within the same target data source. This better reflects the actual situation of each entity within each data source. Consequently, the resulting preset update intervals can more accurately control the update frequency of each entity within each target data source.
[0051] In one exemplary embodiment of this application, after step S140, the method further includes:
[0052] S150, after a preset stable time interval, adjust the initial update time interval for each subject according to the preset query rate per second for each target data source; so that the actual query rate per second for each target data source is equal to the preset query rate per second.
[0053] Specifically, each target data source has a corresponding preset query rate per second. After the above method has been running for a period of time (preset stable time interval), if the current actual query rate per second of a target data source is less than the preset query rate per second of each target data source, in order to improve the accuracy of the displayed price, the initial update time interval of all subjects corresponding to that target data source can be adjusted according to the preset query rate per second of each target data source, so that the actual query rate per second of each target data source is equal to the preset query rate per second.
[0054] In one exemplary embodiment of this application, the preset update time interval can also be determined by the following steps:
[0055] S101, Obtain the initial update time interval corresponding to each target data source to obtain the initial update time interval list set CT = (CT1, CT2, ..., CT...). i , ..., CT n ); among them, CT i This is a list of initial update time intervals corresponding to the i-th target data source; CT i =(CT) i1 CT i2 , ..., CT ia , ..., CT ib ); a = 1, 2, ..., b; b is the number of pre-schedulable dates corresponding to the target subject; CT ia Let be the initial update interval for the i-th target data source corresponding to the target subject on the a-th bookable date; each initial update interval is determined based on the bookable date corresponding to the target subject.
[0056] S102, before the start of the corresponding first target polling event, determine each initial update time interval in CT as the preset update time interval of the corresponding target data source.
[0057] Here, each target data source has a corresponding initial update interval. This initial update interval is used when a hotel or a specific room type within a hotel has just been listed, and before the start of the first target polling event. For each target data source, the price of the target entity may be updated more frequently for bookable dates closer to the current time, so its corresponding initial update interval should be shorter; conversely, for each target data source, the price of the target entity may be updated less frequently for bookable dates further from the current time, so its corresponding initial update interval should be longer. In this application, the initial update interval for the same target data source varies with the bookable date. The resulting initial update interval and the preset update interval determined based on the initial update interval better reflect the actual situation and are more accurate. In this application, CT... ia The following conditions must be met;
[0058] If TK a =T now0 CT ia =CT0;
[0059] If TK a <T now0 ,but
[0060] CT ia =(TK a -T now0 )*δ*CT0;
[0061] Among them, TK a T is the date containing the a-th bookable date; now0 δ is the date of the start time of the current target polling event; δ is the second adjustment coefficient; CT0 is the basic update time interval.
[0062] That is, if the bookable date is on the same day as the current target polling event, its initial update time should be the shortest, which is the shortest basic update interval; while if the bookable date is after the date corresponding to the current polling time, the initial update time should gradually increase. Therefore, according to the above formula, the longer the bookable date is from the start time of the current target polling event, the longer the initial update interval. In this application, the value of δ can be in the range of 1 > δ > 0, then (TK) a -T now0 )*δ is used as the adjustment coefficient corresponding to CT0 to adjust the initial update time interval based on the basic update time interval. It should be noted that, however, the initial update time interval should have a preset maximum value.
[0063] S103, in response to receiving the polling result of the target polling event, obtain the updated preset update time interval set YT = (YT1, YT2, ..., YT) based on CT and the polling result of the target polling event. i , ..., YT n ); YT i YT is a list of preset update times for the i-th target data source after the polling event begins. i =(YT i1 YT i2 , ..., YT ia , ..., YT ib ); YT ia For CT ia The corresponding preset update time interval;
[0064] Where the polling result is that the i-th target data source corresponding to the current target polling event that updates the retrieval time does not contain the key target attribute value, then YT ia The following conditions must be met:
[0065] YT ia =CT ia +ZT*(1+s*ψ i1 );
[0066] ZT is the preset adjustment time interval; s is the first adjustment coefficient; 1 > s > 0; ψ i1 The current consecutive count of the polling event corresponding to the i-th target data source that does not contain the key target attribute value;
[0067] If the polling result is that the i-th target data source corresponding to the current target polling event that updates the retrieval time contains the key target attribute value, YT ia The following conditions must be met:
[0068] YT ia =CT ia -ZT*(1+s*ψ i2 );
[0069] ψ i2 Let be the current consecutive count of the polling event corresponding to the i-th target data source containing the key target attribute value.
[0070] Here, the polling result of the target polling event is either an updated fetch time or no updated fetch time. If the i-th target data source corresponding to the current target polling event with an updated fetch time does not contain a key target attribute value, that is, the current target polling event fetched the target attribute value list corresponding to the i-th target data source, but the corresponding target attribute value list does not contain a key target attribute value (the key target attribute value is a target attribute value that is different from the corresponding currently cached attribute value); that is, the target attribute value list corresponding to the i-th target data source has not changed, it means that the target attribute value of each target sub-sub ... ia =CT ia +ZT*(1+s*ψ i1 ), that is, the current consecutive count ψ that has not changed. i1 The larger the value, the larger the corresponding preset update time interval YT. ia The larger the value, the fewer times the target data source is retrieved based on the target polling event, thus saving resources. Conversely, if the polling result shows that the i-th target data source corresponding to the current target polling event that updates the retrieval time contains a key target attribute value, that is, the current target polling event retrieved the target attribute value list corresponding to the i-th target data source, and the corresponding target attribute value list contains a key target attribute value (the key target attribute value is a target attribute value that is different from the corresponding currently cached attribute value); that is, the target attribute value list corresponding to the i-th target data source has changed, which indicates that the target attribute value of any target sub-subject of the target subject within the corresponding target data source has changed. At this time, the preset update time interval of the target data source is relatively long, and it can be appropriately shortened. The more consecutive times the changes occur, the longer the shortening time should be. Therefore, at this time, YT ia =CT ia -ZT*(1+s*ψ i2 ); that is, the current consecutive number of changes ψi2 The larger the value, the larger the corresponding preset update time interval YT. ia The smaller the value, the more frequently the target data source will be retrieved based on the target polling event, resulting in more frequent updates to the corresponding price data.
[0071] In one exemplary embodiment of this application, after step S100, the method further includes:
[0072] S900, Obtain the predicted minimum attribute value change curves Q1, Q2, ..., Q of each target data source for the target subject within the first key time period corresponding to the target bookable date. i Q n ; where Q i This is the curve showing the change in the minimum attribute value of the target subject within the first key time period corresponding to the i-th target data source on the target bookable date; the start time of the first key time period is the current time.
[0073] Specifically, step S900 includes:
[0074] S910, Obtain the first historical minimum attribute value change curve YQ1, YQ2, ..., YQ for each target data source of the target subject within the second key time period corresponding to the target bookable date. i , ..., YQ n Among them, YQ i The curve representing the change of the first historical minimum attribute value of the target subject within the second key time period corresponding to the i-th target data source on the target bookable date; the end time of the second key time period is the current time; the length of the second key time period is equal to the length of the first key time period.
[0075] Here, we obtain the historical minimum attribute value change curve of each target data source corresponding to the target bookable date within the second key time period, which ends at the current time and has a length equal to the first key time period, in order to obtain the historical minimum attribute value change of each target data source before the first key time period.
[0076] S920, obtain the change curve of each second historical minimum attribute value for each target data source corresponding to the target subject, so as to obtain a list set of second historical minimum attribute value change curves EQ = (EQ1, EQ2, ..., EQ2). i , ..., EQ n ); EQ i This is a list of the second historical minimum attribute value change curves for the i-th target data source corresponding to the target subject within the key time window; EQ i =(EQ i1 EQ i2 , ..., EQ ik , ..., EQζ ); k = 1, 2, ..., ζ; EQ ik The curve representing the change of the second historical minimum attribute value of the i-th target data source corresponding to the target subject within the k-th third key time period of the key time window; the length of the third key time period is equal to the length of the first key time period; the time interval between the start times of any two adjacent third key time periods is the preset key time interval; the end time of the key time window is before the start time of the second key time period, and the time interval between the end time of the key time window and the start time of the second key time period is the length of the first key time period.
[0077] Here, regardless of the date, multiple second historical minimum attribute value change curves are obtained, and the length of the corresponding third key time period is the same as the length of the first key time period.
[0078] S930, respectively obtain YQ1, YQ2, ..., YQ i , ..., YQ n The curve matching degree with each curve in EQ is used to obtain the corresponding similar attribute value change curves SYQ1, SYQ2, ..., SYQ i , ..., SYQ n SYQ i For EQ and YQ i The curve with the highest curve matching degree is the second historical minimum attribute value change curve.
[0079] S940, respectively obtain SYQ1, SYQ2, ..., SYQ i , ..., SYQ n The change curve of the third historical minimum attribute value in the corresponding fourth key time period is used as the predicted minimum attribute value change curve Q1, Q2, ..., Q of each target data source corresponding to the target bookable date in the first key time period. i Q n SYQ i The corresponding fourth critical time period starts at SYQ. i The end time of the corresponding third key time period; the length of the fourth key time period is equal to the length of the first key time period.
[0080] In this embodiment, firstly, the first historical minimum attribute value change curve of the target subject for each target data source corresponding to the target bookable date is obtained within the second key time period of the current time. Then, among the multiple second historical minimum attribute value change curves corresponding to the target subject, the curve with the largest curve matching degree with each first historical minimum attribute value change curve is selected. The larger the matching degree, the more similar the price change trend of a certain target data source within the second key time period is to the price change trend within the third key time period corresponding to the second historical minimum attribute value change curve with the largest curve matching degree. Then, it is considered that the price change trend corresponding to the historical minimum attribute value change curve within the fourth key time period is the same as the price change trend corresponding to the predicted minimum attribute value change curve of the target data source within the first key time period.
[0081] S1000, based on Q1, Q2, ..., Q i Q n Obtain the key data source corresponding to the current target polling event; the key data source is the target data source corresponding to the curve of the change of the minimum predicted attribute value corresponding to the minimum predicted attribute value.
[0082] Specifically, based on Q1, Q2, ..., Q i Q n The changing trends show that if all curves do not intersect at the current moment when the current target polling event occurs, there is a key data source at each moment. If, at the current moment when the current target polling event occurs, some curves predicting the minimum attribute value change may have multiple key data sources.
[0083] S1100, based on T, obtain the time when the target attribute value corresponding to the target subject was most recently retrieved from each key data source corresponding to the current target polling event, and determine it as the key time TD1, TD2, ..., TD γ , ..., TD τ ; γ = 1, 2, ..., τ; τ is the number of key data sources; TD γ This refers to the key time corresponding to the γth key data source.
[0084] S1200, based on TD1, TD2, ..., TD γ , ..., TD τ The corresponding key time intervals TDG1, TDG2, ..., TDG were obtained respectively. γ , ..., TDG τ TDG γ =T now -TD γ .
[0085] S1300, if TDG τIf the value exceeds the corresponding preset update time interval, the target attribute value corresponding to the target subject will be retrieved from the corresponding key data source as the key attribute value.
[0086] S1400: If any key attribute value is less than the current display attribute value of the target subject, then the current display attribute value is replaced with the key attribute value that is less than the current display attribute value of the target subject, and displayed on the corresponding display interface.
[0087] The specific implementation here is the same as steps S200-S500 above, and will not be repeated here.
[0088] In one exemplary embodiment of this application, after step S1300, the method further includes:
[0089] S1500, if any key attribute value is less than the current display attribute value of the target subject, then replace the key time corresponding to the key attribute value that is less than the current display attribute value of the target subject with T. now .
[0090] Please refer to Figure 2 As shown, an embodiment of this application provides a display attribute value update device 100 for multiple data sources, the device comprising:
[0091] The retrieval time acquisition unit 110 is used to acquire the most recent retrieval time of each target data source corresponding to the target subject with respect to the target's bookable date at preset polling time intervals, so as to obtain the retrieval time set T = (T1, T2, ..., T...). i ,…,T n ); i = 1, 2, ..., n; where n is the number of target data sources corresponding to the target subject; Ti is the time when the target attribute value corresponding to the target subject was last retrieved from the i-th target data source; the same target data source has a corresponding preset update time interval on different pre-bookable dates; the target subject has a corresponding currently displayed attribute value and a currently cached attribute value, and the currently displayed attribute value is the minimum value among the currently cached attribute values.
[0092] Interval acquisition unit 120 is used to obtain the target time interval set G = (G1, G2, ..., G...) based on T. i , ..., G n ); where G i For T i The corresponding target time interval; G i =T now -T i ;T now The start time of the current target polling event.
[0093] Data source determination unit 130 is used to obtain, based on G, the target data source set S = (S1, S2, ..., S...) corresponding to the current target polling event. j S m ); j = 1, 2, ..., m; where m is the number of target data sources whose corresponding target time interval is greater than the corresponding preset update time interval; S j The j-th target data source has a target time interval greater than the corresponding preset update time interval.
[0094] Retrieval unit 140 is used to retrieve the target attribute values corresponding to the target subject from the corresponding target data source if S is not empty, so as to obtain a list set of target attribute values X = (X1, X2, ..., X...). j , ..., X m ); X j For S j The corresponding list of target attribute values; X j =(X j1 X j2 , ..., X jp , ..., X jq ); p = 1, 2, ..., q; q is the number of target sub-sub ... jp For S j The target attribute value corresponding to the p-th target sub-sub ...
[0095] Display unit 150 is used to replace the current display attribute value with the target attribute value corresponding to MIN(X) if the target attribute value corresponding to MIN(X) is less than the current display attribute value of the target subject, and display it on the corresponding display interface; MIN() is a preset minimum value determination function.
[0096] Embodiments of this application also provide a computer program product including program code that, when the program product is run on an electronic device, causes the electronic device to perform the steps of the methods described above according to various exemplary embodiments of this application.
[0097] Furthermore, although the steps of the method in this application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0098] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the method according to the embodiments of this application.
[0099] In an exemplary embodiment of this application, an electronic device capable of implementing the above-described method is also provided.
[0100] Those skilled in the art will understand that various aspects of this application can be implemented as a system, method, or program product. Therefore, various aspects of this application can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, collectively referred to herein as a "circuit," "module," or "system."
[0101] An electronic device according to this embodiment of the present application. The electronic device is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of this application.
[0102] Electronic devices are manifested in the form of general-purpose computing devices. Components of an electronic device may include, but are not limited to: at least one processor, at least one memory, and buses connecting different system components (including memory and processor).
[0103] The memory stores program code that can be executed by a processor, causing the processor to perform the steps described in the "Exemplary Methods" section above, according to various exemplary embodiments of this application.
[0104] The storage may include readable media in the form of volatile storage, such as random access memory (RAM) and / or cache memory, and may further include read-only memory (ROM).
[0105] The storage may also include programs / utilities having a set (at least one) of program modules, including but not limited to: an operating system, one or more applications, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0106] A bus can represent one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus that uses any of the various bus architectures.
[0107] The electronic device can also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (e.g., routers, modems, etc.). This communication can be achieved through input / output (I / O) interfaces. Furthermore, the electronic device can communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter. As shown in the figure, the network adapter communicates with other modules of the electronic device via a bus. It should be understood that, although not shown in the figure, other hardware and / or software modules can 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.
[0108] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the method according to the embodiments of this application.
[0109] In exemplary embodiments of this application, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible implementations, various aspects of this application may also be implemented as a program product including program code, which, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of this application described in the "Exemplary Methods" section above.
[0110] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0111] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0112] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0113] Program code for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0114] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this application, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0115] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0116] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for updating display attribute values from multiple data sources, characterized in that, The method includes: S100, at each preset polling time interval, obtain the most recent retrieval time of each target data source corresponding to the target subject with respect to the target's bookable date, to obtain the retrieval time set T=(T1, T2, ..., T... i ,…,T n ); i = 1, 2, ..., n; where n is the number of target data sources corresponding to the target subject; T i The time of the most recent retrieval of the target attribute value corresponding to the target subject from the i-th target data source; the same target data source has a corresponding preset update time interval for different pre-bookable dates; the target subject has a corresponding currently displayed attribute value and a currently cached attribute value, the currently displayed attribute value being the minimum value among the currently cached attribute values; each target data source corresponds to multiple subjects; the preset update time interval is determined based on the initial update time interval; wherein, the initial update time interval is updated through the following steps: S110, Obtain the data source interval list set LT=(LT1, LT2, ..., LT3) for each target data source. i , ..., LT n ); where LT i This is the list of data source intervals corresponding to the i-th target data source; LT i =(LT i1 LT i2 , ..., LT ic , ..., LT if(c) ); c = 1, 2, ..., f(c); f(c) is the number of entities corresponding to the i-th target data source; LT ic The initial update time interval is the c-th subject corresponding to the i-th target data source; the initial update time interval is the same for each subject corresponding to the same target data source; each target data source has a corresponding preset query rate per second; S120, obtain the number of times each target data source is retrieved within the target time window, to obtain a list set of retrieval counts DC=(DC1, DC2, ..., DC...). i DC n DC i DC is a list of the number of times the i-th target data source is retrieved within the target time window. i =(DC i1 DC i2 DC ic DC if(c) DC ic This represents the number of times the c-th subject corresponding to the i-th target data source retrieves the i-th target data source within the target time window; the end time of the target time window is the current time. S130, if DC ie >DCY; then obtain DC ie The average retrieval time interval (DCP) within the target time window ie DCY is the preset threshold for the number of times data can be retrieved. S140, LT ic Replace with DCP ie ; S200, based on T, obtain the target time interval set G = (G1, G2, ..., G...). i , ..., G n ); where G i For T i The corresponding target time interval; G i =T now -T i ;T now The start time of the current target polling event; S300, according to G, obtain the target data source set S=(S1, S2, ..., S...) corresponding to the current target polling event. j S m ); j=1,2,…,m; where m is the number of target data sources whose corresponding target time interval is greater than the corresponding preset update time interval; S j The j-th target data source whose corresponding target time interval is greater than the corresponding preset update time interval; S400, if S is not empty, then retrieve the target attribute values corresponding to the target subject from the corresponding target data source to obtain the target attribute value list set X=(X1, X2, ..., X...). j , ..., X m ); X j For S j The corresponding list of target attribute values; X j =(X j1 X j2 , ..., X jp , ..., X jq ); p = 1, 2, ..., q; q is the number of target sub-sub ... jp For S j The target attribute value corresponding to the p-th target sub-sub ... S500, if the target attribute value corresponding to MIN(X) is less than the current display attribute value of the target entity, then the current display attribute value is replaced with the target attribute value corresponding to MIN(X) and displayed on the corresponding display interface; MIN() is a preset minimum value determination function.
2. The method for updating display attribute values from multiple data sources according to claim 1, characterized in that, After step S140, the method further includes: S150, after a preset stable time interval, adjust the initial update time interval for each subject according to the preset query rate per second for each target data source; so that the actual query rate per second for each target data source is equal to the preset query rate per second.
3. The method for updating display attribute values from multiple data sources according to claim 1, characterized in that, After step S400, the method further includes: S600, if MIN(X) j The corresponding target attribute value is less than S. j The corresponding current minimum target attribute value will then be T. i Replace with T now MIN() is a preset function for determining the minimum value.
4. The method for updating display attribute values from multiple data sources according to claim 3, characterized in that, After step S400, the method further includes: S700, iterate through X to obtain a list set of key target attribute values M = (M1, M2, ..., M...). x M y ); x = 1, 2, ..., y; where y is the number of target data sources including key target attribute values; key target attribute values are target attribute values that are different from the corresponding currently cached attribute values; M x M is the list of key target attribute values corresponding to the x-th target data source that includes key target attribute values; x =(M x1 M x2 M xr M xf(x) ); r = 1, 2, ..., f(x); f(x) is the number of key target attribute values included in the x-th target data source that includes key target attribute values; M xr For the x-th key target attribute value in the target data source that includes key target attribute values; S800: Replace the corresponding current cached attribute value with the key target attribute value in M to obtain the updated cached attribute value.
5. A device for updating display attribute values from multiple data sources, characterized in that, The device includes: The retrieval time acquisition unit is used to acquire the most recent retrieval time of each target data source corresponding to the target subject with respect to the target's bookable date at preset polling time intervals, so as to obtain the retrieval time set T=(T1, T2, ..., T...). i ,…,T n ); i = 1, 2, ..., n; where n is the number of target data sources corresponding to the target subject; Ti is the time when the target attribute value corresponding to the target subject was most recently retrieved from the i-th target data source; the same target data source has a corresponding preset update time interval on different pre-bookable dates; the target subject has a corresponding current display attribute value and a current cached attribute value, the current display attribute value being the minimum value among the current cached attribute values; each target data source corresponds to multiple subjects; the preset update time interval is determined based on the initial update time interval; wherein, the initial update time interval is updated through the following steps: S110, Obtain the data source interval list set LT=(LT1, LT2, ..., LT3) for each target data source. i , ..., LT n ); where LT i This is the list of data source intervals corresponding to the i-th target data source; LT i =(LT i1 LT i2 , ..., LT ic , ..., LT if(c) ); c = 1, 2, ..., f(c); f(c) is the number of entities corresponding to the i-th target data source; LT ic The initial update time interval is the c-th subject corresponding to the i-th target data source; the initial update time interval is the same for each subject corresponding to the same target data source; each target data source has a corresponding preset query rate per second; S120, obtain the number of times each target data source is retrieved within the target time window, to obtain a list set of retrieval counts DC=(DC1, DC2, ..., DC...). i DC n DC i DC is a list of the number of times the i-th target data source is retrieved within the target time window. i =(DC i1 DC i2 DC ic DC if(c) DC ic This represents the number of times the c-th subject corresponding to the i-th target data source retrieves the i-th target data source within the target time window; the end time of the target time window is the current time. S130, if DC ie >DCY; then obtain DC ie The average retrieval time interval (DCP) within the target time window ie DCY is the preset threshold for the number of times data can be retrieved. S140, LT ic Replace with DCP ie ; The interval acquisition unit is used to obtain the target time interval set G=(G1, G2, ..., G...) based on T. i , ..., G n ); where G i For T i The corresponding target time interval; G i =T now -T i ;T now The start time of the current target polling event; The data source determination unit is used to obtain, based on G, the set of target data sources to be retrieved, S = (S1, S2, ..., S...). j S m ); j=1,2,…,m; where m is the number of target data sources whose corresponding target time interval is greater than the corresponding preset update time interval; S j The j-th target data source whose corresponding target time interval is greater than the corresponding preset update time interval; The retrieval unit is used to retrieve the target attribute values corresponding to the target subject from the corresponding target data source if S is not empty, so as to obtain a list set of target attribute values X=(X1, X2, ..., X...). j , ..., X m ); X j For S j The corresponding list of target attribute values; X j =(X j1 X j2 , ..., X jp , ..., X jq ); p = 1, 2, ..., q; q is the number of target sub-sub ... jp For S j The target attribute value corresponding to the p-th target sub-sub ... The display unit is used to replace the current display attribute value with the target attribute value corresponding to MIN(X) if the target attribute value corresponding to MIN(X) is less than the current display attribute value of the target entity, and then display it on the corresponding display interface; MIN() is a preset minimum value determination function.
6. A non-transitory computer-readable storage medium, characterized in that, The storage medium stores at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the method as described in any one of claims 1-4.
7. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 6.
Citation Information
Patent Citations
Game state monitoring method and device
CN112044057A
File processing method and device and electronic equipment
CN116244262A