Slice alignment method and device, electronic equipment and storage medium

By slicing multiple image groups in the live broadcast system and determining the slice naming according to the start time of the slice, the problem of video slice misalignment in distributed deployment scenarios is solved, and the alignment of slices and seamless switching of terminals is achieved, avoiding playback lags and frame skipping.

CN119729147AActive Publication Date: 2025-03-28CHINA TELECOM CLOUD TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In distributed deployment scenarios, due to factors such as network delay and process scheduling, it is impossible to ensure that the video slices output from different live cache interfaces are aligned, resulting in problems such as playback stuttering and frame skipping.

Method used

A slice alignment method is proposed. By acquiring multiple image groups, slicing them separately, and determining the slice naming according to the start time of the slice, so that the slices are aligned with each other in multiple cache nodes. At the same time, through slice index and alias index, we ensure that the terminal can accurately determine the target slice when switching cache nodes.

Benefits of technology

Slice alignment between multiple cache nodes is achieved, avoiding problems such as playback lag and frame skipping, and ensuring the stability and smoothness of live videos.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119729147A_ABST
    Figure CN119729147A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a slice alignment method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a plurality of image groups, and carrying out the slice processing of the plurality of image groups, and obtaining a plurality of slices; the slice contents of the plurality of slices are mutually aligned in the plurality of cache nodes respectively; according to the starting time of the multiple slices, slice names corresponding to the multiple slices are determined; the slice names corresponding to the plurality of slices are mutually aligned in the plurality of cache nodes; determining a slice index and an alias index respectively corresponding to the slice name; and when the terminal is switched from a first cache node in the plurality of cache nodes to a second cache node for slice scheduling, determining a target slice in the second cache node according to the slice index and the alias index corresponding to the scheduled slice, and returning the target slice to the terminal. Therefore, if the cache node is switched, the corresponding target slice can be accurately determined, and the problems of playing lagging, frame skipping and the like are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present 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 Art

[0002] With the development of communication technology, the live broadcast industry is becoming more and more mature. During live broadcast, the live broadcast server receives the live broadcast stream from the broadcast control party, transcodes and slices the live broadcast stream, divides the live broadcast stream into video segments of equal length, and then provides live broadcast services to the outside world through protocols such as HLS (HTTP Live Streaming) and DASH (Dynamic Adaptive Streaming over HTTP). When slicing, the existing technology generally refers to the Unix system clock for slicing, but in a distributed deployment scenario, due to factors such as network delay and process scheduling, it is impossible to predict the time when the live broadcast stream arrives at each live broadcast cache node. Therefore, it is impossible to ensure that the video slices output by different live broadcast cache interfaces are aligned, which will cause problems such as playback freezes and frame skipping. 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 device, an electronic device and a computer-readable storage medium that overcome the above problems or at least partially solve the above problems.

[0004] In order to solve the above problem, an embodiment of the present invention discloses a slice alignment method, which is applied to a cache node; the cache node is connected to a terminal; the cache node is a plurality of cache nodes, and the method includes:

[0005] Acquire multiple image groups, and perform slicing processing on the multiple image groups respectively to obtain multiple slices; slice contents of the multiple slices are respectively aligned with each other in the multiple cache nodes;

[0006] Determine slice names corresponding to the multiple slices respectively according to the start times of the multiple slices; the slice names corresponding to the multiple slices are aligned with each other in the multiple cache nodes;

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

[0008] When the terminal switches from the first cache node among the multiple cache nodes to the second cache node for slice scheduling, 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 slicing the multiple image groups according to the two consecutive image groups to obtain multiple slices includes:

[0010] respectively determining program clock references of the two consecutive groups of pictures;

[0011] When the program clock references of the two consecutive image groups meet a preset condition, a position between the two consecutive image groups is determined as a slice start position of the slice;

[0012] The plurality of image groups are sliced ​​according to the slice starting positions to obtain a plurality of slices.

[0013] Optionally, determining slice names corresponding to the multiple slices respectively according to the start times of the multiple slices includes:

[0014] Determine, according to the start times of the multiple slices, time fields corresponding to the multiple slices respectively;

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

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

[0017] According to the time field and the hash value, slice names respectively corresponding to the multiple slices are determined.

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

[0019] According to the start time of the multiple slices and the preset naming rules, the slice index and the alias index corresponding to the slice names are determined respectively.

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

[0021] When the start time of the plurality of slices is within a first preset time period, determining a slice index and an alias index respectively corresponding to the slice names according to the first naming rule;

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

[0023] Optionally, respectively determining program clock references of the two consecutive image groups includes:

[0024] A program clock reference for detecting the end position of each group of pictures;

[0025] 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;

[0026] The program clock references of the two consecutive groups of images are determined respectively according to the program clock reference of each group of images.

[0027] The embodiment of the present invention further discloses a slice alignment device, which is applied to a cache node; the cache node is connected to a terminal; the cache node is a plurality of cache nodes, and the device comprises:

[0028] A slicing module, used to obtain a plurality of image groups, and perform slicing processing on the plurality of image groups respectively to obtain a plurality of slices; the slice contents of the plurality of slices are respectively aligned with each other in the plurality of cache nodes;

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

[0030] A second determination module is used to determine a slice index and an alias index respectively corresponding to the slice name;

[0031] The third determination 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 among the multiple cache nodes to the second cache node for slice scheduling, and return the target slice to the terminal.

[0032] Optionally, the slicing module includes:

[0033] A first determining submodule, configured to determine two consecutive image groups from the plurality of image groups respectively;

[0034] The slicing submodule is used to perform slicing processing on the multiple image groups according to the two consecutive image groups to obtain multiple slices.

[0035] Optionally, the slicing submodule includes:

[0036] A first determining unit, configured to respectively determine program clock references of the two consecutive image groups;

[0037] A second determining unit is configured to determine a position between the two consecutive image groups as a slice start position of the slice when the program clock reference of the two consecutive image groups meets a preset condition;

[0038] A slicing unit is used to perform slicing processing on the multiple image groups according to the slicing starting positions to obtain multiple slices.

[0039] Optionally, the first determining module includes:

[0040] A second determining submodule, configured to determine time fields corresponding to the plurality of slices respectively according to the start times of the plurality of slices;

[0041] A third determination submodule, used to determine a program clock reference and a display time corresponding to the starting position;

[0042] a fourth determination submodule, configured to determine hash values ​​respectively corresponding to the plurality of slices according to the clock reference and the display time;

[0043] The fifth determination submodule is used to determine the slice names corresponding to the multiple slices respectively according to the time field and the hash value.

[0044] Optionally, the second determining module includes:

[0045] The sixth determination submodule is used to determine the slice index and alias index corresponding to the slice names respectively according to the start time of the multiple slices and the preset naming rules.

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

[0047] A third determining unit, configured to determine, when the start time of the plurality of slices is within a first preset time period, slice indexes and alias indexes respectively corresponding to the slice names according to the first naming rule;

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

[0049] Optionally, the first determining unit includes:

[0050] a detection subunit, for detecting a program clock reference of an end position of each picture group;

[0051] A first determining subunit, configured 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 of the two consecutive image groups respectively according to the program clock reference of each image group.

[0053] The present invention also discloses a device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the slice alignment method as described above when executing the computer program.

[0054] The present invention also discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the slice alignment method as described above are implemented.

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

[0056] In an embodiment of the present invention, a plurality of image groups are first acquired, and slice processing is performed on the plurality of image groups respectively to obtain a plurality of slices. Then, slice names corresponding to the plurality of slices are determined respectively according to the start times of the plurality of slices, wherein the slice names corresponding to the plurality of slices are aligned with each other in a plurality of cache nodes. Then, slice indexes and alias indexes corresponding to the slice names are determined. When a terminal switches from a first cache node to a second cache node among the plurality of cache nodes to schedule slices, a 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. Thus, when slicing, the slices are named according to the start time of the slices, so that the slices are aligned with each other in the plurality of cache nodes. Then, through 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 to avoid problems such as playback freeze and frame skipping. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 is a flow chart of the steps of a slice alignment method provided by an embodiment of the present invention;

[0058] Figure 2 is a slicing schematic diagram provided by an embodiment of the present invention;

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

[0060] Figure 4 is a schematic diagram of determining a target slice provided by an embodiment of the present invention;

[0061] Figure 5 It is a structural block diagram of a slice alignment device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0062] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0063] In the prior art, when slicing, it is impossible to ensure that the video slices output by different live cache interfaces are aligned, and problems such as playback jamming and frame skipping may occur. In order to solve the above technical problems, the present invention proposes a slice alignment method, firstly obtains multiple image groups, slices the multiple image groups respectively, obtains multiple slices, and then determines the slice names corresponding to the multiple slices respectively according to the start time of the multiple slices, wherein the slice names corresponding to the multiple slices are mutually aligned in multiple cache nodes, and then determines the slice index and alias index corresponding to the slice name respectively, when the terminal switches from the first cache node of the multiple cache nodes to the second cache node for slicing scheduling, according to the slice index and alias index corresponding to the scheduled slice, determines the target slice in the second cache node, and returns the target slice to the terminal, so that after slicing, the slice is named according to the start time of the slice, so that the slices are mutually aligned in multiple cache nodes, and then through 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 to avoid problems such as playback jamming and frame skipping.

[0064] Reference Figure 1 , shows 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 is a plurality of cache nodes, and the method may specifically include the following steps:

[0065] Step 101 : acquiring a plurality of image groups, and performing slicing processing on the plurality of image groups respectively to obtain a plurality of slices.

[0066] In the embodiment of the present invention, when live broadcasting is being performed, multiple cache nodes can simultaneously obtain the live broadcast code stream of the live broadcast, so that the multiple cache nodes can obtain multiple image groups, and the image groups obtained by each cache node are the same. After obtaining the multiple image groups, each cache node can slice the multiple image groups to obtain multiple slices. Figure 2 As shown, a slicing schematic diagram provided by an embodiment of the present invention is shown. Figure 2 GOP0 to GOP n+1 In the example, each GOP is a group of continuous images, and each of the multiple cache nodes can store GOP0 to GOP n+1Slice processing is performed to obtain multiple slices. In the present invention, when slicing multiple image groups, it depends on the live stream itself and is not affected by factors such as network delay. Therefore, the slice contents of multiple slices are aligned in multiple cache nodes respectively.

[0067] In the present invention, a GOP is usually composed 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 that does not depend on other frames. It contains complete image information and can be decoded separately. 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 the previous I frame or P frame. A P frame only encodes the difference from the previous frame, so its data volume is usually smaller than that of an I frame. A P frame can improve compression efficiency, but requires complete information from the previous frame to decode. B frame (Bidirectional Predictive-coded Frame): A B frame is a bidirectional predictive-coded frame that depends on the previous I frame or P frame and the following P frame or I frame. A B frame encodes the difference from the previous and next frames, so its data volume is usually smaller than that of a P frame. B frames can further improve compression efficiency, but more reference frame information is required for decoding. The structure and length of a GOP (i.e., the number of frames contained in a GOP) have an important impact on the compression efficiency and playback quality of a video. A shorter GOP can provide better random access capabilities (such as fast forward and fast rewind), but may reduce compression efficiency. A longer GOP can improve compression efficiency, but may affect random access performance. In practical applications, the structure and length of GOP are usually adjusted according to specific application scenarios and requirements. For example, in real-time video transmission, a shorter GOP may be used to ensure low latency and good random access performance; while in storage and streaming applications, a longer GOP may be used to improve compression efficiency.

[0068] In one embodiment, slicing is performed on multiple image groups respectively to obtain multiple slices, which includes: determining two consecutive image groups from the multiple image groups respectively; and slicing is performed on the multiple image groups according to the two consecutive image groups to obtain multiple slices.

[0069] Specifically, each cache node determines two consecutive image groups from multiple image groups in the cache node to which it belongs. 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 in cache node 1, and 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 in cache node 2. Then, each cache node can perform slicing processing on multiple image groups in the cache node to which it belongs according to the two consecutive image groups to obtain multiple slices. For example, cache node 1 can perform slicing processing on multiple image groups in cache node 1 according to two consecutive image groups in cache node 1 to obtain multiple slices in cache node 1, and cache node 2 can perform slicing processing on multiple image groups in cache node 2 according to two consecutive image groups in cache node 2 to obtain multiple slices in cache node 2.

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

[0071] Specifically, the present invention is described with one cache node, and the slicing rules or methods performed by each cache node are the same, so each cache node will not be described one by one. Figure 2 , Figure 2 PCR is the program clock reference in each picture group, PCR i , PCR i+1 To PCR j+1 GOP n-1 Program Time Reference, PCR j+2 To PCR k and PCR k+1 GOP n After determining the program clock references of two consecutive image groups, it can be determined whether the program clock references of the two consecutive image groups meet the preset conditions. When the program clock references of the two consecutive image groups meet the preset conditions, the position between the two consecutive image groups can be determined as the slice start position of the slice. For example, the two consecutive image groups are GOP. n and GOP n+1 , determine GOP n and GOP n+1If the clock references of these two consecutive groups of images meet the preset conditions, GOP n and GOP n+1 The middle position is determined as the slice starting position of the slice, that is, Figure 2 S i The position is taken as the slice start position of the slice, and then the next start position is determined according to the program time reference of two consecutive image groups, and so on, and then the multiple image groups are sliced ​​according to the slice start position to obtain multiple slices.

[0072] In one embodiment, respectively determining program clock references for two consecutive image groups may include: detecting the program clock reference of the end position of each image group; determining 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; and respectively determining the program clock references of the two consecutive image groups based on the program clock reference of each image group.

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

[0074] In the present invention, when the program clock references of two consecutive image groups meet the preset conditions, the position between the two consecutive image groups is determined as the slice start position of the slice. Specifically, for example, the two consecutive image groups are GOP n and Group of Pictures GOP n+1 , then the picture group GOP can be determined n The program clock reference is PCR j+1 , Group of Pictures GOP n+1 The program clock reference is PCR k+1 When (PCR j+1 / 2700 / expected length)! =(PCR k+1 / 2700 / expected length) is established, two consecutive pictures can be grouped into a GOP n and Group of Pictures GOP n+1 The middle position is determined as the slice start position of the slice. In the present invention, the expected slice length can be set according to actual needs, and the present invention does not make any specific limitation here.

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

[0076] In the present invention, the PCR information of the live stream received by multiple cache nodes is consistent, so according to the above-mentioned slicing method, the slice contents generated by each cache node are aligned with each other. For example: the slice 1 in cache node A is aligned with the slice content of slice 1 in cache node B, the slice 2 in cache node A is aligned with the slice content of slice 2 in cache node B, and the slice 3 in cache node A is aligned with the slice content of slice 3 in cache node B.

[0077] Step 102: determine slice names corresponding to the multiple slices respectively according to the start time of the multiple slices; the slice names corresponding to the multiple slices are aligned with each other in the multiple cache nodes.

[0078] In the embodiment of the present invention, after slicing multiple image groups to obtain multiple slices, the multiple slices may be named respectively according to the start time of the multiple slices, thereby obtaining a name corresponding to each slice.

[0079] In one embodiment, determining slice names corresponding to the multiple slices respectively according to the start times of the multiple slices may include: determining time fields corresponding to the multiple slices respectively according to the start times of the multiple slices; determining a program clock reference and a display time corresponding to the start position; determining hash values ​​corresponding to the multiple slices respectively according to the clock reference and the display time; and determining slice names corresponding to the multiple slices respectively according to the time field and the hash value.

[0080] In the present invention, slice naming can be performed according to a preset format. For example, the preset format is: hour_hash.ts, where hour is the time field corresponding to the slice, and hash is the hash value corresponding to the slice. In order to better illustrate the present invention, a slice in a cache node is used as an example to determine the slice naming. The rules and methods for determining slice naming in other cache nodes are the same. For example, the start time of the slice is obtained as 1715581200000, wherein the start time of the present invention is based on the Unix system clock, the unit is milliseconds, and the value is obtained after regularization with hours as the granularity. Then it can be determined that the time field corresponding to the slice is 1715581200000 / 1000 / 3600*3600, that is, 1715580000. Then determine the program time reference and display time corresponding to the starting position. The program time reference corresponding to the starting position in the present invention is the program time reference of multiple image groups corresponding to the starting position. For example, Figure 2 The starting position S i The corresponding program clock reference is the picture group GOP n+1 The corresponding program clock reference, that is, S i The corresponding program clock reference is PCR k+1 In the present invention, the hash value corresponding to the slice is the value calculated by concatenating the program clock reference and display time corresponding to the starting position with an underscore as the key. For example, the starting position S i The hash value of the slice is recorded as hash i , then with the starting position S i The corresponding slice is named 1715580000_hash i In the present invention, since the contents of the multiple image groups in each cache node are the same, the contents of the slices obtained by slicing in the above slicing manner are also aligned, and the calculated hash values ​​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, of which 33 bits are the program clock reference base and 9 bits are the extension of the program clock reference. The maximum value is about 26.5 hours. When the program clock reference reaches the maximum value, it will start counting from 0 again, and the display time is the same. As the live stream spans longer time, the hash value calculated in the above manner has a certain collision probability. Therefore, in order to avoid the collision probability, the present invention introduces a time parameter, that is, the above-mentioned time field, which reduces the possibility of naming collision while ensuring the alignment of slice naming.

[0082] In the present invention, a 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 sending end. PCR is usually used in MPEG-2 transport streams to ensure that the receiving device can accurately decode and play video and audio content. In MPEG-2 transport streams, PCR is a 33-bit value, which includes two parts: PCR_base: This is a 33-bit integer representing the time since the beginning of the transport stream, with a frequency of 90kHz as the reference. PCR_ext: This is a 9-bit extension part, with a frequency of 27MHz as the reference, used to improve the accuracy of the clock. The purpose of PCR is to keep the clock synchronized during transmission, especially in the presence of transmission delays and jitter. The receiving end can use PCR to adjust its local clock to ensure synchronous playback of video and audio. PCR is usually transmitted in specific packets (called PCR packets) in the transport stream, which are usually sent at regular intervals (for example, every 100 milliseconds) to ensure that the receiving end can update its clock reference in time. 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 the receiver, thereby achieving high-quality audio and video playback.

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

[0084] In the embodiment of the present invention, after determining the slice names respectively corresponding to the plurality of slices, the slice indexes and alias indexes respectively corresponding to the slice names may be determined.

[0085] In the present invention, due to factors such as network delay and process scheduling, the time for different cache nodes to process the same slice will deviate, and the deviation value is generally in the millisecond level. However, for most slices, the start time of the slice is rounded down according to the hourly granularity, and the obtained time field is consistent, and the same slice naming is aligned between cache nodes. For a very small number of slices whose start time is close to the hourly integer point, the processing time of different cache nodes may fluctuate around the hourly integer point. According to the hourly granularity rounding rule, the time field will be regularized to different hourly points, which will lead to inconsistent slice naming between cache nodes.

[0086] like Figure 3 As shown, a schematic diagram of slice naming is shown, node A is cache node A, node B is cache node B, and in the two cache nodes, slice S is respectively 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 has different names for slice S. j The name is 1715580000_hash j .ts, cache node B for slice S j The name is 1715583600_hash j In order to avoid the terminal being unable to determine the corresponding slice when switching cache nodes, the present invention introduces a slice index and an alias index.

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

[0088] In the present 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 rule.

[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 naming respectively according to the start time of multiple slices and the preset naming rules, including: when the start time of multiple slices is within the first preset time period, determining the slice index and alias index corresponding to the slice naming respectively according to the first naming rule; when the start time of multiple slices is within the second preset time period, determining the slice index and alias index corresponding to the slice naming respectively according to the second naming rule.

[0090] Specifically, the first naming rule is as follows: when the start time of the 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 the slice is between [3600000n, 3600000n+200], the slice index is 3600n_hash.ts, and the alias index is 3600(n-1)_hash.ts. Figure 3 Slice S in j For example, slice S j The slice index in cache node A is 1715580000_hash j .ts, alias index is 1715583600_hash j .ts, corresponding to the slice S j The slice index in cache node B is 1715583600_hashj .ts and alias index 1715580000_hash j .ts. The 200 in the above naming rule refers to the maximum time difference of 200 milliseconds in different cache nodes. In the present invention, the slice index and the alias index can point to the same slice, that is, the slice index and the alias index, as well as the relationship between the slices can be established.

[0091] Step 104, when the terminal switches from the first cache node among the multiple cache nodes to the second cache node for slice scheduling, 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 an embodiment of the present invention, after determining the slice index and alias index corresponding to the slice name respectively, when the terminal requests to schedule the slice in the first cache node, when the first cache node has an abnormal state, at this time, the terminal can switch the first cache node to the second cache node and continue to schedule the next slice. When performing switching 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 FIG. 1 is a schematic diagram showing 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 .ts slice request, and at this time cache node A has a node exception, the terminal access fails, the terminal can switch to cache node B and send a request 1715580000_hash to cache node A j .ts slice request, at this time, cache node B can determine that the slice request corresponds to the alias index 1715580000_hash j .ts, and then you can index 1715580000_hash according to the alias j .ts, determine the target slice 1715583600_hash j .ts, so that the corresponding terminal users can achieve seamless switching without any perception.

[0094] In the embodiment of the present invention, multiple image groups are obtained, and slice processing is performed on the multiple image groups respectively to obtain multiple slices; slice names corresponding to the multiple slices are determined respectively according to the start time of the multiple slices; the slice names corresponding to the multiple slices are aligned with each other in multiple cache nodes; slice indexes and alias indexes corresponding to the slice names are determined; when the terminal switches from the first cache node to the second cache node among the multiple cache nodes to schedule the slices, 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. Therefore, after slicing, the slices are named according to the start time of the slices, so that the slices are aligned with each other in multiple cache nodes, and then the slice index and alias index corresponding to the slice name are used to ensure that when the terminal performs slice scheduling, if the cache node is switched, the corresponding target slice can be accurately determined to avoid problems such as playback freeze and frame skipping.

[0095] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0096] Reference Figure 5 , shows a structural block diagram of a slice alignment device provided by 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 is a plurality of cache nodes, and specifically may include the following modules:

[0097] A slicing module 501 is used to obtain a plurality of image groups, and perform slicing processing on the plurality of image groups respectively to obtain a plurality of slices;

[0098] A first determining module 502 is configured to determine slice names corresponding to the plurality of slices respectively according to the start times 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] A second determination module 503 is used to determine a slice index and an alias index respectively corresponding to the slice name;

[0100] The third determination 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 among the multiple cache nodes to the second cache node for slice scheduling, and return the target slice to the terminal.

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

[0102] A first determining submodule, configured to determine two consecutive image groups from the plurality of image groups respectively;

[0103] The slicing submodule is used to perform slicing processing on the multiple image groups according to the two consecutive image groups to obtain multiple slices.

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

[0105] A first determining unit, configured to respectively determine program clock references of the two consecutive image groups;

[0106] A second determining unit is configured to determine a position between the two consecutive image groups as a slice start position of the slice when the program clock reference of the two consecutive image groups meets a preset condition;

[0107] A slicing unit is used to perform slicing processing on the multiple image groups according to the slicing starting positions to obtain multiple slices.

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

[0109] A second determining submodule, configured to determine time fields corresponding to the plurality of slices respectively according to the start times of the plurality of slices;

[0110] A third determination submodule, used to determine a program clock reference and a display time corresponding to the starting position;

[0111] a fourth determination submodule, configured to determine hash values ​​respectively corresponding to the plurality of slices according to the clock reference and the display time;

[0112] The fifth determination submodule is used to determine the slice names corresponding to the multiple slices respectively according to the time field and the hash value.

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

[0114] The sixth determination submodule is used to determine the slice index and alias index corresponding to the slice names respectively according to the start time of the multiple slices and the preset naming rules.

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

[0116] A third determining unit, configured to determine, when the start time of the plurality of slices is within a first preset time period, slice indexes and alias indexes respectively corresponding to the slice names according to the first naming rule;

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

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

[0119] a detection subunit, for detecting a program clock reference of an end position of each picture group;

[0120] A first determining subunit, configured 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 of the two consecutive image groups respectively according to the program clock reference of each image group.

[0122] In the embodiment of the present invention, a slicing module is used to obtain multiple image groups, and slice the multiple image groups respectively to obtain multiple slices; a first determination module is used to determine the slice names corresponding to the multiple slices respectively according to the start time of the multiple slices; the slice names corresponding to the multiple slices are aligned with each other in multiple cache nodes; a second determination module is used to determine the slice index and alias index corresponding to the slice names respectively; a third determination 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 multiple cache nodes to schedule the slice, and return the target slice to the terminal. Therefore, after slicing, the slices are named according to the start time of the slices, so that the slices are aligned with each other in multiple cache nodes, and then the slice index and alias index corresponding to the slice name are used to ensure that when the terminal performs slice scheduling, if the cache node is switched, the corresponding target slice can be accurately determined to avoid problems such as playback freeze and frame skipping.

[0123] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0124] An embodiment of the present invention further provides an electronic device, including:

[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, each process of the above-mentioned slice alignment method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0126] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned slice alignment method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

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

[0128] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product 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 codes.

[0129] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0130] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A 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 device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0132] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0133] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0134] The slice alignment method, slice alignment device, electronic device and computer-readable storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principle and implementation mode of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A slice alignment method, characterized in that: The method is applied to a cache node; The cache node is connected to the terminal; The cache node is a plurality of cache nodes, and the method includes: Acquire multiple image groups, and perform slicing processing on the multiple image groups respectively to obtain multiple slices; slice contents of the multiple slices are respectively aligned with each other in the multiple cache nodes; Determine slice names corresponding to the multiple slices respectively according to the start times of the multiple slices; the slice names corresponding to the multiple slices are aligned with each other in the multiple cache nodes; Determine a slice index and an alias index corresponding to the slice name respectively; When the terminal switches from the first cache node among the multiple cache nodes to the second cache node for slice scheduling, 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.

2. The slice alignment method according to claim 1, characterized in that: The step of performing slicing processing on the plurality of image groups respectively to obtain a plurality of slices comprises: determining two consecutive image groups from the plurality of image groups respectively; According to 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 plurality of image groups according to the two consecutive image groups to obtain a plurality of slices comprises: respectively determining program clock references of the two consecutive groups of pictures; When the program clock references of the two consecutive image groups meet a preset condition, a position between the two consecutive image groups is determined as a slice start position of the slice; The plurality of image groups are sliced ​​according to the slice starting positions to obtain a plurality of slices.

4. The slice alignment method according to claim 3, characterized in that: The determining, according to the start times of the plurality of slices, slice names corresponding to the plurality of slices respectively includes: Determine, according to the start times of the multiple slices, time fields corresponding to the multiple slices respectively; determining a program clock reference and a display time corresponding to the starting position; Determine, according to the clock reference and the display time, hash values ​​corresponding to the plurality of slices respectively; According to the time field and the hash value, slice names respectively corresponding to the multiple slices are determined.

5. The slice alignment method according to claim 1, characterized in that: The determining of the slice index and the alias index respectively corresponding to the slice name includes: According to the start time of the multiple slices and the preset naming rules, the slice index and the alias index corresponding to the slice names are determined respectively.

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

7. The slice alignment method according to claim 3, characterized in that: The respectively determining the program clock references of the two consecutive image groups comprises: A program clock reference for detecting the end position of each group of pictures; 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; The program clock references of the two consecutive groups of images are determined respectively according to the program clock reference of each group of images.

8. A slice alignment device, characterized in that: The device is applied to a cache node; The cache node is connected to the terminal; The cache node is a plurality of cache nodes, and the device comprises: A slicing module, used to obtain a plurality of image groups, and perform slicing processing on the plurality of image groups respectively to obtain a plurality of slices; the slice contents of the plurality of slices are respectively aligned with each other in the plurality of cache nodes; A first determining module is used to determine slice names corresponding to the multiple slices respectively according to the start time of the multiple slices; the slice names corresponding to the multiple slices are aligned with each other in the multiple cache nodes; A second determination module is used to determine a slice index and an alias index respectively corresponding to the slice name; The third determination 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 among the multiple cache nodes to the second cache node for slice scheduling, and return the target slice to the terminal.

9. 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 when the computer program is executed by the processor, the steps of the slice alignment method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the slice alignment method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Media data slicing method and system and storage medium

    CN111182331A

  • HLS slicing method and device supporting MPTS

    CN114401193A

  • Video frame alignment in adaptive bitrate streaming

    US9462270B1

  • System and method for providing fault tolerant streaming of segmented content and cache coherency on multi-hosted origin systems

    WO2019023533A1

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

    WO2023191460A1