Data origin fetching method and apparatus, computer device and storage medium
By monitoring the latency time series of CDN cache nodes and switching back to the origin path, the problem of coarse-grained execution of CDN fault handling solutions is solved, enabling flexible fault handling and fast path switching, thus improving the user experience.
Patent Information
- Application Number
- PCT/CN2024/139972
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-04-22
- Filing Date
- 2024-12-17
- Publication Date
- 2025-10-30
AI Technical Summary
Existing CDN fault handling solutions have a coarse execution granularity and are not flexible enough. In particular, when intermediate cache nodes fail, they are prone to accidental triggering or cannot meet the flexible needs of different services.
By monitoring the latency time series of cache nodes in the content delivery network, if the preset fluctuation conditions are not met, a third cache node is identified among the associated nodes at the same cache level, and the path is switched back to the source path to achieve fault diagnosis and fast path switching.
It improves the flexibility of fault handling methods, enables rapid path switching in the event of a fault, reduces false triggering events, and enhances user access speed and stability.
Smart Images

Figure CN2024139972_30102025_PF_FP_ABST
Abstract
Description
Data retrieval methods, apparatus, computer equipment and storage media
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese Patent Application No. 202410487137.8, filed on April 22, 2024, entitled “Data Source Recovery Method, Apparatus, Computer Equipment and Storage Medium”, the entire contents of which are incorporated herein by reference. Technical Field
[0003] This disclosure relates to the field of computer technology, specifically to data retrieval methods, apparatus, computer equipment, and storage media. Background Technology
[0004] As users' demands for website access speed and stability increase, the use of CDN (Content Delivery Network) to optimize user experience is becoming more and more common. CDN typically includes an origin server and multi-level cache nodes. The origin server can cache data sequentially through multi-level cache nodes and distribute it to edge nodes in the multi-level cache nodes so that users can obtain data from the nearest edge node.
[0005] However, in a multi-level caching network, if an intermediate caching node before the edge node fails, for example, if the SLA (Service-Level Agreement) is less than 90%, meaning the percentage of time an intermediate caching node is available within a certain period is less than 90%, or if the RTT (Round-Trip Time) packet loss rate is higher than 10%, the faulty intermediate caching node will be removed from the CDN through the cooperation of the fault handling mechanism and the cascading scheduling system. This bypass decision-making method results in a coarse-grained execution of the fault handling scheme in the CDN and an inflexible processing method. Summary of the Invention
[0006] In view of this, the present disclosure provides a data retrieval method, apparatus, computer equipment, and storage medium.
[0007] Firstly, this disclosure provides a data retrieval method for use in content delivery networks, the method comprising:
[0008] The network status of the current origin path corresponding to the first cache node in the content delivery network is monitored to obtain the delay time series. The delay time series is used to indicate the fluctuation sequence of data packet reception time when the first cache node returns to the second cache node based on the current origin path. The first cache node is used to return to the second cache node based on the current origin path to obtain data and send data to the terminal device.
[0009] If the delayed time series does not meet the preset fluctuation conditions, a third cache node is determined from the associated nodes corresponding to the first cache node. The third cache node is at the same cache level as the second cache node in the content delivery network.
[0010] Switch the current origin path to the target origin path corresponding to the third cache node, so that the first cache node can request data from the third cache node through the target origin path.
[0011] Secondly, this disclosure provides a data back-to-source device, the device comprising:
[0012] The monitoring module is used to monitor the network status of the current back-to-origin path and obtain the delay time series. The delay time series is used to indicate the fluctuation sequence of data packet reception time when the first cache node returns to the second cache node based on the current back-to-origin path. The first cache node is used to return to the second cache node based on the current back-to-origin path to obtain data and send data to the terminal device.
[0013] The determination module is used to determine the third cache node from the associated nodes corresponding to the first cache node if the delay time series does not meet the preset fluctuation conditions. The third cache node is at the same cache level as the second cache node in the content delivery network.
[0014] The switching module is used to switch the current origin path to the target origin path corresponding to the third cache node, so that the first cache node can request data from the third cache node through the target origin path.
[0015] Thirdly, this disclosure provides a computer device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the data back-to-source method described in the first aspect or any corresponding embodiment.
[0016] Fourthly, this disclosure provides a computer-readable storage medium storing computer instructions for causing a computer to perform the data back-to-source method described in the first aspect or any corresponding embodiment thereof.
[0017] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to execute the data back-to-source method described in the first aspect or any corresponding embodiment thereof. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the specific embodiments of this disclosure or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0019] Figure 1 is a flowchart of a data retrieval method according to an embodiment of the present disclosure;
[0020] Figure 2 is a schematic diagram of a content delivery network;
[0021] Figure 3 is a schematic diagram of real-time path switching according to an embodiment of the present disclosure;
[0022] Figure 4 is a flowchart of another data back-to-source method according to an embodiment of the present disclosure;
[0023] Figure 5 is a schematic diagram of the reception time difference between adjacent data packets in the first data packet;
[0024] Figure 6 is a flowchart of another data back-to-source method according to an embodiment of the present disclosure;
[0025] Figure 7 is a schematic diagram illustrating how the keyframe caching technique causes the target back-to-origin path to retrieve historical data packets;
[0026] Figure 8 is a flowchart of another data back-to-source method according to an embodiment of the present disclosure;
[0027] Figure 9 is a structural block diagram of a data retrieval device according to an embodiment of the present disclosure;
[0028] Figure 10 is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present disclosure. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0030] The application scenarios on which the data retrieval method depends are described here.
[0031] As users' demands for website access speed and stability increase, the use of CDN (Content Delivery Network) to optimize user experience is becoming more and more common. CDN typically includes an origin server and multi-level cache nodes. The origin server can cache data sequentially through multi-level cache nodes and distribute it to edge nodes in the multi-level cache nodes so that users can obtain data from the nearest edge node.
[0032] However, in a multi-level caching network, if an intermediate caching node before the edge node fails, for example, if the SLA (Service-Level Agreement) is less than 90%, meaning the percentage of time an intermediate caching node is available within a certain period is less than 90%, or if the RTT (Round-Trip Time) packet loss rate is higher than 10%, the faulty intermediate caching node will be removed from the CDN through the cooperation of the fault handling mechanism and the cascading scheduling system. This bypass decision-making method results in a coarse-grained execution of the fault handling scheme in the CDN and an inflexible processing method.
[0033] For example, determining the failure status of intermediate cache nodes is often complex. First, it's difficult to fix the failure threshold or satisfy all scenarios; different scenarios and different customers have different threshold requirements. Second, sometimes during backbone network jitter or peak bandwidth surges, although the overall metrics of the intermediate cache nodes may not reach the failure threshold, some network-sensitive services may already be affected. Alternatively, sometimes only some intermediate cache nodes experience brief network jitter; relying on the overall failure status of the intermediate cache nodes can easily lead to false triggering of fault handling solutions.
[0034] Based on this, this disclosure provides a data back-to-origin method. First, the network status of the current back-to-origin path corresponding to a first cache node in the content delivery network (CDN) is monitored to obtain a delay time series. This delay time series indicates the fluctuation sequence of data packet reception time when the first cache node backs to the second cache node based on the current back-to-origin path. The first cache node uses the current back-to-origin path to back-to-origin from the second cache node to obtain data and send it to the terminal device. If the delay time series does not meet a preset fluctuation condition, a third cache node is determined from the associated nodes corresponding to the first cache node. This third cache node is at the same cache level as the second cache node in the CDN. Then, the current back-to-origin path can be switched to the target back-to-origin path corresponding to the third cache node, so that the first cache node requests data back-to-origin from the third cache node through the target back-to-origin path. This allows for fault judgment and switching of the back-to-origin path using nodes in the CDN as the execution unit, improving the flexibility of fault handling and enabling rapid path switching during faults.
[0035] According to an embodiment of this disclosure, a video annotation method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0036] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0037] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0038] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0039] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0040] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0041] According to an embodiment of this disclosure, a data back-to-source method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0042] This embodiment provides a data back-to-origin method, which can be used in the aforementioned content delivery network. Figure 1 is a flowchart of the data back-to-origin method according to an embodiment of this disclosure. As shown in Figure 1, the process includes the following steps:
[0043] Step S101: Monitor the network status of the current origin path corresponding to the first cache node in the content delivery network to obtain a delay time series. The delay time series is used to indicate the fluctuation sequence of data packet reception time when the first cache node returns to the second cache node based on the current origin path. The first cache node is used to return to the second cache node based on the current origin path to obtain data and send data to the terminal device.
[0044] In this embodiment of the disclosure, Figure 2 shows a schematic diagram of the content delivery network described above. The first cache node is an edge node in the content delivery network, and the second cache node is a Layer 2 node in the content delivery network. Here, the Layer 2 node can act as an intermediate cache node to obtain data from the origin server and cache it. After receiving a data acquisition request from a terminal device, the edge cache node can request data from the nearest Layer 2 node through the corresponding current origin-fetching path to return it to the terminal device. This eliminates the need to fetch data from the origin server again, allowing users to obtain the required content locally and improving the response speed and success rate of user access.
[0045] When data is retrieved from the source via the current source path, the network status of this path can be monitored. Specifically, the latency of data packets received by the first buffer node can be monitored in real time to obtain the latency time sequence corresponding to the current source path, and then the failure of the current source path can be determined based on the latency time sequence.
[0046] Step S102: If the delayed time series does not meet the preset fluctuation conditions, a third cache node is determined among the associated nodes corresponding to the first cache node. The third cache node is at the same cache level as the second cache node in the content delivery network.
[0047] In this embodiment of the disclosure, the aforementioned preset fluctuation condition can be used to indicate whether there is a fault in the current back-to-source path. Specifically, if the delay time series does not meet the preset fluctuation condition, it indicates that the network fluctuation of the current back-to-source path is large and there may be a fault.
[0048] It should be understood that, since the services corresponding to different back-to-origin paths are different, the preset fluctuation conditions for different back-to-origin paths can be different. Based on this, the preset fluctuation conditions corresponding to the current back-to-origin path can be obtained to determine whether there is a fault in the current back-to-origin path.
[0049] If the current origin path does not meet the preset fluctuation conditions, the current origin path can be switched. Specifically, the associated node pre-set for the first cache node can be obtained. This associated node can be at the same cache level as the second associated cache node and has the same service as the first cache node.
[0050] For example, if the service corresponding to the first cache node is the live streaming service of the XX live streaming room in the application, then the aforementioned second cache node and associated node can both be intermediate cache nodes used for the live streaming service of the XX live streaming room. It should be understood that this intermediate cache node is a general cache level; for example, this intermediate cache node can correspond to a layer 2 node in Figure 1. Furthermore, the aforementioned content delivery network can include multiple layers of intermediate cache nodes, such as layer 2 nodes, layer 3 nodes, etc., as can be implemented, and this disclosure does not make specific limitations in this regard.
[0051] Step S103: Switch the current origin path to the target origin path corresponding to the third cache node, so that the first cache node requests data from the third cache node through the target origin path.
[0052] In this embodiment of the disclosure, the current back-to-source path can be switched in real time by the scheduling system. As shown in Figure 3, which is a schematic diagram of real-time path switching in this disclosure, the second-layer node 1 is the second cache node and the second-layer node 2 is the third cache node.
[0053] When performing real-time path switching via the current origin-back path, the current origin-back path corresponding to Layer 2 node 1 can be switched to the target origin-back path corresponding to Layer 2 node 2, so that data can be requested from Layer 2 node 2 via the target origin-back path. It should be understood that network status monitoring of the target origin-back path can continue to be performed to enable real-time path switching in the event of a failure in the target origin-back path.
[0054] As described above, in this embodiment, the network status of the current origin path corresponding to the first cache node in the content delivery network (CDN) can be monitored to obtain a delay time series. This delay time series indicates the fluctuation sequence of data packet reception time when the first cache node returns to the second cache node based on the current origin path. The first cache node uses the current origin path to return to the second cache node to obtain data and send it to the terminal device. If the delay time series does not meet a preset fluctuation condition, a third cache node is determined from the associated nodes corresponding to the first cache node. This third cache node is at the same cache level as the second cache node in the CDN. Then, the current origin path can be switched to the target origin path corresponding to the third cache node, so that the first cache node requests data from the third cache node through the target origin path. This allows for fault judgment and switching of the origin path using nodes in the CDN as the execution unit, improving the flexibility of fault handling and enabling rapid path switching during faults.
[0055] This embodiment provides another data back-to-origin method, which can be used in the aforementioned content delivery network. Figure 4 is a flowchart of another data back-to-origin method according to an embodiment of this disclosure. As shown in Figure 4, the process includes the following steps:
[0056] Step S401: Monitor the network status of the current origin path corresponding to the first cache node in the content delivery network to obtain a delay time series. The delay time series is used to indicate the fluctuation sequence of data packet reception time when the first cache node returns to the second cache node based on the current origin path. The first cache node is used to return to the second cache node based on the current origin path to obtain data and send data to the terminal device.
[0057] Specifically, step S401 includes:
[0058] Step S4011: Monitor the first data packet of the preset format in the current source path.
[0059] In this embodiment of the disclosure, when the data transmission protocol corresponding to the current source path is a streaming protocol, the transmitted data content is usually audio plus video. Therefore, the preset format can be an audio format. Here, due to physical characteristics, the audio acquisition results in relatively uniform output packets. Therefore, for the first buffer node acting as the receiver, the fluctuation in the audio packet reception time can better reflect the network condition of the current source path.
[0060] It should be understood that if no data packets of the preset format are detected in the current back-to-source path, the fluctuation of the video packet reception time can also be used as a basis for judging the network status of the current back-to-source path. In addition, multimedia data packets of other formats can also be used besides video packets, and this disclosure does not make specific limitations on this.
[0061] Step S4012: Based on the reception time difference between adjacent data packets in the first data packet, determine the delay time sequence corresponding to the current back-to-source path.
[0062] In this embodiment of the disclosure, FIG5 is a schematic diagram of the reception time difference between adjacent data packets in the first data packet, wherein the first data packet is A1, ... A7, ... in the figure. Here, the interval between adjacent data packets in the first data packet is used to indicate the reception time difference between them.
[0063] When the network of the current origin path is stable, the reception time of the first cache node for the first data packet is fixed, for example, 20ms. However, when there are network fluctuations in the current origin path, the reception time of the first cache node for the first data packet will also fluctuate.
[0064] It should be understood that, in order to reduce the possibility of accidental triggering of path switching operations, the reception time difference between multiple adjacent data packets can be obtained to obtain a delay time series, and the delay time series can be used as the basis for determining whether to perform a path switching operation.
[0065] Step S402: If the delay time series does not meet the preset fluctuation condition, a third cache node is determined from the associated nodes corresponding to the first cache node. The third cache node is at the same cache level as the second cache node in the content delivery network. For details, please refer to step S102 of the embodiment shown in Figure 1, which will not be repeated here.
[0066] Step S403: Switch the current origin-fetching path to the target origin-fetching path corresponding to the third cache node, so that the first cache node requests data from the third cache node through the target origin-fetching path. For details, please refer to step S103 of the embodiment shown in Figure 1, which will not be repeated here.
[0067] In this embodiment of the disclosure, considering that there are usually some network fluctuations when data packets are distributed through the above-mentioned content delivery network, if the switch is performed only when the delay time of a certain data packet of the first cache node is too high, it is easy to cause frequent triggering of path switching operations. Therefore, this disclosure can obtain the reception time difference between multiple adjacent data packets to obtain a delay time sequence, and use the delay time sequence as the basis for determining whether to perform a path switching operation, thereby reducing the possibility of accidental triggering of path switching operations.
[0068] In some optional implementations, step S4012 includes:
[0069] Step a1: Calculate the first difference between the collection times of adjacent data packets based on the timestamps of adjacent data packets.
[0070] Step a2: Calculate the second difference based on the reception time of adjacent data packets in the first buffer node.
[0071] Step a3: Based on the difference between the first difference and the second difference, determine the delay time corresponding to each adjacent data packet in the first data packet, and generate a delay time sequence according to the delay time.
[0072] In this embodiment of the disclosure, the timestamp can be a media timestamp of the data packet. During the audio acquisition process, a media timestamp is added after a certain number of data packet samples are acquired. The media timestamp reflects the physical time when the data packet was generated and is independent of network latency and jitter.
[0073] For example, if the first data packet includes A1-A7, parsing the media timestamps of this first data packet yields the following acquisition times: 0ms, 20ms, 40ms, 60ms, 80ms, 100ms, and 120ms. Therefore, the first difference between adjacent data packets in this first data packet is: 0ms, 20ms, 20ms, 20ms, 20ms, 20ms, 20ms. This first difference can also be denoted as iff(audioTimestamp, where audioTimestamp represents the audio timestamp).
[0074] Furthermore, the reception time of the aforementioned adjacent data packets in the first buffer node is the time when the first buffer node receives the adjacent data packet. Again, taking the aforementioned first data packets A1-A7 as an example, when calculating the second difference, the reception times corresponding to each first data packet are: 0ms, 20ms, 40ms, 80ms, 90ms, 100ms, 120ms. Therefore, the second difference between each adjacent data packet in this first data packet is: 0ms, 20ms, 20ms, 40ms, 10ms, 10ms, 20ms. Here, this second difference can also be denoted as diff(recvTime), where recvTime is the receive time.
[0075] After determining the first and second differences, the jitter corresponding to each adjacent data packet in the first data packet can be calculated, and a delay time sequence can be generated based on this delay time. Here, jitter = Abs(diff(audioTimestamp) - diff(recvTime), that is, the absolute value of the first and second differences is taken as the delay time jitter.
[0076] Specifically, taking the first data packets A1-A7 as an example again, the first difference between adjacent data packets in this first data packet is: 0ms, 20ms, 20ms, 20ms, 20ms, 20ms, 20ms, and the second difference between adjacent data packets in this first data packet is: 0ms, 20ms, 20ms, 40ms, 10ms, 10ms, 20ms. Therefore, the delay time sequence corresponding to the first data packets A1-A7 can be: 0ms, 0ms, 0ms, 20ms, 10ms, 10ms, 0ms.
[0077] In this embodiment of the disclosure, considering that there are usually some network fluctuations when data packets are distributed through the above-mentioned content delivery network, if the switch is performed only when the delay time of a certain data packet of the first cache node is too high, it is easy to cause frequent triggering of path switching operations. Therefore, this disclosure can obtain the reception time difference between multiple adjacent data packets to obtain a delay time sequence, and use the delay time sequence as the basis for determining whether to perform a path switching operation, thereby reducing the possibility of accidental triggering of path switching operations.
[0078] In some optional implementations, step S102 above includes:
[0079] Step S6021: Determine the number of delay times that exceed the preset time in the delay time series.
[0080] Step S6022: When the quantity exceeds the preset quantity, determine that the delayed time series does not meet the preset fluctuation condition.
[0081] In this embodiment of the disclosure, the preset time can be a time value or a time interval. If the delay time in the delayed time sequence is greater than the time value or is not located in the time interval, it is determined that the delay time exceeds the preset time.
[0082] When determining whether the aforementioned delayed time series meets the preset fluctuation conditions, the number of delay times exceeding the preset time can be determined. This preset number can be one or more. Specifically, if the preset number is one, the current back-to-source path can be switched when a delay time exceeding the preset time is detected in real-time. Conversely, if the preset number is multiple, the current back-to-source path is switched when the number of delay times exceeding the preset time in the delayed time series is greater than or equal to that preset number.
[0083] Step S603: Switch the current origin-fetching path to the target origin-fetching path corresponding to the third cache node, so that the first cache node requests data from the third cache node through the target origin-fetching path. For details, please refer to step S103 of the embodiment shown in Figure 1, which will not be repeated here.
[0084] In this embodiment, the preset number can be one or more. Specifically, when the preset number is one, the current back-to-origin path can be switched when the real-time monitoring detects a delay time exceeding the preset time, thereby improving the stability of the back-to-origin path, reducing lag, and improving the user experience. Furthermore, when the preset number is multiple, the current back-to-origin path is switched when the number of delay times exceeding the preset time in the delay time sequence is greater than or equal to the preset number, thereby reducing the possibility of accidental touch events during path switching operations.
[0085] This embodiment provides another data back-to-origin method, which can be used in the aforementioned content delivery network. Figure 6 is a flowchart of another data back-to-origin method according to an embodiment of this disclosure. As shown in Figure 6, the process includes the following steps:
[0086] Step S601 involves monitoring the network status of the current origin-fetching path corresponding to the first cache node in the content delivery network to obtain a delay time series. This delay time series indicates the fluctuation sequence of data packet reception time when the first cache node fetches data from the second cache node based on the current origin-fetching path. The first cache node fetches data from the second cache node based on the current origin-fetching path and sends the data to the terminal device. For details, please refer to step S101 of the embodiment shown in Figure 1, which will not be repeated here.
[0087] Step S602: If the delay time series does not meet the preset fluctuation condition, a third cache node is determined from the associated nodes corresponding to the first cache node. The third cache node is at the same cache level as the second cache node in the content delivery network. For details, please refer to step S102 of the embodiment shown in Figure 1, which will not be repeated here.
[0088] Specifically, step S602 includes:
[0089] Step S6021: Obtain the number of associated nodes, and when there are multiple nodes, obtain the origin retrieval priority of the associated nodes, wherein the origin retrieval priority is determined based on the actual distance between the associated node and the first cache node.
[0090] Step S6022: Determine the node whose return-to-origin priority meets the priority condition among the associated nodes as the third cache node.
[0091] In the embodiments of this disclosure, the content delivery network is typically distributed, meaning that the cache nodes are distributed across different regions, so that when a user requests data, they can request the nearest edge node, thereby improving access speed.
[0092] Based on this, when there are multiple associated nodes, the path can be switched to the nearest node when switching the current origin path to improve the user's access speed. Specifically, the actual distance between the associated node and the first cache node can be determined based on the origin priority.
[0093] In practice, the origin retrieval priority can be set for each associated node based on the actual distance between the associated node and the first cache node. For example, the closer the actual distance, the higher the origin retrieval priority. Therefore, the associated node with the highest origin retrieval priority can be determined as the third cache node. Furthermore, it should be understood that, as shown in Figure 3, if there is only one associated node, path switching can be performed directly based on that associated node, without needing to perform the aforementioned process of determining the third cache node.
[0094] Step S603: Switch the current origin-fetching path to the target origin-fetching path corresponding to the third cache node, so that the first cache node requests data from the third cache node through the target origin-fetching path. For details, please refer to step S103 of the embodiment shown in Figure 1, which will not be repeated here.
[0095] In this embodiment of the disclosure, when there are multiple associated nodes, the actual distance between the associated node and the first cache node can be determined according to the origin priority, so that the associated node with the shortest actual distance value is determined as the third cache node, thereby achieving nearby switching when switching the current origin path, so as to improve the user's access speed.
[0096] In some optional implementations, the aforementioned associated node is a first-level cache node in the content delivery network, and the embodiment corresponding to step 1 above further includes:
[0097] Before determining the third cache node from the associated nodes corresponding to the first cache node, determine the cache nodes related to the data request of the first cache node from the first-level cache nodes, and determine the associated nodes based on the cache nodes.
[0098] In this embodiment of the disclosure, the first-level cache node can be the intermediate cache node in Figure 2. As can be seen from the above, the associated node can be the intermediate cache node in the content delivery network. The services corresponding to the intermediate cache node can be the same or different. Therefore, the corresponding service and the cache node of the first cache node can be determined in the intermediate cache node.
[0099] For example, if the business corresponding to the first cache node mentioned above is the live streaming business of the XX live streaming room in the application, then the associated node mentioned above can be the cache node in the intermediate cache nodes that corresponds to the live streaming business.
[0100] In this embodiment of the disclosure, an associated node related to the data request of the first cache node can be determined in the first-level cache node, thereby improving the reliability of the path switching operation when the path switching operation is performed based on the associated node.
[0101] In some optional implementations, after the first cache node requests data back to the third cache node through the target origin-back path, the embodiment corresponding to Figure 1 above further includes:
[0102] Step S11: Obtain the second data packet returned by the third cache node.
[0103] Step S12: Based on the data packet information of the second data packet, determine the historical data packet, wherein the historical data packet is a data packet with the same content as the first data packet.
[0104] Step S13: Based on historical data packets, perform deduplication on the second data packet.
[0105] In this embodiment, when the service corresponding to the first cache node is a live streaming service, gopcache technology is typically used when fetching data packets. Here, the function of gopcache technology is to cache video keyframes (i.e., I-frames; this disclosure will not elaborate on the details of I-frames), enabling newly joined users to quickly obtain the most recent I-frame, thereby reducing waiting time. In this way, users do not need to wait for the next I-frame to arrive when they obtain the data packet and can start playback immediately, improving the user experience.
[0106] However, the existence of the aforementioned gopcache technology will cause the target origin path to fetch some historical data packets after the current origin path is switched. Figure 7 shows a schematic diagram of the target origin path fetching historical data packets due to the gopcache technology.
[0107] As shown in Figure 7, the first data packets pulled by Layer 2 node 1 from the origin server are 5, 6, 7, 8... When the current origin path corresponding to Layer 2 node 1 is switched to the target origin path corresponding to Layer 2 node 2, gopcache technology caches data packets 7 and 8, resulting in the second data packets pulled through the target origin path being 7, 8, 9, 10, 11, 12... Therefore, the second data packet includes historical data packets 7 and 8.
[0108] Based on this, historical data packets can be identified from the data packet information of the second data packet, and deduplication can be performed on the second data packet based on these historical data packets. Specifically, firstly, candidate data packets with the same data type, timestamp, and data length as the first data packet can be identified from the second data packet, and the data packets whose first 100 bytes are exactly the same as those of the first data packet are identified as historical data packets.
[0109] In this embodiment of the disclosure, historical data packets that are duplicates of the content of the first data packet in the second data packet can be deduplicated, thereby avoiding repeated playback of the same data content by the terminal device after the above-mentioned path switching is performed, and improving the user's viewing experience.
[0110] This embodiment provides another data back-to-origin method, which can be used in the aforementioned content delivery network. Figure 8 is a flowchart of another data back-to-origin method according to an embodiment of this disclosure. As shown in Figure 8, the process includes the following steps:
[0111] Step S801: Obtain the first data packet in a preset format through the current source path.
[0112] In this embodiment of the disclosure, the implementation of obtaining the first data packet of the preset format through the current source path is as described in the embodiment corresponding to step S101 above, and will not be repeated here.
[0113] Step S802: Determine the delay time corresponding to the current back-to-source path based on the reception time difference between adjacent data packets in the first data packet.
[0114] In this embodiment of the disclosure, the implementation of determining the delay time corresponding to the current back-to-source path is as described in the embodiment corresponding to step S102 above, and will not be repeated here.
[0115] Step S803: Determine whether the aforementioned delay time exceeds the preset fluctuation condition; or determine whether the time during which the first data packet was not received exceeds the preset fluctuation condition using a timer. If yes, proceed to step S804; otherwise, proceed to step S801.
[0116] In this embodiment of the disclosure, the aforementioned preset fluctuation condition can be preset for a time, which is 2 seconds.
[0117] Step S804: Determine the third cache node from the associated nodes corresponding to the first cache node, and switch the current origin path to the target origin path corresponding to the third cache node.
[0118] In this embodiment of the disclosure, the implementation of determining the third cache node and performing path switching is as described in the embodiment corresponding to step S103 above, and will not be repeated here.
[0119] In summary, in this embodiment, the network status of the current origin path corresponding to the first cache node in the content delivery network can be monitored first to obtain a delay time series. This delay time series indicates the fluctuation sequence of data packet reception time when the first cache node returns to the second cache node based on the current origin path. The first cache node uses the current origin path to return to the second cache node to obtain data and send it to the terminal device. If the delay time series does not meet a preset fluctuation condition, a third cache node is determined from the associated nodes corresponding to the first cache node. This third cache node is at the same cache level as the second cache node in the content delivery network. Then, the current origin path can be switched to the target origin path corresponding to the third cache node, so that the first cache node requests data from the third cache node through the target origin path. This allows for fault judgment and switching of the origin path using nodes in the content delivery network as the execution unit, improving the flexibility of fault handling and enabling rapid path switching during faults.
[0120] This embodiment also provides a data return device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0121] This embodiment provides a data back-to-source device, as shown in Figure 9, including:
[0122] Monitoring module 901 is used to monitor the network status of the current back-to-origin path and obtain a delay time series. The delay time series is used to indicate the fluctuation sequence of data packet reception time when the first cache node returns to the second cache node based on the current back-to-origin path. The first cache node is used to return to the second cache node based on the current back-to-origin path to obtain data and send data to the terminal device.
[0123] The determination module 902 is used to determine a third cache node from the associated nodes corresponding to the first cache node if the delay time series does not meet the preset fluctuation conditions. The third cache node is at the same cache level as the second cache node in the content delivery network.
[0124] The switching module 903 is used to switch the current origin path to the target origin path corresponding to the third cache node, so that the first cache node can request data from the third cache node through the target origin path.
[0125] In some alternative implementations, the monitoring module 901 includes:
[0126] The monitoring unit is used to monitor the first data packet of a preset format in the current back-to-origin path;
[0127] The first determining unit is used to determine the delay time sequence corresponding to the current back-to-source path based on the reception time difference between adjacent data packets in the first data packet.
[0128] In some alternative implementations, the determining unit includes:
[0129] The first calculation subunit is used to calculate the first difference between the acquisition times of adjacent data packets based on the timestamps of adjacent data packets;
[0130] The second calculation subunit is used to calculate the second difference based on the reception time of adjacent data packets in the first buffer node;
[0131] The determination subunit is used to determine the delay time corresponding to each adjacent data packet in the first data packet based on the difference between the first difference and the second difference, and to generate a delay time sequence based on the delay time.
[0132] In some alternative implementations, the determining module 902 includes:
[0133] The second determining unit is used to determine the number of delay times exceeding the preset time in the delay time series;
[0134] The third determining unit is used to determine that the delayed time series does not meet the preset fluctuation conditions when the quantity exceeds the preset quantity.
[0135] In some alternative implementations, the switching module 903 includes:
[0136] The first acquisition unit is used to acquire the number of associated nodes and, when there are multiple nodes, acquire the origin return priority of the associated nodes, wherein the origin return priority is a priority determined based on the actual distance between the associated node and the first cache node.
[0137] The fourth determining unit is used to determine the third cache node as the node whose return-to-source priority meets the priority condition among the associated nodes.
[0138] In some optional implementations, the associated node is a first-level cache node in a content delivery network; the above apparatus further includes:
[0139] The fifth determining unit is used to determine the cache node related to the data request of the first cache node in the first-level cache nodes before determining the third cache node in the associated nodes corresponding to the first cache node, and to determine the associated node based on the cache node.
[0140] In some alternative embodiments, the above-described apparatus further includes:
[0141] The acquisition unit is used to acquire the second data packet returned by the third cache node after the first cache node requests data from the third cache node through the target origin path;
[0142] The sixth determining unit is used to determine historical data packets based on the data packet information of the second data packet, wherein the historical data packets are data packets with the same content as the first data packet;
[0143] The deduplication unit is used to perform deduplication operations on the second data packet based on the historical data packets.
[0144] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0145] In this embodiment, the data return device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0146] This disclosure also provides a computer device having the data retrieval device shown in FIG9 above.
[0147] Please refer to Figure 10, which is a schematic diagram of the structure of a computer device provided in an optional embodiment of this disclosure. As shown in Figure 10, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components communicate with each other using different buses and can be mounted on a common motherboard or otherwise installed as needed. The processor can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 10 shows an example of a single processor 10.
[0148] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0149] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.
[0150] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0151] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0152] The computer device also includes an input device 30 and an output device 40. The processor 10, memory 20, input device 30 and output device 40 can be connected via a bus or other means, as shown in Figure 10, which illustrates a connection via a bus.
[0153] Input device 30 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the computer device, such as a touchscreen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 40 may include display devices, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors). The aforementioned display devices include, but are not limited to, liquid crystal displays, light-emitting diodes, displays, and plasma displays. In some alternative embodiments, the display device may be a touchscreen.
[0154] This disclosure also provides a computer-readable storage medium in which the methods described in this disclosure can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium after being downloaded over a network. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium may be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium may also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code that, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0155] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0156] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0157] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0158] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0159] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0160] Although embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A data retrieval method applied to a content delivery network, the method comprising: The network status of the current back-to-origin path corresponding to the first cache node in the content delivery network is monitored to obtain a delay time series. The delay time series is used to indicate the fluctuation sequence of data packet reception time when the first cache node backs to the second cache node based on the current back-to-origin path. The first cache node is used to back-to-origin to the second cache node based on the current back-to-origin path to obtain data and send data to the terminal device. If the delay time series does not meet the preset fluctuation condition, a third cache node is determined among the associated nodes corresponding to the first cache node, wherein the third cache node is at the same cache level as the second cache node in the content delivery network; The current origin path is switched to the target origin path corresponding to the third cache node, so that the first cache node requests data from the third cache node through the target origin path.
2. The method according to claim 1, wherein monitoring network fluctuations of the current back-to-source path to obtain a delay time series comprises: Monitor the first data packet of a preset format in the current origin path; Based on the reception time difference between adjacent data packets in the first data packet, the delay time sequence corresponding to the current back-to-source path is determined.
3. The method according to claim 2, wherein determining the delay time series corresponding to the current back-to-source path based on the reception time difference between adjacent data packets in the first data packet includes: Based on the timestamps of the adjacent data packets, calculate the first difference between the collection times of the adjacent data packets; Calculate the second difference based on the reception time of the adjacent data packets in the first buffer node; Based on the difference between the first difference and the second difference, the delay time corresponding to each adjacent data packet in the first data packet is determined, and the delay time sequence is generated according to the delay time.
4. The method according to claim 1, wherein the delayed time series does not satisfy the preset fluctuation condition, including: Determine the number of delay times exceeding the preset time in the delayed time series; When the quantity exceeds the preset quantity, it is determined that the delayed time series does not meet the preset fluctuation condition.
5. The method according to claim 1, wherein determining the third cache node among the associated nodes corresponding to the first cache node includes: The number of associated nodes is obtained, and when there are multiple nodes, the origin retrieval priority of the associated nodes is obtained, wherein the origin retrieval priority is a priority determined based on the actual distance between the associated node and the first cache node; The nodes among the associated nodes whose return-to-origin priority meets the priority condition are identified as the third cache nodes.
6. The method according to claim 1, wherein the associated node is a first-level cache node in the content delivery network; The method further includes: Before determining the third cache node among the associated nodes corresponding to the first cache node, a cache node related to the data request of the first cache node is determined among the first-level cache nodes, and an associated node is determined based on the cache node.
7. The method according to claim 2, further comprising: After the first cache node requests data from the third cache node through the target origin path, it obtains the second data packet returned by the third cache node; Based on the data packet information of the second data packet, historical data packets are determined, wherein the historical data packets are data packets with the same content as the first data packet; Based on the historical data packets, the second data packet is deduplicated.
8. A data return device, comprising: The monitoring module is used to monitor the network status of the current back-to-origin path and obtain a delay time series. The delay time series is used to indicate the fluctuation sequence of data packet reception time when the first cache node returns to the second cache node based on the current back-to-origin path. The first cache node is used to return to the second cache node based on the current back-to-origin path to obtain data and send data to the terminal device. The determination module is used to determine a third cache node among the associated nodes corresponding to the first cache node if the delay time series does not meet the preset fluctuation conditions. The third cache node is at the same cache level as the second cache node in the content delivery network. The switching module is used to switch the current origin path to the target origin path corresponding to the third cache node, so that the first cache node requests data from the third cache node through the target origin path.
9. A computer device, comprising: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the data retrieval method according to any one of claims 1 to 7.
10. A computer-readable storage medium, wherein computer instructions are stored on the computer-readable storage medium for causing a computer to perform the data retrieval method of any one of claims 1 to 7.
11. A computer program product comprising computer instructions for causing a computer to perform the data retrieval method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Back-to-source link switching method and device, electronic device and storage medium
CN109286957A
Data transmission method and system between nodes in content distribution network and node equipment
CN113301096A
Method and device for determining network jitter state, electronic equipment and storage medium
CN115118636A
Data transmission method, routing cluster and edge node
CN115277539A
Generating non-congruent paths having minimal latency difference in a loop-free routing topology having routing arcs
US20180227218A1