Method, apparatus, electronic device, and medium for updating delay tolerance time intervals

By generating a probability density function from wait time data to dynamically adjust delay tolerance intervals, the method optimizes data association in two-stream systems, reducing resource waste and data discard.

CN114116807BActive Publication Date: 2025-07-15BEIJING JINGDONG ZHENSHI INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111479286.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-06
Publication Date
2025-07-15
Estimated Expiration
2041-12-06

AI Technical Summary

Technical Problem

In a two-stream data association based on time intervals, improper setting of delay tolerance time intervals leads to data discarding or resource waste.

Method used

By generating the target probability density function, dynamically adjust the upper and lower limit values of the delay tolerance time interval, and generate a new delay tolerance time interval based on the waiting time in the waiting time set.

Benefits of technology

While ensuring data correlation, cache resources are maximized and resource waste caused by the peaks and troughs of business data are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114116807B_ABST
    Figure CN114116807B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure disclose a method, apparatus, electronic device, and medium for updating a delay tolerance time interval. A specific implementation of the method includes: in response to determining that a set of waiting durations satisfies a preset condition, generating a target probability density function based on the set of waiting durations, where the waiting durations in the set of waiting durations are the mutual waiting durations of data in a target stream and a source stream that need to be associated; determining an upper limit value and a lower limit value of the waiting duration based on the target probability density function; and updating the upper limit value and the lower limit value of the delay tolerance time interval to the upper limit value and the lower limit value of the waiting duration, respectively. This implementation can save cache resources to the greatest extent while ensuring that the association logic is completed for the vast majority of data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer technologies, and particularly to a method, apparatus, electronic device, and medium for updating a delay tolerance time interval. Background Art

[0002] In an application scenario of two-stream data association based on a time interval, it is necessary to associate and issue data in two streams that have the same primary key value and the time interval between them does not exceed a specified time interval. Currently, in two-stream data association based on a time interval, the commonly adopted method is to set a fixed delay tolerance time interval, directly discard data that fails to match associated data within the delay tolerance time interval, and cache all data with timestamps greater than the lower limit value of the current water level line plus the delay tolerance time interval.

[0003] However, when associating two-stream data in the above manner, the following technical problems often exist:

[0004] In practice, the arrival order and the time difference between data in two data streams cannot be accurately estimated. If the delay tolerance time interval is set too short, a large amount of data will be discarded due to failure to match successfully, and accurate once cannot be achieved. If the delay tolerance time interval is set too long, a large amount of memory will be consumed to cache data, wasting storage resources. Summary of the Invention

[0005] The content part of the present disclosure is used to briefly introduce concepts, which will be described in detail in the subsequent detailed implementation part. The content part of the present disclosure is not intended to identify the key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0006] Some embodiments of the present disclosure propose a method, apparatus, electronic device, and medium for updating a delay tolerance time interval to solve the technical problems mentioned in the above background art part.

[0007] In a first aspect, some embodiments of the present disclosure provide a method for updating a delay tolerance time interval, the method including: in response to determining that a set of waiting durations meets a preset condition, generating a target probability density function according to the set of waiting durations, where the waiting durations in the set of waiting durations are the mutual waiting durations of data in a target stream and a source stream that need to be associated; determining an upper limit value and a lower limit value of the waiting duration based on the target probability density function; and updating the upper limit value and the lower limit value of the delay tolerance time interval to the upper limit value and the lower limit value of the waiting duration respectively.

[0008] Optionally, determining the upper limit value and the lower limit value of the waiting duration based on the above target probability density function includes: determining the value of the independent variable corresponding to the maximum value of the above target probability density function as the separation value; determining the value of the independent variable corresponding to the minimum value within the interval from negative infinity to the above separation value of the above target probability density function to obtain the lower limit value of the waiting duration; determining the value of the independent variable corresponding to the minimum value within the interval from the above separation value to positive infinity of the above target probability density function to obtain the upper limit value of the waiting duration.

[0009] Optionally, the above preset condition is that the number of waiting durations included in the above waiting duration set is greater than or equal to the target number; and after generating the target probability density function according to the above waiting duration set in response to determining that the waiting duration set meets the preset condition, the method further includes: clearing the above waiting duration set.

[0010] Optionally, the method further includes: in response to receiving slave table data from the above target stream or the above source stream and not matching the associated data, determining the source of the above slave table data; in response to determining that the above slave table data comes from the above source stream, determining a first waiting period according to the time when the above slave table data is received and the lower limit value of the above delay tolerance time interval; in response to receiving, within the above first waiting period, associated data from the above target stream that matches the above slave table data, determining the time difference between the time when the above slave table data is received and the time when the above associated data is received as the waiting duration.

[0011] Optionally, the method further includes: in response to not receiving, within the above first waiting period, associated data from the above target stream that matches the above slave table data, selecting the lower limit value of the above delay tolerance time interval as the waiting duration.

[0012] Optionally, the method further includes: in response to determining that the above slave table data comes from the above target stream, determining a second waiting period according to the time when the above slave table data is received and the upper limit value of the above delay tolerance time interval; in response to receiving, within the above second waiting period, associated data from the above source stream that matches the above slave table data, determining the time difference between the time when the above associated data is received and the time when the above slave table data is received as the waiting duration.

[0013] Optionally, the method further includes: in response to not receiving, within the above second waiting period, associated data from the above source stream that matches the above slave table data, selecting the upper limit value of the above delay tolerance time interval as the waiting duration.

[0014] Optionally, the method further includes: adding the above waiting duration to the above waiting duration set.

[0015] Optionally, the above method further includes: in response to receiving the master table data from the above target stream or the above source stream, sending down the above master table data.

[0016] In a second aspect, some embodiments of the present disclosure provide a delay tolerance time interval updating device, the device includes: a generating unit configured to generate a target probability density function according to the waiting duration set in response to determining that the waiting duration set meets a preset condition, where the waiting durations in the waiting duration set are the mutual waiting durations of the data in the target stream and the source stream that need to be associated; a determining unit configured to determine an upper limit value and a lower limit value of the waiting duration based on the target probability density function; and an updating unit configured to update the upper limit value and the lower limit value of the delay tolerance time interval to the upper limit value of the waiting duration and the lower limit value of the waiting duration respectively.

[0017] Optionally, the above determining unit includes a separating value determining subunit, a first minimum value determining subunit, and a second minimum value determining subunit. Wherein, the separating value determining subunit is configured to determine the value of the independent variable corresponding to the maximum value of the target probability density function as the separating value; the first minimum value determining subunit is configured to determine the value of the independent variable corresponding to the minimum value of the target probability density function in the interval from negative infinity to the separating value to obtain the lower limit value of the waiting duration; and the second minimum value determining subunit is configured to determine the value of the independent variable corresponding to the minimum value of the target probability density function in the interval from the separating value to positive infinity to obtain the upper limit value of the waiting duration.

[0018] Optionally, the above preset condition is that the number of waiting durations included in the waiting duration set is greater than or equal to a target number; and after the generating unit, the device further includes a clearing unit configured to clear the waiting duration set.

[0019] Optionally, the above device further includes: a source determining unit, a first waiting period determining unit, and a first waiting duration determining unit. Wherein, the source determining unit is configured to determine the source of the slave table data in response to receiving the slave table data from the above target stream or the above source stream and not matching the associated data; the first waiting period determining unit is configured to determine a first waiting period according to the time when the slave table data is received and the lower limit value of the delay tolerance time interval in response to determining that the slave table data comes from the above source stream; and the first waiting duration determining unit is configured to determine the time difference between the time when the slave table data is received and the time when the associated data is received as the waiting duration in response to receiving the associated data matching the slave table data from the above target stream within the first waiting period.

[0020] Optionally, the above-mentioned device further includes a first selection unit, configured to select the lower limit value of the above-mentioned delay tolerance time interval as the waiting duration in response to not receiving associated data matching the above-mentioned slave table data from the above-mentioned target stream within the above-mentioned first waiting period.

[0021] Optionally, the above-mentioned device further includes a second waiting period determination unit and a second waiting duration determination unit. Among them, the second waiting period determination unit is configured to determine a second waiting period according to the time when the above-mentioned slave table data is received and the upper limit value of the above-mentioned delay tolerance time interval in response to determining that the above-mentioned slave table data comes from the above-mentioned target stream; the second waiting duration determination unit is configured to determine the time difference between the time when the associated data is received and the time when the above-mentioned slave table data is received as the waiting duration in response to receiving associated data matching the above-mentioned slave table data from the above-mentioned source stream within the above-mentioned second waiting period.

[0022] Optionally, the above-mentioned device further includes a second selection unit, configured to select the upper limit value of the above-mentioned delay tolerance time interval as the waiting duration in response to not receiving associated data matching the above-mentioned slave table data from the above-mentioned target stream within the above-mentioned second waiting period.

[0023] Optionally, the above-mentioned device further includes an adding unit, configured to add the above-mentioned waiting duration to the above-mentioned waiting duration set.

[0024] Optionally, the above-mentioned device further includes a sending unit, configured to send the above-mentioned master table data in response to receiving the master table data from the above-mentioned target stream or the above-mentioned source stream.

[0025] In a third aspect, some embodiments of the present disclosure provide an electronic device, including: one or more processors; a storage device storing one or more programs thereon, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner of the above first aspect.

[0026] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium, storing a computer program thereon, where when the program is executed by a processor, the method described in any implementation manner of the above first aspect is implemented.

[0027] The above embodiments of the present disclosure have the following beneficial effects: Through the method for updating the delay tolerance time interval in some embodiments of the present disclosure, the data delay tolerance time interval can be dynamically adjusted, saving cache resources to the greatest extent while ensuring that the vast majority of data completes the association logic. Specifically, the reasons for data being discarded due to unsuccessful matching, being unable to achieve precise once, consuming a large amount of memory to cache data, and wasting storage resources are as follows: The set delay tolerance time interval is fixed. Based on this, the method for updating the delay tolerance time interval in some embodiments of the present disclosure generates a target probability density function according to multiple waiting durations recorded in the waiting duration set, and determines new upper and lower limit values of the delay tolerance time interval through the generated target probability density function. Thus, the delay tolerance time interval is updated according to historical data. This makes the delay tolerance time interval neither too long nor too short, and can to a certain extent avoid the situation where the intersection of the delay tolerance time interval and the actual data arrival time difference decreases due to the arrival time change of business data caused by peaks and valleys in business data. Furthermore, while ensuring that the vast majority of data completes the association logic, cache resources are saved to the greatest extent. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In combination with the accompanying drawings and with reference to the following specific embodiments, the above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic, and the elements and elements are not necessarily drawn to scale.

[0029] Figure 1 is a schematic diagram of an application scenario of the method for updating the delay tolerance time interval in some embodiments of the present disclosure;

[0030] Figure 2 is a flowchart of some embodiments of the method for updating the delay tolerance time interval according to the present disclosure;

[0031] Figure 3 is a flowchart of other embodiments of the method for updating the delay tolerance time interval according to the present disclosure;

[0032] Figure 4 is a schematic diagram of sending master table data in other embodiments of the method for updating the delay tolerance time interval of the present disclosure;

[0033] Figure 5 is a schematic structural diagram of some embodiments of the delay tolerance time interval updating device of the present disclosure;

[0034] Figure 6 is a schematic structural diagram of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0035] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for illustrative purposes and are not used to limit the protection scope of the present disclosure.

[0036] In addition, it should be noted that for ease of description, only parts related to the relevant invention are shown in the drawings. Without conflict, the embodiments in the present disclosure and the features in the embodiments can be combined with each other.

[0037] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependent relationships.

[0038] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly specified in the context, it should be understood as "one or more".

[0039] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.

[0040] The present disclosure will be described in detail below with reference to the drawings and in conjunction with the embodiments.

[0041] Figure 1 is a schematic diagram of an application scenario of a method for updating the delay tolerance time interval of some embodiments of the present disclosure.

[0042] In Figure 1 In the application scenario, first, the computing device 101 can generate a target probability density function 103 according to the waiting duration set 102 in response to determining that the waiting duration set 102 meets a preset condition, where the waiting durations in the waiting duration set 102 are the mutual waiting durations of the data in the target stream and the source stream that need to be associated; then, the computing device 101 can determine a waiting duration upper limit value 104 and a waiting duration lower limit value 105 based on the target probability density function 103; finally, the computing device 101 can update the upper limit value and the lower limit value of the delay tolerance time interval 106 to the waiting duration upper limit value 104 and the waiting duration lower limit value 105 respectively.

[0043] It should be noted that the above computing device 101 can be hardware or software. When the computing device is hardware, it can be implemented as a distributed cluster composed of multiple servers or terminal devices, or as a single server or a single terminal device. When the computing device is embodied as software, it can be installed in the above-listed hardware devices. It can be implemented as, for example, multiple software or software modules for providing distributed services, or as a single software or software module. Specific limitations are not made here.

[0044] It should be understood that Figure 1 the number of computing devices in

[0045] Continuing to refer to Figure 2 , a process 200 of some embodiments of the method for updating the delay tolerance time interval according to the present disclosure is shown. The process 200 of the method for updating the delay tolerance time interval includes the following steps:

[0046] Step 201, in response to determining that the set of waiting durations meets a preset condition, generating a target probability density function according to the set of waiting durations.

[0047] In some embodiments, the execution subject of the method for updating the delay tolerance time interval (such as Figure 1 the computing device 101 shown) can, in response to determining that the set of waiting durations meets a preset condition, generate a target probability density function according to the above set of waiting durations. Among them, the waiting durations in the above set of waiting durations can be the historical mutual waiting durations of the data in the target stream and the source stream that need to be associated. The above target stream can be a data stream in which the waiting duration of the data is recorded as a positive number. The above source stream can be a data stream in which the waiting duration of the data is recorded as a negative number. Any one of the two streams of data that need to be associated can be specified as the target stream, and the other stream as the source stream.

[0048] The above preset condition can be that the duration corresponding to the set of waiting durations reaches a preset duration. The duration corresponding to the set of waiting durations can be the duration starting from the time of the first waiting duration added to the set of waiting durations when the set of waiting durations is empty, or after all the waiting durations in the set of waiting durations have been used to generate a target probability density function.

[0049] A target waiting duration can be selected from the above waiting duration set as the target waiting duration within the duration corresponding to the above waiting duration set, and a target waiting duration set is obtained. The above target probability density function can be a kernel density function with a target kernel function. Each target waiting duration in the above target waiting duration set can be used as known sample data and substituted into the initial probability density function to obtain the above target probability density function:

[0050]

[0051] Wherein, represents the above target probability density function. n represents the number of target waiting durations in the above target waiting duration set. h represents a preset bandwidth. i represents the serial number. K(·) represents the above target kernel function. x represents the independent variable of the above target probability density function. X represents the target waiting duration in the above target waiting duration set. X i represents the i-th target waiting duration in the above target waiting duration set.

[0052] In practice, the above preset bandwidth is a positive number greater than zero and can be set according to the actual application scenario, which is not limited here. The above target kernel function can be an epanechnikov kernel function, a quartic kernel function, a triweight kernel function, a cosine kernel function, etc.

[0053] As an example, the above preset bandwidth can take a value of is the standard deviation of each target waiting duration in the above target waiting duration set.

[0054] Step 202: Determine an upper limit value and a lower limit value of the waiting duration based on the target probability density function.

[0055] In some embodiments, the above execution subject determines an upper limit value and a lower limit value of the waiting duration based on the above target probability density function, which may include the following steps:

[0056] The first step: Integrate the above target probability density function within the above delay tolerance time interval to obtain an integral area value.

[0057] The second step: In response to determining that the above integral area value is greater than or equal to a preset area value, respectively determine the product values of the upper limit value and the lower limit value of the above delay tolerance time interval and a first preset value as the upper limit value and the lower limit value of the waiting duration.

[0058] As an example, the above preset area value can be 3 / 4. The above first preset value can be 3 / 4.

[0059] In the third step, in response to determining that the above integral area value is less than the preset area value, the product values of the upper limit value and the lower limit value of the above delay tolerance time interval and the second preset value are respectively determined as the upper limit value of the waiting duration and the lower limit value of the waiting duration.

[0060] As an example, the above second preset value may be 4 / 3.

[0061] Step 203, update the upper limit value and the lower limit value of the delay tolerance time interval to the upper limit value of the waiting duration and the lower limit value of the waiting duration respectively.

[0062] In some embodiments, the above execution subject may update the upper limit value and the lower limit value of the delay tolerance time interval to the above upper limit value of the waiting duration and the above lower limit value of the waiting duration respectively.

[0063] The above various embodiments of the present disclosure have the following beneficial effects: Through the delay tolerance time interval update method of some embodiments of the present disclosure, the data delay tolerance time interval can be dynamically adjusted, and while ensuring that the vast majority of data completes the association logic, the cache resources can be saved to the greatest extent. Specifically, the reasons for data being discarded due to unsuccessful matching, being unable to achieve accurate once, or consuming a large amount of memory to cache data and wasting storage resources are: the set delay tolerance time interval is fixed. Based on this, the delay tolerance time interval update method of some embodiments of the present disclosure generates a target probability density function according to multiple waiting durations recorded in the waiting duration set, and determines the new upper limit value and the new lower limit value of the delay tolerance time interval through the generated target probability density function. Thus, the delay tolerance time interval is updated according to historical data. The delay tolerance time interval will not be too long or too short, which can avoid the situation where the intersection of the delay tolerance time interval and the actual data arrival time difference decreases due to the arrival time change of business data caused by the peak and valley of business data to a certain extent. Furthermore, while ensuring that the vast majority of data completes the association logic, the cache resources can be saved to the greatest extent.

[0064] Further referring to Figure 3 , which shows the process 300 of another embodiment of the delay tolerance time interval update method. The process 300 of the delay tolerance time interval update method includes the following steps:

[0065] Step 301, in response to determining that the waiting duration set meets the preset conditions, generate a target probability density function according to the waiting duration set.

[0066] In some embodiments, the execution subject of the delay tolerance time interval update method (such as Figure 1The computing device 101) shown can generate a target probability density function according to the set of waiting durations in response to determining that the set of waiting durations meets a preset condition. Among them, the waiting durations in the set of waiting durations can be the mutual waiting durations of the data in the target stream and the source stream that need to be associated. The preset condition can be that the number of waiting durations included in the set of waiting durations is greater than or equal to the target number. In practice, the target number can be set according to the actual application scenario, which is not limited here. The target stream can be a data stream in which the waiting duration of the data is recorded as a positive number. The source stream can be a data stream in which the waiting duration of the data is recorded as a negative number.

[0067] The target probability density function can be a kernel density function with the target kernel function as the kernel. Each waiting duration in the set of waiting durations can be substituted into the initial probability density function as known sample data to obtain the target probability density function:

[0068]

[0069] Among them, represents the target probability density function. n represents the number of target waiting durations in the set of target waiting durations. h represents the preset bandwidth. i represents the serial number. K(·) represents the target kernel function. x represents the independent variable of the target probability density function. T represents the target waiting duration in the set of target waiting durations. T i represents the i-th waiting duration in the set of target waiting durations.

[0070] In practice, the preset bandwidth is a positive number greater than zero and can be set according to the actual application scenario, which is not limited here.

[0071] As an example, the target kernel function can be a Gaussian kernel function. The preset bandwidth can take the value of is the standard deviation of each waiting duration in the set of waiting durations.

[0072] In some optional implementation manners of some embodiments, the execution subject can also clear the set of waiting durations. Thus, after generating the target probability density function according to the set of waiting durations, the set of waiting durations can be cleared, and waiting durations are added to the set of waiting durations again until the set of waiting durations meets the preset condition again. Thereby, it is ensured that the target rate density function is generated each time with the target number of waiting durations recorded most recently.

[0073] Step 302, determine the value of the independent variable corresponding to the maximum value of the target probability density function as the separation value.

[0074] In some embodiments, the above-mentioned execution entity may determine the value of the independent variable corresponding to the maximum value of the above-mentioned target probability density function as the separation value.

[0075] Step 303: Determine the value of the independent variable corresponding to the minimum value of the target probability density function within the interval from negative infinity to the separation value, so as to obtain the lower limit value of the waiting duration.

[0076] In some embodiments, the above-mentioned execution entity may determine the value of the independent variable corresponding to the minimum value of the above-mentioned target probability density function within the interval from negative infinity to the above-mentioned separation value, so as to obtain the lower limit value of the waiting duration.

[0077] Step 304: Determine the value of the independent variable corresponding to the minimum value of the target probability density function within the interval from the separation value to positive infinity, so as to obtain the upper limit value of the waiting duration.

[0078] In some embodiments, the above-mentioned execution entity may determine the value of the independent variable corresponding to the minimum value of the above-mentioned target probability density function within the interval from the above-mentioned separation value to positive infinity, so as to obtain the upper limit value of the waiting duration.

[0079] Thus, according to the change in the data arrival time caused by the peaks and valleys of the service data, the delay tolerance time interval can be dynamically adjusted, and the intersection of the delay tolerance time interval and the actual data arrival time difference can be increased. Furthermore, while ensuring that the vast majority of data completes the association logic, the cache resources can be saved to the greatest extent.

[0080] Step 305: Update the upper limit value and the lower limit value of the delay tolerance time interval to the upper limit value of the waiting duration and the lower limit value of the waiting duration respectively.

[0081] In some embodiments, the specific implementation manner of step 305 and the technical effects brought thereby may refer to Figure 2 Step 203 in the corresponding embodiments, which will not be elaborated here.

[0082] Step 306: In response to receiving the slave table data from the target stream or the source stream and not matching the associated data, determine the source of the slave table data.

[0083] In some embodiments, the above-mentioned execution entity may determine the source of the slave table data in response to receiving slave table data from the above-mentioned target stream or the above-mentioned source stream that has not matched the associated data. The above-mentioned associated data may be data that was received earlier, stored in the cache, and has the same primary key value as the above-mentioned slave table data. The master table data may be indispensable data in the subsequent business process execution. The slave table data may be data that can be missing in the subsequent business process execution. It is possible to specify the data in any one or both of the above-mentioned target stream and the above-mentioned source stream as the master table data, and the data in the remaining data streams as the slave table data. This can thus support inner join, left join, right join, and outer join between the two streams of data. The inner join between the two streams of data may mean that the data in both data streams are slave table data and need to wait for each other before being sent. The left join and right join between the two streams of data may mean that one of the two data streams is the master table data and the other is the slave table data, and only the slave table data needs to wait for the master table data. The outer join between the two streams of data may mean that the data in both data streams are master table data and can be sent directly without waiting for each other.

[0084] If the field names included in the data in the above-mentioned target stream and the above-mentioned source stream are different, then the respective field names included in the data in the above-mentioned target stream and the above-mentioned source stream may be recorded in advance. Match the respective field names included in the above-mentioned slave table data with the respective field names corresponding to the above-mentioned target stream. If there are no different field names, it may be determined that the above-mentioned slave table data comes from the above-mentioned target stream. If there are different field names, it may be determined that the above-mentioned slave table data comes from the above-mentioned source stream. If the above-mentioned slave table data includes a source identifier that can be used to mark the data source. Then the source of the above-mentioned slave table data may be determined through the source identifier.

[0085] Step 307, in response to determining that the slave table data comes from the source stream, determine a first waiting period according to the time when the slave table data is received and the lower limit value of the delay tolerance time interval.

[0086] In some embodiments, the above-mentioned execution entity may, in response to determining that the above-mentioned slave table data comes from the above-mentioned source stream, determine the time when the above-mentioned slave table data is received and the time period between the time when the above-mentioned slave table data is received and the time determined by the difference between the time when the above-mentioned slave table data is received and the lower limit value of the delay tolerance time interval as the first waiting period. The lower limit value of the above-mentioned delay tolerance time interval may represent the longest waiting duration for the data in the above-mentioned source stream to wait for the data in the above-mentioned target stream. The upper limit value of the above-mentioned delay tolerance time interval may represent the longest waiting duration for the data in the above-mentioned target stream to wait for the data in the above-mentioned source stream.

[0087] As an example, the above-mentioned delay tolerance time interval can be [-15s, 60s]. "-15s" can indicate that the longest waiting duration for the data in the above-mentioned source stream to wait for the data in the above-mentioned target stream is 15 seconds. "60s" can indicate that the longest waiting duration for the data in the above-mentioned target stream to wait for the data in the above-mentioned source stream is 60 seconds. The above-mentioned slave table data can be sourced from the above-mentioned source stream, and the time when the above-mentioned slave table data is received can be 15:02:13 on May 31, 2021. Then, the time determined by the difference between 15:02:13 on May 31, 2021 and the lower limit value -15s of the above-mentioned delay tolerance time interval is 15:02:28 on May 31, 2021. Then, the above-mentioned first waiting period can be from 15:02:13 on May 31, 2021 to 15:02:28 on May 31, 2021.

[0088] In some optional implementation manners of some embodiments, the above-mentioned execution entity may further perform the following steps:

[0089] First step, in response to determining that the above-mentioned slave table data comes from the above-mentioned target stream, determine a second waiting period according to the time when the above-mentioned slave table data is received and the upper limit value of the above-mentioned delay tolerance time interval. Among them, the time period between the time when the above-mentioned slave table data is received and the time determined by the sum of the time when the above-mentioned slave table data is received and the upper limit value of the above-mentioned delay tolerance time interval can be determined as the second waiting period.

[0090] As an example, the time when the above-mentioned slave table data is received can be 15:02:13 on May 31, 2021. Then, the time determined by the sum of 15:02:13 on May 31, 2021 and the upper limit value 60s of the above-mentioned delay tolerance time interval is 15:03:13 on May 31, 2021. Then, the above-mentioned second waiting period can be from 15:02:13 on May 31, 2021 to 15:03:13 on May 31, 2021.

[0091] Second step, in response to receiving, within the above-mentioned second waiting period, associated data matching the above-mentioned slave table data from the above-mentioned source stream, determine the time difference between the time when the above-mentioned associated data is received and the time when the above-mentioned slave table data is received as the waiting duration. Among them, the associated data matching the above-mentioned slave table data can be data having the same key value as the above-mentioned slave table data.

[0092] As an example, the time to receive the above slave table data can be May 31, 2021, 15:02:13. The time to receive the associated data that matches the above slave table data can be May 31, 2021, 15:02:50, within the above second waiting period from May 31, 2021, 15:02:13 to May 31, 2021, 15:03:13. Then, the time difference of 37s between May 31, 2021, 15:02:50 and May 31, 2021, 15:02:13 can be used as the waiting duration.

[0093] Optionally, the above execution entity may also, in response to not receiving the associated data that matches the above slave table data from the above target stream within the above second waiting period, select the upper limit value of the above delay tolerance time interval as the waiting duration.

[0094] As an example, if the associated data that matches the above slave table data is not received within the above second waiting period from May 31, 2021, 15:02:13 to May 31, 2021, 15:03:13, the upper limit value of 60s of the above delay tolerance time interval [-15s, 60s] can be used as the waiting duration.

[0095] Step 308, in response to receiving the associated data that matches the slave table data from the target stream within the first waiting period, determine the time difference between the time to receive the slave table data and the time to receive the associated data as the waiting duration.

[0096] In some embodiments, the above execution entity may, in response to receiving the associated data that matches the above slave table data from the above target stream within the above first waiting period, determine the time difference between the time to receive the above slave table data and the time to receive the above associated data as the waiting duration. Among them, the associated data that matches the above slave table data may be data with the same key value as the above slave table data.

[0097] As an example, the above first waiting period may be from May 31, 2021, 15:02:13 to May 31, 2021, 15:02:28. The time to receive the associated data that matches the above slave table data can be May 31, 2021, 15:02:20, within the above first waiting period. Then, the time difference of -7s between May 31, 2021, 15:02:13 and May 31, 2021, 15:02:20 can be used as the waiting duration.

[0098] In some alternative implementation manners of some embodiments, the above execution entity may also, in response to not receiving the associated data that matches the above slave table data from the above target stream within the above first waiting period, select the lower limit value of the above delay tolerance time interval as the waiting duration.

[0099] As an example, if the associated data matching the above slave table data is not received within the above first waiting period from 15:02:13 on May 31, 2021 to 15:02:28 on May 31, 2021, the lower limit value -15s of the above delay tolerance time interval [-15s, 60s] can be used as the waiting duration.

[0100] Step 309, add the waiting duration to the waiting duration set.

[0101] In some embodiments, the above execution entity can add the above waiting duration to the above waiting duration set.

[0102] Step 310, in response to receiving the master table data from the target stream or the source stream, send down the master table data.

[0103] In some embodiments, the above execution entity, in response to receiving the master table data from the above target stream or the above source stream, sending down the above master table data may include the following steps:

[0104] The first step is to determine whether there is associated data in the cache that matches the above master table data. Among them, the associated data that matches the above master table data can be data that was received earlier, stored in the cache, and has the same primary key value as the above master table data.

[0105] The second step is to, in response to determining that there is the above associated data, send down the above associated data and the above master table data together.

[0106] The third step is to, in response to determining that there is no such associated data, send down the above master table data.

[0107] Thus, after judging the associated master-slave relationship of the data, it is possible to ensure the delay-free sending down of the master table and guarantee the data correctness.

[0108] As an example, referring to Figure 4 , first, it can be determined whether there is associated data 403 in the cache 401 that matches the above master table data 402. Then, in response to determining that there is the above associated data 403, the above associated data 403 and the above master table data 402 can be sent down together. Or, in response to determining that there is no such associated data 403, the above master table data 402 can be sent down.

[0109] It can be seen from Figure 3 that compared with the description of some embodiments corresponding to Figure 2 , Figure 3The process 300 of the delay tolerance time interval updating method in some corresponding embodiments embodies the generation step of the waiting durations in the waiting duration set and the distribution step of the master table data. Thus, the solutions described in these embodiments can support the processing of two streams of data in scenarios where both streams of data are master table data, both streams of data are slave table data, or one stream of data is master table data and the other stream of data is slave table data. It can also ensure the delay-free distribution of the master table data and guarantee data correctness after determining the associated master-slave relationship of the data.

[0110] Further referring to Figure 5 , as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a delay tolerance time interval updating device. These device embodiments correspond to Figure 2 the method embodiments shown, and the device can be specifically applied to various electronic devices.

[0111] As Figure 5 shown, the delay tolerance time interval updating device 500 in some embodiments includes: a generating unit 501, a determining unit 502, and an updating unit 503. Among them, the generating unit 501 is configured to generate a target probability density function according to the waiting duration set in response to determining that the waiting duration set meets a preset condition, where the waiting durations in the waiting duration set are the mutual waiting durations of the data in the target stream and the source stream that need to be associated; the determining unit 502 is configured to determine an upper limit value of the waiting duration and a lower limit value of the waiting duration based on the target probability density function; the updating unit 503 is configured to update the upper limit value and the lower limit value of the delay tolerance time interval to the upper limit value of the waiting duration and the lower limit value of the waiting duration respectively.

[0112] In an alternative implementation manner of some embodiments, the determining unit includes a dividing value determining subunit, a first minimum value determining subunit, and a second minimum value determining subunit. Among them, the dividing value determining subunit is configured to determine the value of the independent variable corresponding to the maximum value of the target probability density function as the dividing value; the first minimum value determining subunit is configured to determine the value of the independent variable corresponding to the minimum value of the target probability density function in the interval from negative infinity to the dividing value to obtain the lower limit value of the waiting duration; the second minimum value determining subunit is configured to determine the value of the independent variable corresponding to the minimum value of the target probability density function in the interval from the dividing value to positive infinity to obtain the upper limit value of the waiting duration.

[0113] In an alternative implementation manner of some embodiments, the preset condition is that the number of waiting durations included in the waiting duration set is greater than or equal to a target number; and after the generating unit, the device further includes a clearing unit configured to clear the waiting duration set.

[0114] In an alternative implementation of some embodiments, the above-mentioned apparatus further includes: a source determination unit, a first waiting period determination unit, and a first waiting duration determination unit. Among them, the source determination unit is configured to determine the source of the slave table data in response to receiving slave table data from the above-mentioned target stream or the above-mentioned source stream and not matching the associated data; the first waiting period determination unit is configured to determine a first waiting period in response to determining that the slave table data comes from the above-mentioned source stream, based on the time when the slave table data is received and the lower limit value of the above-mentioned delay tolerance time interval; the first waiting duration determination unit is configured to determine the time difference between the time when the slave table data is received and the time when the associated data is received as the waiting duration in response to receiving, within the above-mentioned first waiting period, associated data from the above-mentioned target stream that matches the above-mentioned slave table data.

[0115] In an alternative implementation of some embodiments, the above-mentioned apparatus further includes a first selection unit, which is configured to select the lower limit value of the above-mentioned delay tolerance time interval as the waiting duration in response to not receiving, within the above-mentioned first waiting period, associated data from the above-mentioned target stream that matches the above-mentioned slave table data.

[0116] In an alternative implementation of some embodiments, the above-mentioned apparatus further includes a second waiting period determination unit and a second waiting duration determination unit. Among them, the second waiting period determination unit is configured to determine a second waiting period in response to determining that the slave table data comes from the above-mentioned target stream, based on the time when the slave table data is received and the upper limit value of the above-mentioned delay tolerance time interval; the second waiting duration determination unit is configured to determine the time difference between the time when the associated data is received and the time when the slave table data is received as the waiting duration in response to receiving, within the above-mentioned second waiting period, associated data from the above-mentioned source stream that matches the above-mentioned slave table data.

[0117] In an alternative implementation of some embodiments, the above-mentioned apparatus further includes a second selection unit, which is configured to select the upper limit value of the above-mentioned delay tolerance time interval as the waiting duration in response to not receiving, within the above-mentioned second waiting period, associated data from the above-mentioned target stream that matches the above-mentioned slave table data.

[0118] In an alternative implementation of some embodiments, the above-mentioned apparatus further includes an adding unit, which is configured to add the above-mentioned waiting duration to the above-mentioned waiting duration set.

[0119] In an alternative implementation of some embodiments, the above-mentioned apparatus further includes a sending unit, which is configured to send the above-mentioned master table data in response to receiving master table data from the above-mentioned target stream or the above-mentioned source stream.

[0120] It can be understood that the units described in the apparatus 500 are related to the referenceFigure 2 corresponds to each step in the described method. Thus, the operations, features, and beneficial effects described above for the method also apply to the apparatus 500 and the units included therein, and will not be repeated here.

[0121] Reference is now made to Figure 6 , which shows a schematic structural diagram of an electronic device 600 suitable for use in implementing some embodiments of the present disclosure. Figure 6 The electronic device shown is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.

[0122] As Figure 6 shown, the electronic device 600 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0123] Generally, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 6 an electronic device 600 with various devices is shown, it should be understood that it is not required to implement or include all the shown devices. More or fewer devices may be alternatively implemented or included. Figure 6 Each block shown in

[0124] may represent a device or, as needed, multiple devices. Particularly, according to some embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for performing the methods shown in the flowcharts. In such some embodiments, the computer program may be downloaded and installed from a network via the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the methods of some embodiments of the present disclosure are performed.

[0125] It should be noted that the computer-readable media described in some embodiments of the present disclosure may be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-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 of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer 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 of the above. In some embodiments of the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, the computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable signal medium may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0126] In some embodiments, the client and the server may communicate using any currently known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed network.

[0127] The above computer-readable medium may be included in the above electronic device; or it may exist separately without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device is caused to: in response to determining that the set of waiting durations meets a preset condition, generate a target probability density function according to the set of waiting durations, where the waiting durations in the set of waiting durations are the mutual waiting durations of the data in the target stream and the source stream that need to be correlated; based on the target probability density function, determine an upper limit value and a lower limit value of the waiting duration; update the upper limit value and the lower limit value of the delay tolerance time interval to the upper limit value and the lower limit value of the waiting duration respectively.

[0128] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it may be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).

[0129] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.

[0130] The units described in some embodiments of the present disclosure may be implemented in software or in hardware. The described units may also be provided in a processor. For example, it may be described as: a processor includes a generating unit, a determining unit, and an updating unit. Among them, the names of these units do not constitute a limitation on the unit itself in some cases. For example, the generating unit may also be described as "the unit for generating a target probability density function".

[0131] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), Systems on Chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.

Claims

1. A method for updating a delay tolerance time interval, comprising: Responding to determining that a set of waiting durations meets a preset condition, generating a target probability density function according to the set of waiting durations, wherein the waiting durations in the set of waiting durations are the mutual waiting durations of the data in a target stream and a source stream that need to be associated; Based on the target probability density function, determining an upper limit value and a lower limit value of the waiting duration; Updating the upper limit value and the lower limit value of the delay tolerance time interval to the upper limit value and the lower limit value of the waiting duration respectively.

2. The method according to claim 1, wherein, The determining an upper limit value and a lower limit value of the waiting duration based on the target probability density function includes: Determining the value of the independent variable corresponding to the maximum value of the target probability density function as a separation value; Determining the value of the independent variable corresponding to the minimum value of the target probability density function within the interval from negative infinity to the separation value, to obtain a lower limit value of the waiting duration; Determining the value of the independent variable corresponding to the minimum value of the target probability density function within the interval from the separation value to positive infinity, to obtain an upper limit value of the waiting duration.

3. The method according to claim 1, wherein, The preset condition is that the number of waiting durations included in the set of waiting durations is greater than or equal to a target number; And After the responding to determining that the set of waiting durations meets the preset condition and generating the target probability density function according to the set of waiting durations, the method further includes: Clearing the set of waiting durations.

4. The method according to claim 1, wherein The method further includes: Responding to receiving slave table data from the target stream or the source stream and not matching associated data, determining the source of the slave table data; Responding to determining that the slave table data comes from the source stream, determining a first waiting period according to the time when the slave table data is received and the lower limit value of the delay tolerance time interval; Responding to receiving, within the first waiting period, associated data from the target stream that matches the slave table data, determining the time difference between the time when the slave table data is received and the time when the associated data is received as the waiting duration.

5. The method according to claim 4, wherein The method further includes: Responding to not receiving, within the first waiting period, associated data from the target stream that matches the slave table data, selecting the lower limit value of the delay tolerance time interval as the waiting duration.

6. The method according to claim 4, wherein, The method further includes: Responding to determining that the slave table data comes from the target stream, determining a second waiting period according to the time when the slave table data is received and the upper limit value of the delay tolerance time interval; Responding to receiving, within the second waiting period, associated data from the source stream that matches the slave table data, determining the time difference between the time when the associated data is received and the time when the slave table data is received as the waiting duration.

7. The method according to claim 6, wherein The method further includes: Responding to not receiving, within the second waiting period, associated data from the target stream that matches the slave table data, selecting the upper limit value of the delay tolerance time interval as the waiting duration.

8. The method according to any one of claims 4 to 7, wherein, The method further includes: Adding the waiting duration to the set of waiting durations.

9. The method according to claim 5, wherein, The method further includes: In response to receiving the master table data from the target stream or the source stream, the master table data is sent downwards.

10. A delay tolerance time interval updating device, comprising: a generating unit configured to generate a target probability density function according to a waiting duration set in response to determining that the waiting duration set meets a preset condition, wherein the waiting durations in the waiting duration set are mutual waiting durations of data in a target stream and a source stream that need to be associated; a determining unit configured to determine an upper limit value and a lower limit value of a waiting duration based on the target probability density function; an updating unit configured to update the upper limit value and the lower limit value of the delay tolerance time interval to the upper limit value and the lower limit value of the waiting duration respectively.

11. An electronic device, comprising: one or more processors; a storage device having stored thereon one or more programs, when the one or more programs are executed by the one or more processors, enabling the one or more processors to implement the method according to any one of claims 1-9.

12. A computer-readable medium having a computer program stored thereon, wherein, When the program is executed by the processor, the method according to any one of claims 1-9 is implemented.

Citation Information

Patent Citations

  • Device and method for synchronizing data packet from sensor network

    CN102857333A

  • Single out-of-order measurement centralized fusion method of arbitrary delay steps of a nonlinear system

    CN108846427A