CN114116807A - Delay tolerance time interval updating method, device, electronic equipment and medium - Google Patents

Delay tolerance time interval updating method, device, electronic equipment and medium Download PDF

Info

Publication number
CN114116807A
CN114116807A CN202111479286.2A CN202111479286A CN114116807A CN 114116807 A CN114116807 A CN 114116807A CN 202111479286 A CN202111479286 A CN 202111479286A CN 114116807 A CN114116807 A CN 114116807A
Authority
CN
China
Prior art keywords
waiting
data
limit value
waiting time
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111479286.2A
Other languages
Chinese (zh)
Inventor
陈健璋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN202111479286.2A priority Critical patent/CN114116807A/en
Publication of CN114116807A publication Critical patent/CN114116807A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24568Data stream processing; Continuous queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2462Approximate or statistical queries

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Fuzzy Systems (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The embodiment of the disclosure discloses a delay tolerance time interval updating method, a delay tolerance time interval updating device, electronic equipment and a medium. One embodiment of the method comprises: in response to the fact that the waiting time length set meets the preset condition, generating a target probability density function according to the waiting time length set, wherein the waiting time length in the waiting time length set is the mutual waiting time length of data in the target flow and the source flow which need to be correlated; determining a waiting time length upper limit value and a waiting time length lower limit value based on a target probability density function; and respectively updating the upper limit value and the lower limit value of the delay tolerance time interval into the upper limit value and the lower limit value of the waiting time. The implementation mode can save cache resources to the maximum extent while ensuring that most data completes the association logic.

Description

Delay tolerance time interval updating method, device, electronic equipment and medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a method and a device for updating a delay tolerance time interval, electronic equipment and a medium.
Background
In an application scenario of associating two stream data based on a time interval, data which have the same primary key value and have a time interval not exceeding a specified time interval in the two stream data need to be associated and then issued. At present, in the two-stream data association based on time intervals, the following methods are generally adopted: and setting a fixed delay tolerance time interval, directly discarding data which is not matched with the associated data in the delay tolerance time interval, and caching all data of which the timestamp is greater than the lower limit value of the current water level line plus the delay tolerance time interval.
However, when associating two stream data in the above manner, there are often technical problems as follows:
in practice, the arrival sequence and the time difference between the front and the back of the data in the two data streams cannot be estimated exactly, and if the delay tolerance time interval is set to be too short, a large amount of data is discarded due to the fact that the data are not matched successfully, and the accuracy cannot be achieved once; if the delay tolerance time interval is set too long, a large amount of memory cache data is consumed, and storage resources are wasted.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure provide a delay tolerance time interval updating method, apparatus, electronic device and medium to solve the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a method for updating a delay tolerant time interval, the method including: in response to determining that the waiting time length set meets a preset condition, generating a target probability density function according to the waiting time length set, wherein the waiting time lengths in the waiting time length set are the mutual waiting time lengths of data in a target stream and a source stream which need to be associated; determining a waiting time length upper limit value and a waiting time length lower limit value based on the target probability density function; and updating the upper limit value and the lower limit value of the delay tolerance time interval into the upper limit value and the lower limit value of the waiting time length respectively.
Optionally, 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 in the interval from minus infinity to the separation value to obtain a lower limit value of waiting time; and determining the value of the independent variable corresponding to the minimum value of the target probability density function in the interval from the separation value to the plus infinity to obtain the upper limit value of the waiting time.
Optionally, the preset condition is that the number of the waiting durations included in the waiting duration set is greater than or equal to a target number; and after the step of generating the target probability density function according to the waiting duration set in response to the step of determining that the waiting duration set satisfies the preset condition, the method further comprises the steps of: and clearing the waiting time length set.
Optionally, the method further includes: in response to receiving slave table data from the target stream or the source stream that does not match the associated data, determining a source of the slave table data; in response to determining that the slave table data is from the source stream, determining a first latency period according to a time at which the slave table data is received and a lower limit value of the delay tolerance time interval; and in response to receiving the associated data matched with the slave table data from the target stream in the first waiting period, determining a time difference value between the time of receiving the slave table data and the time of receiving the associated data as a waiting time length.
Optionally, the method further includes: and in response to the fact that the associated data matched with the slave table data is not received from the target stream in the first waiting time period, selecting a lower limit value of the delay tolerance time interval as the waiting time period.
Optionally, the method further includes: in response to determining that the slave table data is from the target stream, determining a second waiting period according to the time of receiving the slave table data and an upper limit value of the delay tolerance time interval; and in response to receiving the associated data matched with the slave table data from the source stream in the second waiting period, determining a time difference value between the time of receiving the associated data and the time of receiving the slave table data as a waiting time period.
Optionally, the method further includes: and in response to that the associated data matched with the slave table data is not received from the target stream in the second waiting time period, selecting an upper limit value of the delay tolerance time interval as the waiting time period.
Optionally, the method further includes: and adding the waiting time length into the waiting time length set.
Optionally, the method further includes: and issuing the main table data in response to receiving the main table data from the target stream or the source stream.
In a second aspect, some embodiments of the present disclosure provide a delay tolerant time interval updating apparatus, including: the generating unit is configured to generate a target probability density function according to a waiting time length set in response to the fact that the waiting time length set meets a preset condition, wherein the waiting time lengths in the waiting time length set are the mutual waiting time lengths of data in a target stream and a source stream which need to be associated; a determination unit configured to determine a waiting time period upper limit value and a waiting time period lower limit value based on the target probability density function; an updating unit configured to update an upper limit value and a lower limit value of the delay tolerance time interval to the waiting time period upper limit value and the waiting time period lower limit value, respectively.
Optionally, the determining unit includes a separation value determining subunit, a first minimum value determining subunit, and a second minimum value determining subunit. Wherein the separation value determining subunit is configured to determine, as the separation value, a value of an argument corresponding to a maximum value of the target probability density function; the first minimum value determining subunit is configured to determine a value of an independent variable corresponding to a minimum value of the target probability density function in an interval between minus infinity and the separation value, so as to obtain a lower limit value of the waiting time duration; the second minimum determination subunit is configured to determine a value of the argument corresponding to the minimum value of the target probability density function in the interval from the separation value to positive infinity, and obtain the waiting duration upper limit value.
Optionally, the preset condition is that the number of the waiting durations included in the waiting duration set is greater than or equal to a target number; and after the generating unit, the apparatus further comprises an emptying unit configured to empty the waiting duration set.
Optionally, the apparatus further comprises: the device comprises a source determining unit, a first waiting period determining unit and a first waiting time length determining unit. Wherein the source determining unit is configured to determine a source of the slave table data in response to receiving the slave table data from the target stream or the source stream that does not match the associated data; the first waiting time period determining unit is configured to determine a first waiting time 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 is from the source stream; the first wait time period determining unit is configured to determine, as the wait time period, a time difference between a time at which the slave table data is received and a time at which the association data is received, in response to receiving the association data that matches the slave table data from the target stream within the first wait time period.
Optionally, the apparatus further includes a first selecting unit configured to select a lower limit of the delay tolerance time interval as the waiting time period in response to that no associated data matching the slave table data is received from the target stream within the first waiting time period.
Optionally, the apparatus further includes a second waiting period determining unit and a second waiting period determining unit. Wherein the second waiting period determining unit is configured to determine 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, in response to determining that the slave table data is from the target stream; the second waiting time period determining unit is configured to determine a time difference between a time when the association data is received and a time when the slave table data is received as the waiting time period in response to receiving the association data matching the slave table data from the source stream within the second waiting time period.
Optionally, the apparatus further includes a second selecting unit configured to select an upper limit of the delay tolerance time interval as the waiting time period in response to that no associated data matching the slave table data is received from the target stream within the second waiting time period.
Optionally, the apparatus further includes a joining unit configured to join the waiting duration into the waiting duration set.
Optionally, the apparatus further includes a distribution unit configured to distribute the main table data in response to receiving the main table data from the target stream or the source stream.
In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement the method described in any of the implementations of the first aspect.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium on which a computer program is stored, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect.
The above embodiments of the present disclosure have the following advantages: by the delay tolerance time interval updating method of some embodiments of the present disclosure, the data delay tolerance time interval can be dynamically adjusted, and the cache resources are saved to the maximum extent while ensuring that most data complete the association logic. Specifically, the reasons that data is discarded due to the fact that data is not successfully matched, cannot be accurately obtained once, or a large amount of memory cache data is consumed, and storage resources are wasted are as follows: the set delay tolerance time interval is fixed. Based on this, the delay tolerance time interval updating method of some embodiments of the present disclosure generates a target probability density function according to a plurality of 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 tolerant time interval is updated according to the history data. The delay tolerance time interval is not too long or too short, and the condition that the intersection of the delay tolerance time interval and the actual data arrival time difference is reduced due to the data arrival time change caused by the occurrence of wave peaks and wave troughs of the service data can be avoided to a certain extent. Furthermore, the cache resources are saved to the maximum extent while the majority of data is ensured to complete the association logic.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale.
FIG. 1 is a schematic diagram of one application scenario of the delay tolerance time interval update method of some embodiments of the present disclosure;
FIG. 2 is a flow diagram of some embodiments of a delay tolerance time interval update method according to the present disclosure;
FIG. 3 is a flow diagram of further embodiments of a delay tolerance time interval update method according to the present disclosure;
FIG. 4 is a schematic diagram of issuing master table data in other embodiments of the delay tolerance interval update method of the present disclosure;
FIG. 5 is a block diagram of some embodiments of a delay tolerant time interval update apparatus of the present disclosure;
FIG. 6 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram of an application scenario of a delay tolerance time interval updating method according to some embodiments of the present disclosure.
In the application scenario of fig. 1, first, in response to determining that the waiting duration set 102 satisfies a preset condition, the computing device 101 may generate a target probability density function 103 according to the waiting duration set 102, where the waiting duration in the waiting duration set 102 is a mutual waiting duration of data in a target stream and a source stream that need to be associated; then, the computing device 101 may 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 may update the upper and lower limit values of the delay tolerance time interval 106 to the above-described upper limit value 104 and the above-described lower limit value 105 of the waiting duration, respectively.
The computing device 101 may be hardware or software. When the computing device is hardware, it may be implemented as a distributed cluster composed of multiple servers or terminal devices, or may be implemented as a single server or a single terminal device. When the computing device is embodied as software, it may be installed in the hardware devices enumerated above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of computing devices in FIG. 1 is merely illustrative. There may be any number of computing devices, as implementation needs dictate.
With continued reference to fig. 2, a flow 200 of some embodiments of a delay tolerance time interval update method according to the present disclosure is shown. The process 200 of the delay tolerance time interval updating method includes the following steps:
step 201, in response to determining that the waiting duration set satisfies the preset condition, generating a target probability density function according to the waiting duration set.
In some embodiments, an executing agent of the delay tolerance interval update method (e.g., the computing device 101 shown in fig. 1) may generate the target probability density function from the set of latency durations in response to determining that the set of latency durations satisfies the preset condition. Wherein the wait time length in the wait time length set may be a historical mutual wait time length of data in the target stream and the source stream that need to be associated. The target stream may be a data stream in which the waiting time of data in the data stream is counted as positive. The source stream may be a data stream in which the latency of data in the data stream is negative. Any one of the two stream data that need to be associated may be designated as a target stream and the other stream as a source stream.
The preset condition may be that the duration corresponding to the waiting duration set reaches a preset duration. The duration corresponding to the waiting duration set may be a duration starting from the timing point when the waiting duration set is empty, or after all the waiting durations in the waiting duration set have been used to generate the target probability density function, the time added to the first waiting duration in the waiting duration set is used.
The waiting duration added to the waiting duration set within the duration corresponding to the waiting duration set may be selected from the waiting duration set as a target waiting duration, and a target waiting duration set may be obtained. The target probability density function may be a kernel density function in which the kernel function is a target kernel function. Each target waiting duration in the target waiting duration set may be substituted into the initial probability density function as known sample data to obtain the target probability density function:
Figure BDA0003394394440000081
wherein,
Figure BDA0003394394440000082
representing the target probability density function. n represents the number of target waiting time periods in the above set of target waiting time periods. h represents a preset bandwidth. i represents a serial number. K (-) represents the above-mentioned objective kernel function. x represents the argument of the above target probability density function. X represents a target waiting time period in the above set of target waiting time periods. XiIndicating the ith target waiting time length in the set of target waiting time lengths.
In practice, the preset bandwidth is a positive number greater than zero, and may be set according to an actual application scenario, which is not limited herein. The target kernel function may be an epaneechnikov kernel function, a quartic kernel function, a trilight kernel function, a cosine kernel function, or the like.
As an example, the preset bandwidth may take the value of
Figure BDA0003394394440000083
Figure BDA0003394394440000084
Is the standard deviation of each target waiting duration in the set of target waiting durations.
Step 202, determining an upper limit value and a lower limit value of the waiting time based on the target probability density function.
In some embodiments, the determining, by the execution subject, an upper waiting duration value and a lower waiting duration value based on the target probability density function may include:
firstly, integrating the target probability density function in the delay tolerance time interval to obtain an integral area value.
And secondly, in response to the fact that the integral area value is larger than or equal to a preset area value, determining the product value of the upper limit value and the lower limit value of the delay tolerance time interval and a first preset value as a waiting time length upper limit value and a waiting time length lower limit value respectively.
As an example, the preset area value may be 3/4. The first predetermined value may be 3/4.
And thirdly, in response to the fact that the integral area value is smaller than a preset area value, determining the product value of the upper limit value and the lower limit value of the delay tolerance time interval and a second preset value as the upper limit value and the lower limit value of the waiting time respectively.
As an example, the second preset value may be 4/3.
And step 203, 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 time interval respectively.
In some embodiments, the execution main body may update the upper limit value and the lower limit value of the delay tolerance time interval to the waiting duration upper limit value and the waiting duration lower limit value, respectively.
The above embodiments of the present disclosure have the following advantages: by the delay tolerance time interval updating method of some embodiments of the present disclosure, the data delay tolerance time interval can be dynamically adjusted, and the cache resources are saved to the maximum extent while ensuring that most data complete the association logic. Specifically, the reasons that data is discarded due to the fact that data is not successfully matched, cannot be accurately obtained once, or a large amount of memory cache data is consumed, and storage resources are wasted are as follows: the set delay tolerance time interval is fixed. Based on this, the delay tolerance time interval updating method of some embodiments of the present disclosure generates a target probability density function according to a plurality of 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 tolerant time interval is updated according to the history data. The delay tolerance time interval is not too long or too short, and the condition that the intersection of the delay tolerance time interval and the actual data arrival time difference is reduced due to the data arrival time change caused by the occurrence of wave peaks and wave troughs of the service data can be avoided to a certain extent. Furthermore, the cache resources are saved to the maximum extent while the majority of data is ensured to complete the association logic.
With further reference to fig. 3, a flow 300 of further embodiments of a delay tolerance time interval update method is illustrated. The process 300 of the delay tolerance time interval updating method includes the following steps:
step 301, in response to determining that the waiting duration set satisfies the preset condition, generating a target probability density function according to the waiting duration set.
In some embodiments, an executing agent of the delay tolerance interval update method (e.g., the computing device 101 shown in fig. 1) may generate the target probability density function from the set of latency durations in response to determining that the set of latency durations satisfies the preset condition. Wherein, the wait time length in the wait time length set may be the mutual wait time length of the data in the target stream and the source stream that need to be associated. The preset condition may be that the number of the waiting time periods included in the waiting time period set is greater than or equal to a target number. In practice, the target number may be set according to an actual application scenario, and is not limited herein. The target stream may be a data stream in which the waiting time of data in the data stream is counted as positive. The source stream may be a data stream in which the latency of data in the data stream is negative.
The target probability density function may be a kernel density function in which the kernel function is a target kernel function. Each waiting duration in the waiting duration set may be substituted into the initial probability density function as known sample data to obtain the target probability density function:
Figure BDA0003394394440000101
wherein,
Figure BDA0003394394440000102
representing the target probability density function. n represents the number of target waiting time periods in the above set of target waiting time periods. h represents a preset bandwidth. i represents a serial number. K (-) represents the above-mentioned objective kernel function. x represents the argument of the above target probability density function. T represents a target waiting time period in the above-described set of target waiting time periods. T isiIndicating the ith waiting time period in the target waiting time period set.
In practice, the preset bandwidth is a positive number greater than zero, and may be set according to an actual application scenario, which is not limited herein.
As an example, the above-described target kernel function may be a Gaussian kernel function. The predetermined bandwidth may take the value of
Figure BDA0003394394440000103
Figure BDA0003394394440000104
Is the standard deviation of each of the wait durations in the set of wait durations.
In some optional implementations of some embodiments, the execution body may further clear the set of wait durations. Therefore, after the target probability density function is generated according to the waiting duration set, the waiting duration set is emptied, and the waiting duration is added to the waiting duration set again until the waiting duration set meets the preset condition again. Thus, it is ensured that the target rate density function is generated at a time with the target number of waiting durations of the latest recording.
Step 302, determining the value of the argument corresponding to the maximum value of the target probability density function as the separation value.
In some embodiments, the execution subject may determine a value of an argument corresponding to a maximum value of the target probability density function as a separation value.
Step 303, determining the value of the independent variable corresponding to the minimum value of the target probability density function in the interval from minus infinity to the separation value, and obtaining the lower limit value of the waiting time.
In some embodiments, the executing entity may determine a value of an argument corresponding to a minimum value of the target probability density function in an interval between minus infinity and the separation value, to obtain the lower limit value of the waiting time period.
And 304, determining the value of the independent variable corresponding to the minimum value of the target probability density function in the interval from the separation value to the infinity, and obtaining the upper limit value of the waiting time.
In some embodiments, the executing entity may determine a value of an argument corresponding to a minimum value of the target probability density function in an interval from the separation value to positive infinity, and obtain the upper limit value of the waiting time period.
Therefore, the delay tolerance time interval can be dynamically adjusted according to the change of the data arrival time caused by the occurrence of peaks and troughs of the service data, and the intersection of the delay tolerance time interval and the actual data arrival time difference is increased. Furthermore, the cache resources are saved to the maximum extent while the majority of data is ensured to complete the association logic.
Step 305, 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 time interval respectively.
In some embodiments, the specific implementation manner and technical effects of step 305 may refer to step 203 in those embodiments corresponding to fig. 2, and are not described herein again.
In response to receiving the slave table data from the target stream or the source stream that does not match the associated data, the source of the slave table data is determined 306.
In some embodiments, the execution agent may determine a source of the slave table data in response to receiving the slave table data from the target stream or the source stream that does not match the associated data. The associated data may be data that is previously received and stored in the cache, and has the same primary key value as the slave table data. The master table data can be data that is indispensable during the execution of subsequent business processes. The slave table data may be data that may be missing during subsequent business process executions. Data in any one or two of the target stream and the source stream may be designated as master table data, and data in the remaining data streams may be designated as slave table data. Inner join, left join, right join and outer join between two streams of data may thus be supported. An inner join between two streams of data may mean that the data in the two streams of data are both slave table data, and the data can be issued only after waiting for each other. The left join and right join between two streams of data may indicate that one of the two streams of data is the master table data and the other stream of data 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 stream data can mean that the data in the two stream data are both main table data and can be directly issued without waiting each other.
If the field names included in the data in the target stream and the data in the source stream are different, the field names included in the data in the target stream and the data in the source stream may be recorded in advance. The field names included in the slave table data are matched with the field names corresponding to the target stream, and if there is no different field name, it can be determined that the slave table data is from the target stream. If there are field names that are not the same, it may be determined that the slave table data is from the source stream. If the slave table data includes a source identifier that can be used to mark the data source. The source of the slave table data can be determined by the source identification.
Step 307, in response to determining that the slave table data is from the source stream, determining a first latency period according to the time when the slave table data is received and a lower limit value of the delay tolerance time interval.
In some embodiments, the execution body may determine, as the first waiting period, a time period between a time when the slave table data is received and a time determined by a difference between the time when the slave table data is received and a lower limit value of the delay tolerance time interval, in response to determining that the slave table data is from the source stream. Wherein, the lower limit of the delay tolerance time interval may represent the longest waiting time for the data in the source stream to wait for the data in the target stream. The upper limit of the delay tolerance time interval may represent the longest waiting time for the data in the target stream to wait for the data in the source stream.
As an example, the delay tolerance time interval may be [ -15s, 60s ]. "-15 s" may indicate that the maximum waiting time for the data in the source stream to wait for the data in the target stream is 15 seconds. "60 s" may indicate that the maximum waiting time for the data in the target stream to wait for the data in the source stream is 60 seconds. The slave table data may be derived from the source stream, and the time at which the slave table data is received may be 31/5/2021/15: 02: 13. The time determined by the difference between the time interval of 2021 year 5/month 31/day 15:02:13 and the lower limit-15 s of the delay tolerance time interval is set to be 2021 year 5/month 31/day 15:02: 28. The first waiting period may be from 31/5/2021/15: 02:13 to 31/5/2021/15: 02: 28.
In some optional implementations of some embodiments, the executing body may further perform the following steps:
in the first step, in response to determining that the slave table data is from the target stream, a second waiting period is determined according to the time when the slave table data is received and the upper limit value of the delay tolerance time interval. Wherein, the time period between the time of receiving the slave table data and the time determined by the sum of the time of receiving the slave table data and the upper limit value of the delay tolerance time interval may be determined as the second waiting period.
As an example, the time for receiving the slave table data may be 31/5/2021/15/02/13. The time determined by the sum of the delay tolerance time interval of 2021, 5/month, 31/day 15:02:13 and the upper limit value of 60s is set to be 2021, 5/month, 31/day 15:03: 13. The second waiting period may be from 31/5/2021/15: 02:13 to 31/5/2021/15: 03: 13.
And a second step of determining a time difference between a time when the associated data is received and a time when the slave table data is received as a waiting time period in response to receiving the associated data matching the slave table data from the source stream within the second waiting time period. The associated data matched with the slave table data may be data having the same key value as the slave table data.
As an example, the time to receive the above slave table data may be 2021, 5/31/15: 02: 13. The time at which the associated data matching the slave table data is received may be within 31/5/2021/15: 02:50, 15:02:13 within 31/5/2021/31/15: 03:13 within 5/31/2021. The time difference 37s between 31/5/31/15/02/50/2021 and 31/5/31/15/02/13/2021 can be taken as the waiting time period.
Optionally, the executing body may further select an upper limit of the delay tolerance time interval as the waiting duration in response to that no associated data matching the slave table data is received from the target stream within the second waiting period.
As an example, if the association data matching the slave table data is not received within the second waiting period 2021 year 5 month 31 day 15:02:13 to 2021 year 5 month 31 day 15:03:13, the upper limit value 60s of the delay tolerance time interval [ -15s, 60s ] may be used as the waiting time period.
And 308, in response to receiving the associated data matched with the slave table data from the target stream in the first waiting period, determining a time difference value between the time of receiving the slave table data and the time of receiving the associated data as the waiting time length.
In some embodiments, the execution subject may determine, as the waiting duration, a time difference between a time at which the slave table data is received and a time at which the association data is received, in response to receiving the association data matching the slave table data from the target stream within the first waiting period. The associated data matched with the slave table data may be data having the same key value as the slave table data.
As an example, the first waiting period may be 2021 year 5 month 31 day 15:02:13 to 2021 year 5 month 31 day 15:02: 28. The time at which the associated data matching the slave table data described above is received may be 31/5/2021/15/02: 20, within the first waiting period described above. The time difference-7 s between 31/5/31/15/02/13/2021 and 31/5/31/15/02/20/2021 can be taken as the waiting period.
In some optional implementations of some embodiments, the executing body may further select, as the wait duration, a lower limit of the delay tolerance time interval in response to not receiving the association data matching the slave table data from the target stream within the first wait period.
As an example, if the association data matching the slave table data is not received within the first waiting period 2021, 5/31/15: 02:13 to 2021, 5/31/15: 02:28, the lower limit value-15 s of the delay tolerance time interval [ -15s, 60s ] may be used as the waiting time period.
Step 309, add the waiting duration to the waiting duration set.
In some embodiments, the execution principal may add the wait duration to the set of wait durations.
Step 310, in response to receiving the main table data from the target stream or the source stream, issuing the main table data.
In some embodiments, the issuing, by the execution main body, the main table data in response to receiving the main table data from the target stream or the source stream may include:
first, whether the cache has the associated data matched with the main table data or not is determined. The associated data matched with the primary table data may be data which is received in advance, stored in the cache, and has the same primary key value as the primary table data.
And secondly, responding to the determination that the associated data exists, and sending the associated data and the main table data together.
And thirdly, responding to the fact that the associated data do not exist, and issuing the main table data.
Therefore, after the associated master-slave relation of the data is judged, the non-delay issuing of the master table is ensured, and the data correctness is guaranteed.
As an example, referring to fig. 4, first, it may be determined whether there is associated data 403 in the cache 401 that matches the above-described main table data 402. Then, in response to determining that the associated data 403 exists, the associated data 403 may be issued along with the master table data 402. Alternatively, the master table data 402 may be issued in response to determining that the association data 403 does not exist.
As can be seen from fig. 3, compared with the description of some embodiments corresponding to fig. 2, the flow 300 of the delay tolerance time interval updating method in some embodiments corresponding to fig. 3 embodies the steps of generating the waiting time length in the waiting time length set and issuing the main table data. Therefore, the schemes described in the embodiments can support processing of two streams of data in a scenario where the two streams of data are both master table data, and both streams of data are slave table data, or data of one stream is master table data and data of the other stream is slave table data. And after the associated master-slave relationship of the data is judged, the non-delay issuing of the master table data is ensured, and the data correctness is ensured.
With further reference to fig. 5, as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a delay tolerant time interval updating apparatus, which correspond to those shown in fig. 2, and which can be applied in various electronic devices.
As shown in fig. 5, the delay tolerant time interval updating apparatus 500 of some embodiments includes: a generating unit 501, a determining unit 502 and an updating unit 503. The generating unit 501 is configured to, in response to determining that a 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 mutual waiting durations of data in a target stream and a source stream that need to be associated; a determining unit 502 configured to determine a waiting time period upper limit value and a waiting time period lower limit value based on the target probability density function; an updating unit 503 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 time period, respectively.
In an alternative implementation of some embodiments, the determining unit includes a separation value determining subunit, a first minimum value determining subunit, and a second minimum value determining subunit. Wherein the separation value determining subunit is configured to determine, as the separation value, a value of an argument corresponding to a maximum value of the target probability density function; the first minimum value determining subunit is configured to determine a value of an independent variable corresponding to a minimum value of the target probability density function in an interval between minus infinity and the separation value, so as to obtain a lower limit value of the waiting time duration; the second minimum determination subunit is configured to determine a value of the argument corresponding to the minimum value of the target probability density function in the interval from the separation value to positive infinity, and obtain the waiting duration upper limit value.
In an optional implementation manner of some embodiments, the preset condition is that the number of the waiting durations included in the waiting duration set is greater than or equal to a target number; and after the generating unit, the apparatus further comprises an emptying unit configured to empty the waiting duration set.
In an optional implementation manner of some embodiments, the apparatus further includes: the device comprises a source determining unit, a first waiting period determining unit and a first waiting time length determining unit. Wherein the source determining unit is configured to determine a source of the slave table data in response to receiving the slave table data from the target stream or the source stream that does not match the associated data; the first waiting time period determining unit is configured to determine a first waiting time 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 is from the source stream; the first wait time period determining unit is configured to determine, as the wait time period, a time difference between a time at which the slave table data is received and a time at which the association data is received, in response to receiving the association data that matches the slave table data from the target stream within the first wait time period.
In an optional implementation manner of some embodiments, the apparatus further includes a first selecting unit configured to select, as the waiting duration, a lower limit of the delay tolerance time interval in response to not receiving the association data matching the slave table data from the target stream within the first waiting period.
In an optional implementation manner of some embodiments, the apparatus further includes a second waiting period determining unit and a second waiting duration determining unit. Wherein the second waiting period determining unit is configured to determine 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, in response to determining that the slave table data is from the target stream; the second waiting time period determining unit is configured to determine a time difference between a time when the association data is received and a time when the slave table data is received as the waiting time period in response to receiving the association data matching the slave table data from the source stream within the second waiting time period.
In an optional implementation manner of some embodiments, the apparatus further includes a second selecting unit configured to select, as the waiting duration, an upper limit value of the delay tolerance time interval in response to not receiving the association data matching the slave table data from the target stream within the second waiting period.
In an optional implementation manner of some embodiments, the apparatus further includes a joining unit configured to join the waiting duration into the waiting duration set.
In an optional implementation manner of some embodiments, the apparatus further includes a distribution unit configured to distribute the main table data in response to receiving the main table data from the target stream or the source stream.
It will be understood that the elements described in the apparatus 500 correspond to various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 500 and the units included therein, and are not described herein again.
Referring now to fig. 6, shown is a schematic diagram of an electronic device 600 suitable for use in implementing some embodiments of the present disclosure. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 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 bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. 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 diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: in response to determining that the waiting time length set meets a preset condition, generating a target probability density function according to the waiting time length set, wherein the waiting time lengths in the waiting time length set are the mutual waiting time lengths of data in a target stream and a source stream which need to be associated; determining a waiting time length upper limit value and a waiting time length lower limit value based on the target probability density function; and updating the upper limit value and the lower limit value of the delay tolerance time interval into the upper limit value and the lower limit value of the waiting time length respectively.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the 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 the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations 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 diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes a generation unit, a determination unit, and an update unit. Where the names of the cells do not in some cases constitute a limitation of the cell itself, for example, a generating cell may also be described as a "cell generating a target probability density function".
The functions described herein above 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 a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.

Claims (12)

1. A method for updating a delay tolerant time interval comprises the following steps:
in response to the fact that the waiting time length set meets the preset condition, generating a target probability density function according to the waiting time length set, wherein the waiting time length in the waiting time length set is the mutual waiting time length of data in a target stream and a source stream which need to be associated;
determining a waiting time length upper limit value and a waiting time length lower limit value based on the target probability density function;
and respectively updating the upper limit value and the lower limit value of the delay tolerance time interval into the upper limit value and the lower limit value of the waiting time length.
2. The method of claim 1, wherein the determining a wait period upper value and a wait period lower value based on the target probability density function comprises:
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 an independent variable corresponding to the minimum value of the target probability density function in the interval from minus infinity to the separation value to obtain a lower limit value of waiting time;
and determining the value of the independent variable corresponding to the minimum value of the target probability density function in the interval from the separation value to the positive infinity to obtain the upper limit value of the waiting time.
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 generating a target probability density function according to the waiting duration set in response to determining that the waiting duration set satisfies a preset condition, the method further includes:
clearing the set of wait durations.
4. The method of claim 1, wherein the method further comprises:
in response to receiving slave table data from the target stream or the source stream that does not match to associated data, determining a source of the slave table data;
in response to determining that the slave table data is from the source stream, determining a first latency period as a function of a time at which the slave table data was received and a lower limit value of the delay tolerance time interval;
in response to receiving the associated data matching the slave table data from the target stream within the first waiting period, determining a time difference between a time of receiving the slave table data and a time of receiving the associated data as a waiting period.
5. The method of claim 4, wherein the method further comprises:
and in response to that the associated data matched with the slave table data is not received from the target stream in the first waiting time period, selecting a lower limit value of the delay tolerance time interval as the waiting time period.
6. The method of claim 4, wherein the method further comprises:
in response to determining that the slave table data is from the target stream, determining a second waiting period according to the time at which the slave table data is received and an upper limit value of the delay tolerance time interval;
in response to receiving the association data matching the slave table data from the source stream within the second waiting period, determining a time difference between a time of receiving the association data and a time of receiving the slave table data as a waiting period.
7. The method of claim 4, wherein the method further comprises:
and in response to the fact that the associated data matched with the slave table data are not received from the target stream in the second waiting time period, selecting an upper limit value of the delay tolerance time interval as the waiting time period.
8. The method according to one of claims 4-7, wherein the method further comprises:
and adding the waiting time length into the waiting time length set.
9. The method of claim 5, wherein the method further comprises:
and responding to the received main table data from the target stream or the source stream, and issuing the main table data.
10. A delay tolerant time interval update apparatus, comprising:
the generating unit is configured to generate a target probability density function according to a waiting time length set in response to the fact that the waiting time length set meets a preset condition, wherein the waiting time lengths in the waiting time length set are the mutual waiting time lengths of data in a target stream and a source stream which need to be associated;
a determination unit configured to determine a waiting time period upper limit value and a waiting time period lower limit value based on the target probability density function;
an updating unit configured to update an upper limit value and a lower limit value of a delay tolerance time interval to the waiting duration upper limit value and the waiting duration lower limit value, respectively.
11. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-9.
12. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-9.
CN202111479286.2A 2021-12-06 2021-12-06 Delay tolerance time interval updating method, device, electronic equipment and medium Pending CN114116807A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111479286.2A CN114116807A (en) 2021-12-06 2021-12-06 Delay tolerance time interval updating method, device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111479286.2A CN114116807A (en) 2021-12-06 2021-12-06 Delay tolerance time interval updating method, device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN114116807A true CN114116807A (en) 2022-03-01

Family

ID=80367260

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111479286.2A Pending CN114116807A (en) 2021-12-06 2021-12-06 Delay tolerance time interval updating method, device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN114116807A (en)

Similar Documents

Publication Publication Date Title
CN112787958B (en) Delay message processing method and device
CN111309747A (en) Data synchronization method, system and device
CN113760991A (en) Data operation method and device, electronic equipment and computer readable medium
CN113760498A (en) Message consumption method, device, electronic equipment and computer readable medium
CN111309366B (en) Method, device, medium and electronic equipment for managing registration core
CN116302271A (en) Page display method and device and electronic equipment
CN112948138A (en) Method and device for processing message
CN112019406B (en) Flow monitoring method and device, electronic equipment and computer readable medium
CN112015746B (en) Data real-time processing method, device, medium and electronic equipment
CN114116807A (en) Delay tolerance time interval updating method, device, electronic equipment and medium
CN113420400B (en) Routing relation establishment method, request processing method, device and equipment
CN112817701B (en) Timer processing method, device, electronic equipment and computer readable medium
CN114785770A (en) Mirror layer file sending method and device, electronic equipment and computer readable medium
CN112346891A (en) Message storage method, device, equipment and computer readable medium
CN113760178A (en) Cache data processing method and device, electronic equipment and computer readable medium
CN112507676A (en) Energy report generation method and device, electronic equipment and computer readable medium
CN112148448A (en) Resource allocation method, device, equipment and computer readable medium
CN113378041A (en) Prompt message pushing method and device, electronic equipment and computer readable medium
CN111930331A (en) Information display method and device, electronic equipment and computer readable medium
CN112073202B (en) Information generation method and device, electronic equipment and computer readable medium
CN112235167B (en) Flow alarm method, device, electronic equipment and computer readable medium
CN114116859A (en) Number source information sending method and device, electronic equipment and computer readable medium
CN113704076B (en) Task optimization method and device, electronic equipment and computer readable medium
CN112804164B (en) Flow information generation method and device, electronic equipment and computer readable medium
CN113722313A (en) Data write request processing method, device, equipment and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination