A slice alignment method, apparatus, electronic device, and storage medium

By slicing image groups in the live streaming system and determining the slice names and indexes, the video slice alignment problem in a distributed deployment of live streams is solved, ensuring playback stability.

CN119729147BActive Publication Date: 2025-10-31CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411762853.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-10-31
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

In a distributed deployment scenario, the time it takes for the live stream to arrive at each live stream cache node is unpredictable, which can cause video slices to misalign, resulting in playback stuttering and frame skipping issues.

Method used

By acquiring multiple image groups, slicing them separately, and determining the slice name based on the slice's start time, the slices are aligned across multiple cache nodes. The target slice is accurately determined when switching between cache nodes using slice indexes and alias indexes.

Benefits of technology

This ensures accurate alignment of slices in the terminal when switching between cache nodes, avoiding playback stuttering and frame skipping issues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119729147B_ABST
    Figure CN119729147B_ABST
Patent Text Reader

Abstract

This invention provides a slice alignment method, apparatus, electronic device, and storage medium. The method includes: acquiring multiple image groups; performing slice processing on each image group to obtain multiple slices; aligning the slice content of the multiple slices with each other in multiple cache nodes; determining slice names corresponding to each slice based on the start time of each slice; aligning the slice names corresponding to the multiple slices with each other in the multiple cache nodes; determining slice indexes and alias indexes corresponding to the slice names; and when the terminal switches from a first cache node to a second cache node for slice scheduling, determining the target slice in the second cache node based on the slice index and alias index corresponding to the scheduled slice, and returning the target slice to the terminal. This ensures that if the cache node is switched, the corresponding target slice can be accurately determined, avoiding problems such as playback stuttering and frame skipping.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a slice alignment method, a slice alignment device, an electronic device, and a computer-readable storage medium. Background Technology

[0002] With the development of communication technology, the live streaming industry has become increasingly mature. During live streaming, the live streaming server receives the live stream from the broadcast controller and transcodes and segments it, dividing the live stream into video segments of equal length. These segments are then provided to external users via protocols such as HLS (HTTP Live Streaming) and DASH (Dynamic Adaptive Streaming over HTTP). Current technologies typically use the Unix system clock as a reference for slicing. However, in distributed deployment scenarios, due to network latency, process scheduling, and other factors, the arrival time of the live stream at each live streaming cache node cannot be predicted. Therefore, it is impossible to guarantee that the video segments output from different live streaming cache interfaces are aligned, leading to playback stuttering, frame skipping, and other problems. Summary of the Invention

[0003] In view of the above problems, embodiments of the present invention are proposed to provide a slice alignment method, a slice alignment apparatus, an electronic device, and a computer-readable storage medium that overcome or at least partially solve the above problems.

[0004] To address the aforementioned problems, this invention discloses a slice alignment method applied to a cache node; the cache node is connected to a terminal; the cache node comprises multiple cache nodes; and the method includes:

[0005] Multiple image groups are acquired, and each image group is sliced ​​to obtain multiple slices; the slice contents of the multiple slices are aligned with each other in the multiple cache nodes.

[0006] Based on the start time of each of the multiple slices, a slice name corresponding to each of the multiple slices is determined; the slice names corresponding to the multiple slices are aligned with each other in the multiple cache nodes.

[0007] Determine the slice index and alias index corresponding to the slice name, respectively;

[0008] When the terminal switches from the first cache node to the second cache node among the plurality of cache nodes to schedule a slice, the target slice in the second cache node is determined according to the slice index and alias index corresponding to the scheduled slice, and the target slice is returned to the terminal.

[0009] Optionally, the step of slicing the plurality of image groups based on the two consecutive image groups to obtain a plurality of slices includes:

[0010] Determine the program clock reference for each of the two consecutive image groups;

[0011] When the program clock reference of the two consecutive image groups meets the preset conditions, the position between the two consecutive image groups is determined as the slice start position.

[0012] The multiple image groups are sliced ​​according to the starting position of the slice to obtain multiple slices.

[0013] Optionally, determining the slice names corresponding to the plurality of slices based on their start times includes:

[0014] Based on the start time of each of the multiple slices, determine the time field corresponding to each of the multiple slices;

[0015] Determine the program clock reference and display time corresponding to the starting position;

[0016] Based on the clock reference and display time, determine the hash values ​​corresponding to the plurality of slices respectively;

[0017] Based on the time field and the hash value, determine the slice names corresponding to the multiple slices respectively.

[0018] Optionally, determining the slice index and alias index corresponding to the slice name respectively includes:

[0019] Based on the start time of the multiple slices and the preset naming rules, determine the slice index and alias index corresponding to the slice names respectively.

[0020] Optionally, the preset naming rules include: a first naming rule and a second naming rule; determining the slice index and alias index corresponding to the slice names respectively based on the start time of the plurality of slices and the preset naming rules includes:

[0021] When the start time of the plurality of slices is within a first preset time period, the slice index and alias index corresponding to the slice name are determined according to the first naming rule;

[0022] When the start time of the multiple slices falls within the second preset time period, the slice index and alias index corresponding to the slice name are determined according to the second naming rule.

[0023] Optionally, determining the program clock reference for the two consecutive image groups includes:

[0024] Detect the program clock reference at the end position of each image group;

[0025] The program clock reference at the end position of the previous image group of each image group is determined as the program clock reference for each image group;

[0026] Based on the program clock reference of each image group, the program clock references of the two consecutive image groups are determined respectively.

[0027] This invention also discloses a slice alignment device, which is applied to a cache node; the cache node is connected to a terminal; the cache node comprises multiple cache nodes, and the device includes:

[0028] The slicing module is used to acquire multiple image groups, slice each of the multiple image groups to obtain multiple slices; the slice contents of the multiple slices are aligned with each other in the multiple cache nodes.

[0029] The first determining module is used to determine the slice names corresponding to the plurality of slices respectively based on the start time of the plurality of slices; the slice names corresponding to the plurality of slices are aligned with each other in the plurality of cache nodes;

[0030] The second determining module is used to determine the slice index and alias index corresponding to the slice name, respectively.

[0031] The third determining module is used to determine the target slice in the second cache node according to the slice index and alias index corresponding to the scheduled slice when the terminal switches from the first cache node to the second cache node among the plurality of cache nodes for slice scheduling, and return the target slice to the terminal.

[0032] Optionally, the slicing module includes:

[0033] The first determining submodule is used to determine two consecutive image groups from the plurality of image groups respectively;

[0034] The slicing submodule is used to slice the multiple image groups based on the two consecutive image groups to obtain multiple slices.

[0035] Optionally, the slice submodule includes:

[0036] The first determining unit is used to determine the program clock reference for the two consecutive image groups respectively;

[0037] The second determining unit is used to determine the middle position of the two consecutive image groups as the slice start position when the program clock reference of the two consecutive image groups meets the preset conditions.

[0038] A slicing unit is used to slice the multiple image groups according to the slice starting position to obtain multiple slices.

[0039] Optionally, the first determining module includes:

[0040] The second determining submodule is used to determine the time fields corresponding to the multiple slices respectively based on the start time of the multiple slices;

[0041] The third determining submodule is used to determine the program clock reference and display time corresponding to the starting position;

[0042] The fourth determining submodule is used to determine the hash values ​​corresponding to the plurality of slices respectively based on the clock reference and the display time;

[0043] The fifth determining submodule is used to determine the slice names corresponding to the multiple slices based on the time field and the hash value.

[0044] Optionally, the second determining module includes:

[0045] The sixth determining submodule is used to determine the slice index and alias index corresponding to the slice name respectively, based on the start time of the multiple slices and the preset naming rules.

[0046] Optionally, the preset naming rules include: a first naming rule and a second naming rule; the seventh determining submodule includes:

[0047] The third determining unit is used to determine the slice index and alias index corresponding to the slice name respectively according to the first naming rule when the start time of the plurality of slices is within the first preset time period.

[0048] The fourth determining unit is used to determine the slice index and alias index corresponding to the slice name according to the second naming rule when the start time of the plurality of slices is within the second preset time period.

[0049] Optionally, the first determining unit includes:

[0050] The detection subunit is used to detect the program clock reference at the end position of each image group;

[0051] The first determining subunit is used to determine the program clock reference of the end position of the previous image group of each image group as the program clock reference of each image group.

[0052] The second determining subunit is used to determine the program clock references for the two consecutive image groups based on the program clock references for each image group.

[0053] The present invention also discloses an apparatus including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the slice alignment method as described above.

[0054] The present invention also discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the slice alignment method described above.

[0055] The embodiments of the present invention have the following advantages:

[0056] In this embodiment of the invention, multiple image groups are first acquired, and each image group is sliced ​​to obtain multiple slices. Then, based on the start time of each slice, a slice name corresponding to each slice is determined. The slice names corresponding to the multiple slices are aligned with each other in multiple cache nodes. Then, a slice index and an alias index corresponding to each slice name are determined. When the terminal switches from the first cache node to the second cache node for slice scheduling, the target slice in the second cache node is determined based on the slice index and alias index corresponding to the scheduled slice, and the target slice is returned to the terminal. Thus, during slicing, the slices are named according to their start time, ensuring that the slices are aligned with each other in multiple cache nodes. Then, by using the slice index and alias index corresponding to the slice name, it is ensured that when the terminal performs slice scheduling, if the cache node is switched, the corresponding target slice can be accurately determined, avoiding problems such as playback stuttering and frame skipping. Attached Figure Description

[0057] Figure 1 This is a flowchart of the steps of a slice alignment method provided in an embodiment of the present invention;

[0058] Figure 2 This is a schematic diagram of a slice provided in an embodiment of the present invention;

[0059] Figure 3 This is a schematic diagram of a slice naming method provided in an embodiment of the present invention;

[0060] Figure 4 This is a schematic diagram of determining a target slice according to an embodiment of the present invention;

[0061] Figure 5 This is a structural block diagram of a slice alignment device provided in an embodiment of the present invention. Detailed Implementation

[0062] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0063] Existing technologies cannot guarantee the alignment of video slices output from different live streaming cache interfaces during slicing, leading to playback stuttering and frame skipping issues. To address these problems, this invention proposes a slice alignment method. First, multiple image groups are acquired and sliced ​​separately to obtain multiple slices. Then, based on the start time of each slice, a slice name is determined, ensuring alignment across multiple cache nodes. Next, a slice index and alias index are determined corresponding to each slice name. When the terminal switches from a first cache node to a second cache node for slice scheduling, the target slice in the second cache node is determined based on the slice index and alias index corresponding to the scheduled slice, and the target slice is returned to the terminal. Thus, after slicing, the slices are named according to their start time, ensuring alignment across multiple cache nodes. By using the slice index and alias index corresponding to the slice name, the target slice can be accurately identified even when the cache node is switched during slice scheduling at the terminal, preventing playback stuttering and frame skipping.

[0064] Reference Figure 1 The diagram illustrates a flowchart of a slice alignment method provided by an embodiment of the present invention. The method is applied to a cache node; the cache node is connected to a terminal; the cache node comprises multiple cache nodes, and the method may specifically include the following steps:

[0065] Step 101: Obtain multiple image groups, and perform slicing processing on the multiple image groups to obtain multiple slices.

[0066] In this embodiment of the invention, during live streaming, multiple cache nodes can simultaneously acquire the live stream bitrate, thereby obtaining multiple image groups. Each cache node acquires the same image groups, and after acquiring multiple image groups, each cache node can perform slicing processing on these image groups to obtain multiple slices. For example... Figure 2 The diagram shows a slice illustration provided by an embodiment of the present invention. Figure 2 GOP0 to GOP n+1 In this context, each Group of Pictures (GOP) is a group of consecutive images, and each of the multiple cache nodes can access GOP0 through GOP1. n+1Slicing is performed to obtain multiple slices. In this invention, when slicing multiple image groups, it relies on the live stream itself and is not affected by factors such as network latency. Therefore, the slice content of multiple slices is aligned in multiple cache nodes respectively.

[0067] In this invention, a Group of Pictures (GOP) typically consists of the following types of frames: I-frame (Intra-coded Frame): Also known as a key frame, an I-frame is an independently coded frame, not dependent on other frames. It contains complete image information and can be decoded independently. I-frames are usually used at the beginning of a GOP as a reference frame. P-frame (Predictive-coded Frame): A P-frame is a predictive-coded frame that depends on preceding I-frames or P-frames. A P-frame only encodes the differences from the previous frame, so its data size is usually smaller than an I-frame. P-frames can improve compression efficiency, but require complete information from the previous frame for decoding. B-frame (Bidirectional Predictive-coded Frame): A B-frame is a bidirectional predictive-coded frame that depends on preceding I-frames or P-frames and subsequent P-frames or I-frames. A B-frame encodes the differences from the preceding and following frames, so its data size is usually smaller than a P-frame. B-frames can further improve compression efficiency, but require more reference frame information for decoding. The structure and length of a GOP (i.e., the number of frames contained in the GOP) have a significant impact on video compression efficiency and playback quality. Shorter GOPs offer better random access capabilities (e.g., fast forward, rewind) but may reduce compression efficiency. Longer GOPs improve compression efficiency but may impact random access performance. In practice, the structure and length of GOPs are typically adjusted based on the specific application scenario and requirements. For example, in real-time video transmission, shorter GOPs might be used to ensure low latency and good random access performance; while in storage and streaming applications, longer GOPs might be used to improve compression efficiency.

[0068] In one embodiment, multiple image groups are sliced ​​to obtain multiple slices, the process including: determining two consecutive image groups from the multiple image groups; and slicing the multiple image groups based on the two consecutive image groups to obtain multiple slices.

[0069] Specifically, each cache node determines two consecutive image groups from multiple image groups within its own cache node. For example, cache node 1 can determine two consecutive image groups GOP0 and GOP1, GOP1 and GOP2, GOP2 and GOP3, GOP3 and GOP4, etc., from multiple image groups within cache node 1. Similarly, cache node 2 can determine two consecutive image groups GOP0 and GOP1, GOP1 and GOP2, GOP2 and GOP3, GOP3 and GOP4, etc., from multiple image groups within cache node 2. Then, each cache node can slice multiple image groups within its own cache node based on the two consecutive image groups to obtain multiple slices. For example, cache node 1 can slice multiple image groups within cache node 1 based on the two consecutive image groups within cache node 1 to obtain multiple slices within cache node 1. Similarly, cache node 2 can slice multiple image groups within cache node 2 based on the two consecutive image groups within cache node 2 to obtain multiple slices within cache node 2.

[0070] In one embodiment, slicing multiple image groups based on two consecutive image groups to obtain multiple slices may include: determining program clock references for the two consecutive image groups respectively; when the program clock references of the two consecutive image groups meet preset conditions, determining the middle position of the two consecutive image groups as the slice start position; and slicing multiple image groups based on the slice start position to obtain multiple slices.

[0071] Specifically, this invention is illustrated using a single cache node as an example. The slicing rules or methods performed by each cache node are identical; therefore, each cache node will not be described individually here. For example... Figure 2 , Figure 2 PCR is the program clock reference in each image group. i PCR i+1 To PCR j+1 For image group GOP n-1 Program schedule reference, PCR j+2 To PCR k and PCR k+1 For image group GOP n After determining the program clock references for two consecutive image groups, it can be determined whether the program clock references of the two consecutive image groups meet preset conditions. When the program clock references of the two consecutive image groups meet the preset conditions, the middle position of the two consecutive image groups can be determined as the slice start position. For example, if the two consecutive image groups are GOPs... n and GOP n+1 Determine the GOP n and GOP n+1If the clock references of these two consecutive image groups meet the preset conditions, then the GOP can be... n and GOP n+1 The middle position is determined as the starting position of the slice, i.e. Figure 2 S in i The position is the starting position of the slice, and then the next starting position is determined based on the program time reference of two consecutive image groups, and so on. Then, multiple image groups are sliced ​​according to the starting position of the slice to obtain multiple slices.

[0072] In one embodiment, determining the program clock reference for two consecutive image groups may include: detecting the program clock reference at the end position of each image group; determining the program clock reference at the end position of the previous image group as the program clock reference for each image group; and determining the program clock reference for the two consecutive image groups based on the program clock reference for each image group.

[0073] For example: Figure 2 Image group GOP n The program clock reference is the Group of Pictures (GOP). n-1 The program clock reference at the end position, i.e., the group of pictures (GOP). n The program clock reference is PCR j+1 Image group GOP n+1 The program clock reference is the Group of Pictures (GOP). n The program clock reference at the end position, i.e., the group of pictures (GOP). n+1 The program clock reference is PCR k+1 .

[0074] In this invention, when the program clock references of two consecutive image groups meet preset conditions, the position between the two consecutive image groups is determined as the slice start position. Specifically, for example, the two consecutive image groups are GOPs. n and image group GOP n+1 Therefore, the group of images (GOP) can be determined. n The program clock reference is PCR j+1 Image group GOP n+1 The program clock reference is PCR k+1 When (PCR) j+1 / 2700 / Expected video length)! = (PCR k+1 When / 2700 / expected length is true, two consecutive images can be grouped into a GOP. n and image group GOP n+1 The middle position is determined as the starting position for slicing. In this invention, the expected slice length can be set according to actual needs, and this invention does not impose a specific limitation here.

[0075] It should be noted that, in this invention, when slicing multiple image groups, multiple slice start positions can be determined for the entire multiple image groups, such as start position 1, start position 2, and start position 3, etc. When slicing, slice start position 1 can be used as the slice start position of the first slice, slice start position 2 as the slice end position of the first slice, slice start position 3 as the slice start position of the second slice, and so on.

[0076] In this invention, the PCR information of the live stream received by multiple cache nodes is consistent. Therefore, according to the slicing method described above, the slice content generated by each cache node is mutually aligned. For example, slice 1 in cache node A is aligned with the slice 1 in cache node B, slice 2 in cache node A is aligned with the slice 2 in cache node B, and slice 3 in cache node A is aligned with the slice 3 in cache node B.

[0077] Step 102: Determine the slice names corresponding to the multiple slices according to their start times; the slice names corresponding to the multiple slices are aligned with each other in the multiple cache nodes.

[0078] In this embodiment of the invention, after slicing multiple image groups to obtain multiple slices, the multiple slices can be named according to their start times, thereby obtaining the name corresponding to each slice.

[0079] In one embodiment, determining the slice name corresponding to each of the multiple slices based on their start times may include: determining the time field corresponding to each of the multiple slices based on their start times; determining the program clock reference and display time corresponding to the start position; determining the hash value corresponding to each of the multiple slices based on the clock reference and display time; and determining the slice name corresponding to each of the multiple slices based on the time field and the hash value.

[0080] In this invention, slices can be named according to a preset format, for example, hour_hash.ts, where hour is the time field corresponding to the slice and hash is the hash value corresponding to the slice. To better illustrate this invention, we will take the naming of slices in one cache node as an example; the rules and methods for naming slices in other cache nodes are the same. For example, if the start time of a slice is obtained as 1715581200000, where the start time in this invention is based on the Unix system clock, in milliseconds, and rounded to an hourly granularity, then the time field corresponding to the slice can be determined as 1715581200000 / 1000 / 3600*3600, which is 1715580000. Then, the program time reference and display time corresponding to the starting position are determined. In this invention, the program time reference corresponding to the starting position is the program time reference for multiple image groups corresponding to the starting position, for example... Figure 2 The starting position S in i The corresponding program clock reference is the Group of Pictures (GOP). n+1 The corresponding program clock reference, i.e., S i The corresponding program clock reference is PCR k+1 In this invention, the hash value corresponding to the slice is calculated by concatenating the program clock reference and display time corresponding to the starting position with underscores as the key. For example, the starting position S... i The hash value of a slice is denoted as hash. i Then, relative to the starting position S i The corresponding slice is named 1715580000_hash i .ts. In this invention, since the content of multiple image groups in each cache node is the same, the content of the slices obtained by slicing according to the above slicing method is also aligned, and the hash values ​​calculated corresponding to the slices are also aligned.

[0081] It should be noted that both the program clock reference and the display time are cyclically increasing time series values. For example, the program clock reference is a 42-bit field divided into two parts: 33 bits are the base program clock reference, and 9 bits are the extension of the program clock reference. The maximum value is approximately 26.5 hours. When the program clock reference reaches its maximum value, it will start incrementing again from 0. The display time follows the same principle. As the live stream spans more time, the hash values ​​calculated in the above manner have a certain probability of collision. Therefore, to avoid collisions, this invention introduces a time parameter, namely the aforementioned time field, which reduces the possibility of naming collisions while ensuring slice naming alignment.

[0082] In this invention, the Program Clock Reference (PCR) is a clock signal used in digital video and audio transmission to synchronize the clock of the receiving end with the clock of the transmitting end. PCR is commonly used in MPEG-2 transport streams to ensure that the receiving device can accurately decode and play video and audio content. In an MPEG-2 transport stream, PCR is a 33-bit value consisting of two parts: PCR_base: This is a 33-bit integer representing the time since the start of the transport stream, based on a frequency of 90kHz. PCR_ext: This is a 9-bit extension based on a frequency of 27MHz, used to improve clock accuracy. The purpose of PCR is to maintain clock synchronization during transmission, especially in the presence of transmission delays and jitter. The receiving end can use PCR to adjust its local clock to ensure synchronized playback of video and audio. PCR is typically transmitted in specific packets (called PCR packets) within the transport stream, which are usually sent at regular time intervals (e.g., every 100 milliseconds) to ensure that the receiving end can update its clock reference in a timely manner. In summary, the Program Clock Reference (PCR) is a key element in digital video and audio transmission, used to ensure clock synchronization between the sender and receiver, thereby enabling high-quality audio and video playback.

[0083] Step 103: Determine the slice index and alias index corresponding to the slice name, respectively.

[0084] In this embodiment of the invention, after determining the slice names corresponding to multiple slices respectively, the slice index and alias index corresponding to the slice names can be determined respectively.

[0085] In this invention, due to factors such as network latency and process scheduling, the processing time of the same slice by different cache nodes may vary, typically in the millisecond range. However, for most slices, the start time is rounded down to the nearest hour, resulting in a consistent time field, and the names of the same slice are aligned across cache nodes. For a very small number of slices with start times close to the nearest hour, the processing time of different cache nodes may fluctuate around that hour. Following the hour-based rounding rule, the time field will be rounded to different hour points, leading to inconsistent slice names between cache nodes.

[0086] like Figure 3 The diagram illustrates a method for naming slices. Node A is cache node A, and node B is cache node B. Slice S is named in each of the two cache nodes. i and slice S j When naming, slice S iThe slice names obtained in cache node A and cache node B are the same, but slice S j The slice names obtained in cache node A and cache node B are different; cache node A names slice S. j The name is 1715580000_hash j .ts, cache node B for slice S j The name is 1715583600_hash j .ts. To prevent the terminal from being unable to determine the corresponding slice when switching cache nodes, this invention introduces slice indexes and alias indexes.

[0087] In one embodiment, determining the slice index and alias index corresponding to the slice name respectively includes: determining the slice index and alias index corresponding to the slice name respectively based on the start time of multiple slices and a preset naming rule.

[0088] In this invention, the slice index and alias index corresponding to each slice can be determined according to the start time of the slice and the preset naming rules.

[0089] In one embodiment, the preset naming rules include: a first naming rule and a second naming rule; determining the slice index and alias index corresponding to the slice name according to the start time of multiple slices and the preset naming rules respectively, including: when the start time of multiple slices is within a first preset time period, determining the slice index and alias index corresponding to the slice name according to the first naming rule; when the start time of multiple slices is within a second preset time period, determining the slice index and alias index corresponding to the slice name according to the second naming rule.

[0090] Specifically, the first naming rule is as follows: when the start time of a slice is between [3600000n-200, 3600000n), the slice index is 3600(n-1)_hash.ts, and the alias index is 3600n_hash.ts. The second naming rule is as follows: when the start time of a slice is between [3600000n, 3600000n+200], the slice index is 3600n_hash.ts, and the alias index is 3600(n-1)_hash.ts. For example, with... Figure 3 slice S in j For example, slice S j The slice index in cache node A is 1715580000_hash j The .ts file has an alias index of 1715583600_hash. j .ts, corresponding to slice S j The slice index in cache node B is 1715583600_hash.j .ts and alias index 1715580000_hash j .ts. In the naming rules above, 200 represents the maximum time difference of 200 milliseconds across different cache nodes. In this invention, both the slice index and the alias index can point to the same slice, thus establishing the relationship between slice indexes, alias indexes, and slices.

[0091] Step 104: When the terminal switches from the first cache node to the second cache node among the plurality of cache nodes to schedule a slice, the target slice in the second cache node is determined according to the slice index and alias index corresponding to the scheduled slice, and the target slice is returned to the terminal.

[0092] In this embodiment of the invention, after determining the slice index and alias index corresponding to the slice name respectively, when the terminal requests to schedule a slice in the first cache node, if the first cache node has an abnormal state, the terminal can switch the first cache node to the second cache node and continue to schedule the next slice. When switching the scheduling, the cache node can determine the target slice in the second cache node according to the corresponding slice index and alias index, and then return the target slice to the terminal.

[0093] Figure 4 The diagram illustrates a method for determining a target slice according to an embodiment of the present invention. The terminal sends a request 1715580000_hash to cache node A. j The terminal fails to access the cache node A due to a .ts slice request, but then cache node A experiences a node error. The terminal can switch to cache node B and send a request 1715580000_hash to cache node A. j When a slice request is made for a .ts file, cache node B can determine that the slice request corresponds to the alias index 1715580000_hash. j The .ts file can then be indexed by the alias 1715580000_hash. j The .ts file specifies the target slice 1715583600_hash. j This allows users on the corresponding terminal to seamlessly switch between devices without being aware of the process.

[0094] In this embodiment of the invention, multiple image groups are acquired, and each image group is sliced ​​to obtain multiple slices. Slice names are determined based on the start time of each slice. These slice names are aligned across multiple cache nodes. Slice indices and alias indices corresponding to the slice names are determined. When the terminal switches from a first cache node to a second cache node for slice scheduling, the target slice in the second cache node is determined based on the slice index and alias index corresponding to the scheduled slice, and the target slice is returned to the terminal. Therefore, after slicing, the slices are named according to their start time, ensuring alignment across multiple cache nodes. The use of slice indices and alias indices guarantees accurate identification of the target slice even when switching cache nodes during slice scheduling, preventing playback stuttering, frame skipping, and other issues.

[0095] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0096] Reference Figure 5 The diagram illustrates a structural block diagram of a slice alignment device provided in an embodiment of the present invention. The device is applied to a cache node; the cache node is connected to a terminal; the cache node comprises multiple cache nodes, and may specifically include the following modules:

[0097] The slicing module 501 is used to acquire multiple image groups and perform slicing processing on the multiple image groups respectively to obtain multiple slices;

[0098] The first determining module 502 is used to determine the slice names corresponding to the plurality of slices respectively according to the start time of the plurality of slices; the slice names corresponding to the plurality of slices are aligned with each other in the plurality of cache nodes;

[0099] The second determining module 503 is used to determine the slice index and alias index corresponding to the slice name, respectively.

[0100] The third determining module 504 is used to determine the target slice in the second cache node according to the slice index and alias index corresponding to the scheduled slice when the terminal switches from the first cache node to the second cache node among the plurality of cache nodes for slice scheduling, and return the target slice to the terminal.

[0101] In one embodiment, the slicing module 501 includes:

[0102] The first determining submodule is used to determine two consecutive image groups from the plurality of image groups respectively;

[0103] The slicing submodule is used to slice the multiple image groups based on the two consecutive image groups to obtain multiple slices.

[0104] In one embodiment, the slice submodule includes:

[0105] The first determining unit is used to determine the program clock reference for the two consecutive image groups respectively;

[0106] The second determining unit is used to determine the middle position of the two consecutive image groups as the slice start position when the program clock reference of the two consecutive image groups meets the preset conditions.

[0107] A slicing unit is used to slice the multiple image groups according to the slice starting position to obtain multiple slices.

[0108] In one embodiment, the first determining module 502 includes:

[0109] The second determining submodule is used to determine the time fields corresponding to the multiple slices respectively based on the start time of the multiple slices;

[0110] The third determining submodule is used to determine the program clock reference and display time corresponding to the starting position;

[0111] The fourth determining submodule is used to determine the hash values ​​corresponding to the plurality of slices respectively based on the clock reference and the display time;

[0112] The fifth determining submodule is used to determine the slice names corresponding to the multiple slices based on the time field and the hash value.

[0113] In one embodiment, the second determining module 503 includes:

[0114] The sixth determining submodule is used to determine the slice index and alias index corresponding to the slice name respectively, based on the start time of the multiple slices and the preset naming rules.

[0115] In one embodiment, the preset naming rules include: a first naming rule and a second naming rule; the seventh determining submodule includes:

[0116] The third determining unit is used to determine the slice index and alias index corresponding to the slice name respectively according to the first naming rule when the start time of the plurality of slices is within the first preset time period.

[0117] The fourth determining unit is used to determine the slice index and alias index corresponding to the slice name according to the second naming rule when the start time of the plurality of slices is within the second preset time period.

[0118] In one embodiment, the first determining unit includes:

[0119] The detection subunit is used to detect the program clock reference at the end position of each image group;

[0120] The first determining subunit is used to determine the program clock reference of the end position of the previous image group of each image group as the program clock reference of each image group.

[0121] The second determining subunit is used to determine the program clock references for the two consecutive image groups based on the program clock references for each image group.

[0122] In this embodiment of the invention, a slicing module is used to acquire multiple image groups and perform slicing processing on each image group to obtain multiple slices; a first determining module is used to determine the slice names corresponding to each of the multiple slices based on their start times; the slice names corresponding to the multiple slices are aligned with each other in multiple cache nodes; a second determining module is used to determine the slice index and alias index corresponding to each slice name; a third determining module is used to determine the target slice in the second cache node based on the slice index and alias index corresponding to the scheduled slice when the terminal switches from the first cache node to the second cache node for slice scheduling, and return the target slice to the terminal. Thus, after slicing, the slices are named according to their start times, ensuring that the slices are aligned with each other in multiple cache nodes. Then, by using the slice index and alias index corresponding to the slice names, it is ensured that when the terminal performs slice scheduling and switches cache nodes, the corresponding target slice can be accurately determined, avoiding problems such as playback stuttering and frame skipping.

[0123] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0124] This invention also provides an electronic device, comprising:

[0125] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described slice alignment method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0126] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described slice alignment method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0127] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0128] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0129] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0130] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0132] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.

[0133] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0134] The present invention has provided a detailed description of a slice alignment method, a slice alignment device, an electronic device, and a computer-readable storage medium. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, those skilled in the art will recognize that there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A slice alignment method, characterized in that, The method is applied to cache nodes; The cache node is connected to the terminal; The cache node comprises multiple cache nodes, and the method includes: Multiple image groups are acquired, and each image group is sliced ​​to obtain multiple slices; the slice contents of the multiple slices are aligned with each other in the multiple cache nodes. Based on the start time of each of the multiple slices, a slice name corresponding to each of the multiple slices is determined; the slice names corresponding to the multiple slices are aligned with each other in the multiple cache nodes. Determine the slice index and alias index corresponding to the slice name, respectively; When the terminal switches from the first cache node to the second cache node among the plurality of cache nodes to schedule a slice, the target slice in the second cache node is determined according to the slice index and alias index corresponding to the scheduled slice, and the target slice is returned to the terminal. The determination of the slice index and alias index corresponding to the slice name includes: Based on the start time of the multiple slices and the preset naming rules, determine the slice index and alias index corresponding to the slice names respectively.

2. The slice alignment method according to claim 1, characterized in that, The step of slicing the multiple image groups to obtain multiple slices includes: Two consecutive image groups are determined from the plurality of image groups respectively; Based on the two consecutive image groups, the multiple image groups are sliced ​​to obtain multiple slices.

3. The slice alignment method according to claim 2, characterized in that, The step of slicing the multiple image groups based on the two consecutive image groups to obtain multiple slices includes: Determine the program clock reference for each of the two consecutive image groups; When the program clock reference of the two consecutive image groups meets the preset conditions, the position between the two consecutive image groups is determined as the slice start position. The multiple image groups are sliced ​​according to the starting position of the slice to obtain multiple slices.

4. The slice alignment method according to claim 3, characterized in that, The step of determining the slice names corresponding to the plurality of slices based on their start times includes: Based on the start time of each of the multiple slices, determine the time field corresponding to each of the multiple slices; Determine the program clock reference and display time corresponding to the starting position; Based on the clock reference and display time, determine the hash values ​​corresponding to the plurality of slices respectively; Based on the time field and the hash value, determine the slice names corresponding to the plurality of slices respectively.

5. The slice alignment method according to claim 1, characterized in that, The preset naming rules include: a first naming rule and a second naming rule; determining the slice index and alias index corresponding to the slice names according to the start time of the plurality of slices and the preset naming rules respectively includes: When the start time of the plurality of slices is within a first preset time period, the slice index and alias index corresponding to the slice name are determined according to the first naming rule; When the start time of the multiple slices falls within the second preset time period, the slice index and alias index corresponding to the slice name are determined according to the second naming rule.

6. The slice alignment method according to claim 3, characterized in that, Determining the program clock reference for the two consecutive image groups includes: Detect the program clock reference at the end position of each image group; The program clock reference at the end position of the previous image group of each image group is determined as the program clock reference for each image group; Based on the program clock reference of each image group, the program clock references of the two consecutive image groups are determined respectively.

7. A slicing alignment device, characterized in that, The device is applied to the cache node; The cache node is connected to the terminal; The cache node comprises multiple cache nodes, and the device includes: The slicing module is used to acquire multiple image groups, slice each of the multiple image groups to obtain multiple slices; the slice contents of the multiple slices are aligned with each other in the multiple cache nodes. The first determining module is used to determine the slice names corresponding to the plurality of slices respectively based on the start time of the plurality of slices; the slice names corresponding to the plurality of slices are aligned with each other in the plurality of cache nodes; The second determining module is used to determine the slice index and alias index corresponding to the slice name, respectively. The third determining module is used to determine the target slice in the second cache node according to the slice index and alias index corresponding to the scheduled slice when the terminal switches from the first cache node to the second cache node among the plurality of cache nodes for slice scheduling, and return the target slice to the terminal. The second determining module includes: The sixth determining submodule is used to determine the slice index and alias index corresponding to the slice name respectively, based on the start time of the multiple slices and the preset naming rules.

8. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the slice alignment method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of the slice alignment method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • HLS slicing method and device supporting MPTS

    CN114401193A

  • Method and device for determining network slice in wireless communication system

    WO2023191460A1