Shuffling method and computing device

By dividing data blocks into shuffling groups and units in the master-slave processor architecture of the SOC, and performing output and input shuffling processing, the problem of high encoding and decoding rates in the SOC is solved and the encoding and decoding efficiency is improved.

CN112631596BActive Publication Date: 2024-09-10ANHUI CAMBRICON INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910954865.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-10-09
Publication Date
2024-09-10
Estimated Expiration
2040-02-24

AI Technical Summary

Technical Problem

The encoding and decoding rate in the data encoding and decoding process in SOC is high, resulting in low efficiency, and the encoding and decoding rate needs to be reduced.

Method used

In the master-slave processor architecture, by receiving the encoding or decoding microinstructions sent by the master processor, the data block is divided into multiple shuffling groups and units according to the shuffling level, and the data is encoded or decoded through the output and input shuffling units. , ensuring that the length of the encoded streams is similar to avoid excessive complements and deadlocks caused by alignment requirements.

Benefits of technology

The encoding and decoding rate is reduced, the encoding and decoding efficiency is improved, the alignment problem between encoding streams is avoided, and the processing efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112631596B
    Figure CN112631596B
Patent Text Reader

Abstract

The present application relates to a shuffling method and a computing device. The method comprises: receiving a coding broadcast microinstruction sent by a master processor; if the coding broadcast microinstruction does not carry an identifier of a target slave processor, or the identifier of the first slave processor is included in at least one identifier of a target slave processor carried by the coding broadcast microinstruction, the first slave processor determines at least one first shuffling group corresponding to a data block to be encoded according to a first shuffling level, the first shuffling group includes multiple first shuffling units, and the first shuffling unit includes at least one coding stream; determining the coding length of each first shuffling unit; determining an output shuffling unit and an input shuffling unit in each first shuffling unit according to the coding length of each first shuffling unit; sending a first preset number of stream blocks to be shuffled in the output shuffling unit to the input shuffling unit as the first stream block to be coded in the input shuffling unit, so as to encode the first stream block to be coded by the input shuffling unit according to a preset coding algorithm. The present application can reduce the coding rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a shuffling method and a computing device. Background Art

[0002] At present, in the process of encoding and decoding data in SOC (System on a Chip), data padding is required, which leads to a high encoding and decoding rate. Therefore, a solution that can reduce the encoding and decoding rate is urgently needed. Summary of the invention

[0003] Based on this, it is necessary to provide a shuffling method and a computing device to address the above technical issues.

[0004] In a first aspect, a shuffling method is provided, the method being applied to a first slave processor in a master-slave processor architecture, the method comprising:

[0005] receiving encoded broadcast microinstructions sent by the host processor;

[0006] If the encoding broadcast microinstruction does not carry the identifier of the target slave processor, or the identifier of the first slave processor is included in at least one identifier of the target slave processor carried by the encoding broadcast microinstruction, the first slave processor determines, according to the first shuffling level, at least one first shuffling group corresponding to the to-be-encoded data block, the first shuffling group includes a plurality of first shuffling units, and the first shuffling unit includes at least one encoding stream;

[0007] Determining the code length of each first shuffle unit;

[0008] According to the code length of each of the first shuffling units, determining an output shuffling unit and an input shuffling unit in each of the first shuffling units;

[0009] A first preset number of to-be-shuffled stream blocks in the output shuffling unit are sent to the input shuffling unit as first to-be-encoded stream blocks in the input shuffling unit, so that the first to-be-encoded stream blocks are encoded by the input shuffling unit according to a preset encoding algorithm.

[0010] In a second aspect, a shuffling method is provided, the method being applied to a first slave processor in a master-slave processor architecture, the method comprising:

[0011] receiving decoded broadcast microinstructions sent by the host processor;

[0012] If the decoding broadcast microinstruction does not carry the identifier of the target slave processor, or the identifier of the first slave processor is included in at least one identifier of the target slave processor carried by the encoding broadcast microinstruction, the first slave processor determines, according to the first shuffling level, at least one first shuffling group corresponding to the to-be-decoded data block, the first shuffling group includes a plurality of first shuffling units, and the first shuffling unit includes at least one decoding stream;

[0013] Determining the code length of each first shuffle unit;

[0014] According to the code length of each of the first shuffling units, determining an output shuffling unit and an input shuffling unit in each of the first shuffling units;

[0015] A first preset number of to-be-shuffled stream blocks in the output shuffling unit are sent to the input shuffling unit as first to-be-decoded stream blocks in the input shuffling unit, so that the first to-be-decoded stream blocks are decoded by the input shuffling unit according to a preset decoding algorithm.

[0016] In a third aspect, a computing device is provided, comprising: a master processor and a plurality of slave processors connected to the master processor;

[0017] The master processor is used to receive source data and send the source data to the multiple slave processors;

[0018] The multiple slave processors are used to encode the to-be-encoded data blocks corresponding to the encoding broadcast microinstructions according to the encoding broadcast microinstructions using the method described in any one of the first aspects to obtain encoded data blocks, and transmit the encoded data blocks to the master processor;

[0019] The main processor is further used to determine the coded data corresponding to the source data according to each coded data block.

[0020] As an optional implementation, the computing device further includes a branch processor located between the main processor and the slave processor.

[0021] The branch processor is used for data forwarding between the main processor and the slave processor.

[0022] As an optional implementation, the master processor includes a control module and a master on-chip storage module, and the slave processor includes a computing module;

[0023] The control module is used to decode the machine instructions received by the master processor into coded broadcast microinstructions, use the coded broadcast microinstructions to control the slave processor to perform operations according to the source data in the master on-chip storage module, and write the data into the off-chip storage module;

[0024] The control module includes an encoding unit, and the encoding unit is used to execute the encoded broadcast microinstruction.

[0025] As an optional implementation, the master processor includes a control module, and the slave processor includes a computing module and a slave on-chip storage module.

[0026] The control module is used to decode the machine instructions received by the master processor into coded broadcast microinstructions, use the coded broadcast microinstructions to control the slave processor to perform operations according to the source data in the slave on-chip storage module, and write the data into the off-chip storage module;

[0027] The control module includes an encoding unit, and the encoding unit is used to execute the encoded broadcast microinstruction.

[0028] As an optional implementation, the master processor is further configured to send the encoding broadcast microinstruction to the slave processor to instruct the slave processor to execute an encoding process.

[0029] In a fourth aspect, a computing device is provided, comprising: a master processor and a plurality of slave processors connected to the master processor;

[0030] The master processor is configured to receive the encoded data and send the encoded data to the plurality of slave processors;

[0031] The multiple slave processors are used to decode the to-be-decoded data blocks corresponding to the decoded broadcast microinstructions using the method described in any one of the second aspects according to the decoded broadcast microinstructions to obtain decoded data blocks, and transmit the decoded data blocks to the master processor;

[0032] The main processor is further used to determine source data corresponding to the encoded data according to each decoded data block.

[0033] As an optional implementation, the computing device further includes a branch processor located between the main processor and the slave processor.

[0034] The branch processor is used for data forwarding between the main processor and the slave processor.

[0035] As an optional implementation, the master processor includes a control module and a master on-chip storage module, and the slave processor includes a computing module;

[0036] The control module is used to decode the machine instructions received by the master processor into decoded broadcast microinstructions, use the decoded broadcast microinstructions to control the slave processor to perform operations according to the encoded data in the master on-chip storage module, and write the encoded data into the off-chip storage module;

[0037] The control module includes a decoding unit, and the decoding unit is used to execute the decoded broadcast microinstruction.

[0038] As an optional implementation, the master processor includes a control module, and the slave processor includes a computing module and a slave on-chip storage module.

[0039] The control module is used to decode the machine instructions received by the master processor into decoded broadcast microinstructions, and use the decoded broadcast microinstructions to control the slave processor to perform operations according to the encoded data in the slave on-chip storage module, and write the encoded data into the off-chip storage module;

[0040] The control module includes a decoding unit, and the decoding unit is used to execute the decoded broadcast microinstruction.

[0041] As an optional implementation, the master processor is further configured to send the decoding broadcast microinstruction to the slave processor to instruct the slave processor to execute a decoding process.

[0042] The embodiment of the present application provides a shuffling method and a computing device. A first slave processor receives a coding broadcast microinstruction sent by a master processor. If the coding broadcast microinstruction does not carry an identifier of a target slave processor, or if the identifier of a first slave processor is included in at least one identifier of a target slave processor carried by the coding broadcast microinstruction, the first slave processor determines at least one first shuffling group corresponding to a data block to be encoded according to a first shuffling level. The first shuffling group includes a plurality of first shuffling units, and the first shuffling unit includes at least one coding stream. Then, the first slave processor determines the coding length of each first shuffling unit, and determines an output shuffling unit and an input shuffling unit in each first shuffling unit according to the coding length of each first shuffling unit. Afterwards, the first slave processor sends a first preset number of stream blocks to be shuffled in the output shuffling unit to the input shuffling unit as the first stream block to be encoded in the input shuffling unit, so that the first stream block to be encoded is encoded by the input shuffling unit according to a preset coding algorithm. In this way, by shuffling the coding streams of the coded data blocks, the coding lengths of the coding streams can be guaranteed to be similar, thereby avoiding excessive complements due to the alignment requirements between the coding streams, thereby reducing the coding rate. At the same time, deadlock between the coding streams can also be avoided. In addition, for different coding broadcast microinstructions, the main processor can send different coding broadcast microinstructions to different slave processor groups including multiple slave processors, and each slave processor group only performs coding processing on the source data blocks in the coding area corresponding to the received coding broadcast microinstruction, so that multiple slave processor groups can simultaneously perform coding processing on the same source data, thereby improving the efficiency of coding, and, for the same coding broadcast microinstruction, the main processor can send the coding broadcast microinstruction to different slave processors, and multiple slave processors jointly perform coding processing on all source data blocks in the coding area corresponding to the received coding broadcast microinstruction, so that multiple slave processors can simultaneously perform coding processing on the source data blocks in the same coding area, thereby further improving the efficiency of coding. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1A A schematic diagram of the structure of a codec provided in an embodiment of the present application;

[0044] Figure 1B A schematic diagram of a master-slave processing architecture provided in an embodiment of the present application;

[0045] Figure 1C A schematic diagram of another master-slave processing architecture provided in an embodiment of the present application;

[0046] Figure 2 A schematic diagram of a flow chart of a method for generating a coding stream provided in an embodiment of the present application;

[0047] Figure 3A schematic diagram of source data provided in an embodiment of the present application;

[0048] Figure 4A A schematic diagram of flow block division provided in an embodiment of the present application;

[0049] Figure 4B A schematic diagram of flow block division provided in an embodiment of the present application;

[0050] Figure 5 A schematic diagram of a shuffling method provided in an embodiment of the present application;

[0051] Figure 6 A schematic diagram of a process for determining an output / input shuffle unit provided in an embodiment of the present application;

[0052] Fig. 7A A schematic diagram of a coded stream before shuffling provided in an embodiment of the present application;

[0053] Figure 7B A schematic diagram of another coded stream before shuffling provided in an embodiment of the present application;

[0054] Fig. 8A A schematic diagram of a shuffling process of a coded stream provided in an embodiment of the present application;

[0055] Figure 8B A schematic diagram of another shuffling process of a coded stream provided in an embodiment of the present application;

[0056] Fig. 9A A schematic diagram of shuffling of a coded stream provided in an embodiment of the present application;

[0057] Fig. 9B A schematic diagram of another shuffling of a coded stream provided in an embodiment of the present application;

[0058] Fig.10 A schematic diagram of encoding data provided in an embodiment of the present application;

[0059] Fig.11 A schematic diagram of splicing source data sub-blocks provided in an embodiment of the present application;

[0060] Fig. 12A A schematic diagram of splicing coded data sub-blocks provided in an embodiment of the present application;

[0061] Fig. 12B A schematic diagram of splicing coded data sub-blocks provided in an embodiment of the present application;

[0062] Fig. 12C A schematic diagram of splicing coded data sub-blocks provided in an embodiment of the present application;

[0063] Fig.12D A schematic diagram of splicing coded data sub-blocks provided in an embodiment of the present application;

[0064] Fig.13 A schematic diagram of a shuffling method provided in an embodiment of the present application;

[0065] Fig.14 A schematic diagram of a process for determining an output / input shuffle unit provided in an embodiment of the present application;

[0066] Fig.15 A schematic diagram of a decoding stream before shuffling provided in an embodiment of the present application;

[0067] Fig.16 A schematic diagram of a decoding stream shuffling process provided in an embodiment of the present application;

[0068] Fig.17 A schematic diagram of a decoding stream shuffling completed according to an embodiment of the present application;

[0069] Fig.18 A schematic diagram of encoding header data provided in an embodiment of the present application;

[0070] Fig.19 A schematic diagram of data division for decoding provided in an embodiment of the present application;

[0071] Fig. 20 A schematic diagram of data division for decoding provided in an embodiment of the present application. DETAILED DESCRIPTION

[0072] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0073] It should be understood that the terms "first", "second", "third", and "fourth" etc. in the claims, specifications, and drawings of the present disclosure are used to distinguish different objects rather than to describe a specific order. The terms "comprise" and "comprising" used in the specifications and claims of the present disclosure indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their collections.

[0074] It should also be understood that the terms used in this disclosure are only for the purpose of describing specific embodiments and are not intended to limit the disclosure. As used in this disclosure and claims, the singular forms of "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should also be further understood that the term "and / or" used in this disclosure and claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.

[0075] As used in this specification and claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0076] The present application embodiment provides a shuffling method, which can be applied to a codec. FIG1 is a system architecture diagram of a codec provided by the present application embodiment. Figure 1A As shown, the codec adopts a master-slave processing architecture, which includes a master processor and multiple slave processors. Multiple slave processors are connected to the master processor respectively. Specifically, the master processor can be used to perform pre-order processing on input data and transmit data between multiple slave processors. Specifically, multiple slave processors are used to perform intermediate operations in parallel using data transmitted from the main processor to obtain multiple intermediate results, and transmit the multiple intermediate results to the main processor. The main processor is also used to perform subsequent processing on multiple intermediate results transmitted from the slave processor. Further, the main processor is also provided with a data access circuit in the above embodiment. The data access circuit is used for data access. Optionally, the computing device sets the main processor and the slave processor at the hardware level according to the difference between the functions of the main processor and the slave processor, and can also set multiple identical computing units, and specify the main processor and the slave processor from the multiple identical computing units in the actual data processing process. The main processor and at least one slave processor can be an IPU (Intelligent Processing Unit, intelligent processor) or a CPU (Central Processing Unit, central processing unit) or a GPU (Graphics Processing Unit, graphics processor).

[0077] Optional, such as Figure 1BAs shown, multiple slave processors are distributed in an array; each slave processor is connected to other adjacent slave processors, and the master processor is connected to k slave processors among the multiple slave processors, and the k slave processors are: n slave processors in the first row, n slave processors in the mth row, and m slave processors in the first column. It should be noted that, as Figure 1B The K slave processors shown only include n slave processors in the first row, n slave processors in the mth row, and m slave processors in the first column, that is, the k slave processors are slave processors directly connected to the main processor among the multiple slave processors. Specifically, the K slave processors are used to forward data between the main processor and the multiple slave processors. Further, the main processor may include a data access circuit. The data access circuit is mainly used to transfer data to be calculated to the main processor. The slave processor also includes a forwarding circuit for forwarding intermediate results to the main processor.

[0078] Optional, such as Figure 1C As shown, the master-slave processing architecture may also include a branch processor, the master processor is connected to one or more branch processors, and the branch processor is connected to one or more slave processors. Specifically, the branch processor is used to forward data between the master processor and the slave processor. The master processor may include a data access circuit. Among them, the data access circuit is mainly used to transfer data to be calculated to the master processor. Specifically, the slave processor includes a forwarding circuit for forwarding intermediate results to the master processor.

[0079] For ease of understanding, the present application embodiment gives priority to a detailed description of a method for generating a coded stream provided by the present application embodiment. Figure 2 As shown, the specific steps are as follows:

[0080] Step 201: Obtain source data to be encoded.

[0081] In implementation, when the master processor needs to encode the source data, the master processor sends a coding broadcast microinstruction to each slave processor. The coding broadcast microinstruction may not carry the identifier of the target slave processor, so that all slave processors execute the coding broadcast microinstruction after receiving the coding broadcast microinstruction; the coding broadcast microinstruction may also carry the identifier of at least one target slave processor, so that the at least one target slave processor executes the coding broadcast microinstruction after receiving the coding broadcast microinstruction. When a slave processor (hereinafter referred to as the first slave processor) receives the coding microinstruction, it can be determined whether the coding microinstruction carries the identifier of the target slave processor. If the coding microinstruction does not carry the identifier of the target slave processor, the first slave processor can obtain the pre-stored source data to be encoded. If the coding microinstruction carries the identifier of at least one target slave processor, the first slave processor can further determine whether the identifier of the at least one target slave processor contains the identifier of the first slave processor. If so, the first slave processor can obtain the pre-stored source data to be encoded. Figure 3 As shown, the format of the source data is a two-dimensional format, the low dimension is X, the high dimension is Y, the starting address is the data address, the size of the source data is the low-dimensional data size (data size X) * the high-dimensional data size (data size Y), and the stride of the source data in the low dimension is the low-dimensional data stride (data stride X). The source data can be further evenly divided into multiple source data blocks in two dimensions, such as Figure 3 As shown, each block represents a source data block, the size of the source data block is the low-dimensional source data block size (block size X)*the high-dimensional source data block size (block size Y), the low-dimensional interval between two adjacent source data blocks is the low-dimensional source data block stride (block stride X), and the high-dimensional interval is the high-dimensional source data block stride (block strideY).

[0082] Step 202, according to the received encoding broadcast microinstruction, determine the encoding area corresponding to the encoding broadcast microinstruction in the source data, the encoding area contains at least one data block to be encoded, and the data block to be encoded is a source data block or a source data sub-block.

[0083] In implementation, after the main processor obtains the source data to be encoded, it can determine the encoding area corresponding to the encoding broadcast microinstruction in the source data according to the received encoding broadcast microinstruction. The encoding area includes at least one data block to be encoded, and the data block to be encoded is a source data block or a source data sub-block. Figure 3As shown, the dotted box is the coding area, which can be obtained by specifying the low-dimensional offset (offset X) in the low-dimensional direction and the high-dimensional offset (offset Y) in the high-dimensional direction in the source data. The coding area contains the number of low-dimensional source data blocks (block num X) in the low-dimensional direction and the number of high-dimensional source data blocks (block num Y) in the high-dimensional direction. The starting address (start address) of the coding area is the address of the starting source data block.

[0084] After the first slave processor obtains the encoding area corresponding to the encoding broadcast microinstruction, it Figure 3 The first slave processor can directly encode the source data block represented by the vertical line block in the source data block. Figure 3 In the source data block represented by the diagonal square in the source data block, the first slave processor can determine the source data sub-block in the source data block by specifying four parameters of top, bottom, left and right, and encode the determined source data sub-block.

[0085] It should be noted that, except for the coding area, the data in other areas of the source data do not need to be divided into blocks, and the size of the data in other areas does not need to be aligned to the size of the source data block, and the low-dimensional offset, high-dimensional offset, low-dimensional source data block stride, high-dimensional source data block stride, low-dimensional source data size, high-dimensional source data size and low-dimensional source data stride do not need to be aligned with the low-dimensional source data block size or the high-dimensional source data block size. That is, the first slave processor supports arbitrary block division in the source data, and arbitrarily takes out the coding area in the obtained source data block for encoding.

[0086] Step 203: for each data block to be encoded in at least one data block to be encoded, divide the data block to be encoded into multiple stream blocks, and send the multiple stream blocks to multiple encoding streams corresponding to the data block to be encoded as stream blocks to be shuffled in the multiple encoding streams.

[0087] In implementation, in order to improve the encoding throughput, the first slave processor may encode the same data block to be encoded in parallel through multiple encoding streams. Similarly, when the first slave processor performs shuffling, for each data block to be encoded, the first slave processor may divide the data block to be encoded into multiple stream blocks, and send the multiple stream blocks to the multiple encoding streams corresponding to the data block to be encoded as stream blocks to be shuffled in the multiple encoding streams. Optionally, the first slave processor may divide the data block to be encoded into multiple row sequences, each row sequence containing at least one data sub-block to be encoded. Then, for each data sub-block to be encoded in each row sequence, the first slave processor may divide the data sub-block to be encoded into multiple stream blocks. In this way, it can be ensured that the number of stream blocks in each encoding stream is similar. For example, Figure 4A As shown, the first slave processor divides the data block to be encoded into 4 row sequences. Among them, the first row sequence contains data sub-block 1 to be encoded, data sub-block 2 to be encoded, data sub-block 3 to be encoded and data sub-block 4 to be encoded; the second row sequence contains data sub-block 5 to be encoded, data sub-block 6 to be encoded, data sub-block 7 to be encoded and data sub-block 8 to be encoded; the third row sequence contains data sub-block 9 to be encoded, data sub-block 10 to be encoded, data sub-block 11 to be encoded and data sub-block 12 to be encoded; the fourth row sequence contains data sub-block 13 to be encoded, data sub-block 14 to be encoded, data sub-block 15 to be encoded and data sub-block 16 to be encoded, and the slashed squares in each row sequence represent non-encoded data in the data block to be encoded. Then, as Figure 4B As shown, for each data sub-block to be encoded in each row sequence, the first slave processor can divide the data sub-block to be encoded into 4 stream blocks, and send them to encoding streams 1 to 4 respectively as stream blocks to be shuffled in each encoding stream. Among them, encoding stream 1 and encoding stream 2 contain 16 stream blocks to be shuffled, and encoding stream 3 and encoding stream 4 contain 12 stream blocks to be shuffled.

[0088] The following will be combined with a specific embodiment to describe in detail a shuffling method provided in an embodiment of the present application, and the shuffling method is applied to the encoding process. Figure 5 As shown, the specific steps are as follows:

[0089] Step 501, receiving the encoded broadcast microinstruction sent by the main processor.

[0090] In implementation, after the master processor obtains the source data to be encoded, it can send a coding broadcast microinstruction to each slave processor. The coding broadcast microinstruction may not carry the identifier of the target slave processor, so that all slave processors execute the coding broadcast microinstruction after receiving the coding broadcast microinstruction; the coding broadcast microinstruction may also carry the identifier of at least one target slave processor, so that the at least one target slave processor executes the coding broadcast microinstruction after receiving the coding broadcast microinstruction. When a slave processor (hereinafter referred to as the first slave processor) receives the coding microinstruction, it can be determined whether the coding microinstruction carries the identifier of the target slave processor. If the coding microinstruction does not carry the identifier of the target slave processor, step 502 is executed. If the coding microinstruction carries the identifier of at least one target slave processor, the first slave processor can further determine whether the identifier of the first slave processor exists in the identifier of the at least one target slave processor. If it exists, step 502 is executed. If it does not exist, no processing is performed.

[0091] Step 502: Determine at least one first shuffle group corresponding to the to-be-encoded data block according to the first shuffle level, wherein the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one encoding stream.

[0092] In implementation, the first slave processor may select a corresponding shuffle level from the preset shuffle levels according to the difference in the number of stream blocks included in each coded stream. For example, three shuffle levels may be preset in the first slave processor, shuffle level 1, shuffle level 2, and shuffle level 3. After the first slave processor selects a certain shuffle level (i.e., the first shuffle level), it may further determine at least one first shuffle group corresponding to the data block to be encoded according to the first shuffle level. The first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one coded stream.

[0093] Optionally, the first slave processor determines, according to the first shuffle level, that the processing process of at least one first shuffle group corresponding to the to-be-encoded data block is to obtain multiple coded streams corresponding to the to-be-encoded data block. According to the first shuffle level, the multiple coded streams are divided into multiple first shuffle units, and the multiple first shuffle units are divided into at least one first shuffle group. The first shuffle unit includes at least one coded stream, and the first shuffle group includes multiple first shuffle units.

[0094] In implementation, when the first slave processor needs to determine at least one first shuffle group corresponding to the to-be-encoded data block according to the first shuffle level, the first slave processor may obtain multiple coded streams corresponding to the to-be-encoded data block. Then, the first slave processor may divide the multiple coded streams into multiple first shuffle units according to the first shuffle level, and divide the multiple first shuffle units into at least one first shuffle group. The first shuffle unit includes at least one coded stream, and the first shuffle group includes multiple first shuffle units. For example, the data block to be encoded corresponds to 32 encoding streams. When the first shuffle level is shuffle level 1, the first slave processor can divide the 32 encoding streams into 32 first shuffle units, and divide the 32 first shuffle units into 8 first shuffle groups, that is, every 4 adjacent encoding streams are shuffled; when the first shuffle level is shuffle level 2, the first slave processor can divide the 32 encoding streams into 8 first shuffle units, and divide the 8 first shuffle units into 2 first shuffle groups, that is, shuffle 4 encoding streams in every 16 adjacent encoding streams as one shuffle unit; when the first shuffle level is shuffle level 3, the first slave processor can divide the 32 encoding streams into 2 first shuffle units, and divide the 2 first shuffle units into 1 first shuffle group, that is, shuffle 16 encoding streams in the 32 encoding streams as one shuffle unit.

[0095] Step 503: determine the code length of each first shuffling unit.

[0096] In implementation, after the first slave processor determines the first shuffle group corresponding to the data block to be encoded, the first slave processor may further determine the coding length of each first shuffle unit in the first shuffle group for each first shuffle group. Optionally, for each first shuffle unit in each first shuffle group, the first slave processor may determine the total coding length of the stream blocks to be encoded in the coding stream contained in the first shuffle unit as the coding length of the first shuffle unit. In the case where the shuffling process and the coding process are performed simultaneously, the first slave processor may also determine the total coding length of the stream blocks to be encoded and the encoded stream blocks in the coding stream contained in the first shuffle unit as the coding length of the first shuffle unit.

[0097] Step 504: Determine output shuffling units and input shuffling units in each first shuffling unit according to the code length of each first shuffling unit.

[0098] In implementation, after the first slave processor determines the encoding length of each first shuffle unit, it can determine the output shuffle unit and the input shuffle unit in each first shuffle unit according to the encoding length of each first shuffle unit. Figure 6 As shown, the first slave processor determines the processing process of the output shuffle unit and the input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit as follows:

[0099] Step 601: Determine the shuffling type of each first shuffling unit according to the encoding length of each first shuffling unit.

[0100] In implementation, after the first slave processor determines the encoding length of each first shuffle unit, the first slave processor may determine the shuffle type of each first shuffle unit according to the encoding length of each first shuffle unit. There are various ways for the first slave processor to determine the shuffle type of each first shuffle unit according to the encoding length of each first shuffle unit. The embodiment of the present application provides two feasible ways, which are as follows:

[0101] Mode 1: For each first shuffle unit, the first slave processor may determine the shuffle type of the first shuffle unit according to the first difference between the code length of the first shuffle unit and the code lengths of other first shuffle units. The specific processing process is as follows:

[0102] Step 1: for each first shuffle unit in each first shuffle unit, determine a first difference between a code length of the first shuffle unit and code lengths of other first shuffle units.

[0103] In implementation, after the first slave processor determines the code length of each first shuffle unit, for each first shuffle unit, the first slave processor may further determine a first difference between the code length of the first shuffle unit and the code lengths of other first shuffle units. Example 1: Fig. 7A As shown, taking 4 shuffling units as a shuffling group for shuffling, each shuffling unit containing a coding stream as an example, the coding length of coding stream 1 is N+5, the coding length of coding stream 2 is N+9, the coding length of coding stream 3 is N, and the coding length of coding stream 4 is N+3, where N is a positive integer, the first difference corresponding to coding stream 1 is {-4, 5, 2}, the first difference corresponding to coding stream 2 is {4, 9, 6}, the first difference corresponding to coding stream 3 is {-5, -9, -3}, and the first difference corresponding to coding stream 4 is {-2, -6, 3}.

[0104] Example 2: Figure 7B As shown, taking 4 shuffling units as a shuffling group for shuffling, and each shuffling unit containing a coding stream as an example, the coding length of coding stream 1 is N+15, the coding length of coding stream 2 is N+10, the coding length of coding stream 3 is N+8, and the coding length of coding stream 4 is N, where N is a positive integer, the first difference corresponding to coding stream 1 is {5, 7, 15}, the first difference corresponding to coding stream 2 is {-5, 2, 10}, the first difference corresponding to coding stream 3 is {-7, -2, 8}, and the first difference corresponding to coding stream 4 is {-15, -10, -8}.

[0105] Step 2: Determine the shuffling type of the first shuffling unit according to the first difference corresponding to the first shuffling unit.

[0106] In implementation, the first slave processor may pre-store a first preset difference threshold. The first preset difference threshold may be set by a technician based on experience. After the first slave processor obtains the first difference corresponding to the first shuffle unit, it may determine whether there is a target difference whose absolute value is greater than or equal to the first preset difference threshold in the first difference corresponding to the first shuffle unit, and whether the target difference values ​​are all positive numbers. If there is a target difference whose absolute value is greater than or equal to the first preset difference threshold in the first difference corresponding to the first shuffle unit, and the target difference values ​​are all positive numbers, the first slave processor executes step three. If there is a target difference whose absolute value is greater than or equal to the first preset difference threshold in the first difference corresponding to the first shuffle unit, and there is a negative target difference in the target difference, the first slave processor executes step four. If there is no target difference whose absolute value is greater than or equal to the first preset difference threshold in the first difference corresponding to the first shuffle unit. Then the first slave processor executes step five.

[0107] Step three: determine that the shuffling type of the first shuffling unit is a high coding type.

[0108] In implementation, if there is a target difference whose absolute value is greater than or equal to the first preset difference threshold value in the first difference value corresponding to the first shuffle unit, and the target difference values ​​are all positive numbers, the first slave processor may determine that the shuffle type of the first shuffle unit is a high coding type (hereinafter represented by H). For example, in the above example 1, if Fig. 7A As shown, the first preset difference threshold is 7, then the shuffle type of the coded stream 2 is H. In the above example 2, Figure 7B As shown, the first preset difference threshold is 7, and the shuffle type of the coding stream 1 and the coding stream 2 is H.

[0109] Step 4: determine that the shuffling type of the first shuffling unit is a low coding type.

[0110] In implementation, if there is a target difference whose absolute value is greater than or equal to the first preset difference threshold value in the first difference value corresponding to the first shuffle unit, and there is a negative target difference value in the target difference value, the first slave processor may determine that the shuffle type of the first shuffle unit is a low coding type (hereinafter represented by L). For example, in the above example 1, if Fig. 7A As shown, the first preset difference threshold is 7, then the shuffle type of the coded stream 3 is L. In the above example 2, Figure 7B As shown, the first preset difference threshold is 7, and the shuffle type of the coding stream 3 and the coding stream 4 is L.

[0111] Step 5: Determine that the shuffling type of the first shuffling unit is a medium coding type.

[0112] In implementation, if there is no target difference value whose absolute value is greater than or equal to the first preset difference threshold value in the first difference value corresponding to the first shuffle unit, the first slave processor may determine that the shuffle type of the first shuffle unit is a medium coding type (hereinafter represented by M). For example, in the above example 1, Fig. 7A As shown, the first preset difference threshold is 7, and the shuffle type of the coding stream 1 and the coding stream 4 is M.

[0113] Mode 2: For each first shuffle unit, the first slave processor may determine the shuffle type of the first shuffle unit according to the second difference between the code length of the first shuffle unit and the average code length. The specific processing process is as follows:

[0114] Step 1: Determine the average code length according to the code length of each first shuffle unit.

[0115] In implementation, after the first slave processor determines the code length of each first shuffle unit, the average code length can be determined according to the code length of each first shuffle unit. Example 3, shuffling is performed using 4 shuffle units as a shuffle group, and each shuffle unit contains a code stream. The code length of code stream 1 is N+5, the code length of code stream 2 is N+9, the code length of code stream 3 is N, and the code length of code stream 4 is N+3, where N is a positive integer, and the average code length is N+4.25.

[0116] Example 4: Taking 4 shuffling units as a shuffling group for shuffling, each shuffling unit contains a coding stream as an example, the coding length of coding stream 1 is N+15, the coding length of coding stream 2 is N+10, the coding length of coding stream 3 is N+8, and the coding length of coding stream 4 is N, where N is a positive integer, and the average coding length is N+8.25.

[0117] Step 2: for each first shuffle unit in each first shuffle unit, determine a second difference between the code length of the first shuffle unit and the average code length.

[0118] In implementation, after the first slave processor determines the average code length, for each first shuffle unit, the first slave processor may further determine a second difference between the code length of the first shuffle unit and the average code length. For example, in the above example 3, the second difference corresponding to code stream 1 is 0.75, the second difference corresponding to code stream 2 is 4.75, the second difference corresponding to code stream 3 is -4.25, and the second difference corresponding to code stream 4 is -1.25; in the above example 4, the second difference corresponding to code stream 1 is 6.75, the second difference corresponding to code stream 2 is 1.75, the second difference corresponding to code stream 3 is -0.25, and the second difference corresponding to code stream 4 is -8.25.

[0119] Step three: determining the shuffling type of the first shuffling unit according to the second difference corresponding to the first shuffling unit.

[0120] In implementation, a second preset difference threshold may be pre-stored in the first slave processor. The second preset difference threshold may be set by a technician based on experience. After the first slave processor obtains the second difference corresponding to the first shuffle unit, it may determine whether the absolute value of the second difference corresponding to the first shuffle unit is greater than or equal to the second preset difference threshold, and whether the second difference is a positive number. If the absolute value of the second difference corresponding to the first shuffle unit is greater than or equal to the second preset difference threshold, and the second difference is a positive number, the first slave processor executes step four. If the absolute value of the second difference corresponding to the first shuffle unit is greater than or equal to the second preset difference threshold, and the second difference is a negative number, the first slave processor executes step five. If the absolute value of the second difference corresponding to the first shuffle unit is less than the second preset difference threshold, the first slave processor executes step six.

[0121] Step 4: determine that the shuffling type of the first shuffling unit is a high coding type.

[0122] In an implementation, if the absolute value of the second difference corresponding to the first shuffle unit is greater than or equal to the second preset difference threshold, and the second difference is a positive number, the first slave processor may determine that the shuffle type of the first shuffle unit is a high coding type (i.e., H). For example, in the above example 3, the second preset difference threshold is 4, and the shuffle type of the coding stream 2 is H; in the above example 4, the second preset difference threshold is 6, and the shuffle type of the coding stream 1 is H.

[0123] Step 5: Determine that the shuffling type of the first shuffling unit is a low coding type.

[0124] In an implementation, if the absolute value of the second difference corresponding to the first shuffle unit is greater than or equal to the second preset difference threshold, and the second difference is a negative number, the first slave processor may determine that the shuffle type of the first shuffle unit is a low coding type (i.e., L). For example, in the above example 3, the second preset difference threshold is 4, and the shuffle type of the coding stream 3 is L; in the above example 4, the second preset difference threshold is 6, and the shuffle type of the coding stream 4 is L.

[0125] Step six, determining that the shuffling type of the first shuffling unit is a medium coding type.

[0126] In implementation, if the absolute value of the second difference corresponding to the first shuffle unit is less than the second preset difference threshold, the first slave processor may determine that the shuffle type of the first shuffle unit is the medium coding type (i.e., M). For example, in the above example 3, the second preset difference threshold is 4, and the shuffle type of the coding stream 1 and the coding stream 4 is M; in the above example 4, the second preset difference threshold is 6, and the shuffle type of the coding stream 2 and the coding stream 3 is M.

[0127] Step 602: Determine, in each first shuffling unit, an output shuffling unit and an input shuffling unit corresponding to each output shuffling unit according to the shuffling type of each first shuffling unit and a preset shuffling rule.

[0128] In implementation, the first slave processor may pre-store shuffling rules. The shuffling rules may be set by a technician based on experience. After the first slave processor obtains the shuffling type of each first shuffling unit, it may further determine the output shuffling unit and the input shuffling unit corresponding to each output shuffling unit in each first shuffling unit according to the shuffling type of each first shuffling unit and the preset shuffling rule. The first slave processor determines the output shuffling unit and the input shuffling unit corresponding to each output shuffling unit in each first shuffling unit according to the shuffling type of each first shuffling unit and the preset shuffling rule. The processing process is as follows:

[0129] Step 1: If the first number of the first target shuffle units of the high coding type is less than or equal to the second number of the second target shuffle units of the low coding type, the first target shuffle unit is determined as the output shuffle unit, and for each output shuffle unit, at least one second target shuffle unit is determined in the second target shuffle unit as the input shuffle unit corresponding to the output shuffle unit.

[0130] In implementation, if the first number of the first target shuffle units of the high coding type is less than or equal to the second number of the second target shuffle units of the low coding type, the first slave processor may determine the first target shuffle unit as an output shuffle unit. Then, for each output shuffle unit, the first slave processor may determine at least one second target shuffle unit in the second target shuffle unit as an input shuffle unit corresponding to the output shuffle unit. Among them, a second target shuffle unit may be used only as an input shuffle unit corresponding to an output shuffle unit, or as an input shuffle unit corresponding to multiple output shuffle units, which is not limited in the embodiments of the present application. For example, taking 4 shuffling units as a shuffling group for shuffling, and each shuffling unit containing one coding stream as an example, when the shuffling type of coding streams 1 to 4 is HMML, the first slave processor can determine coding stream 1 as the output shuffling unit, and determine coding stream 4 as the input shuffling unit of coding stream 1; when the shuffling type of coding streams 1 to 4 is HMLL, the first slave processor can determine coding stream 1 as the output shuffling unit, and determine coding streams 3 and 4 as the input shuffling units of coding stream 1; when the shuffling type of coding streams 1 to 4 is HLLL, the first slave processor can determine coding stream 1 as the output shuffling unit, and determine coding streams 2, 3 and 4 as the input shuffling units of coding stream 1. Stream 3 and coded stream 4 are determined as input shuffling units of coded stream 1; when the shuffling type of coded stream 1 to coded stream 4 is HHLL, the first slave processor can determine coded stream 1 and coded stream 2 as output shuffling units, and determine coded stream 3 as the input shuffling unit of coded stream 1, and determine coded stream 4 as the input shuffling unit of coded stream 2. The first slave processor can also determine coded stream 3 and coded stream 4 as the input shuffling unit of coded stream 1, and determine coded stream 3 and coded stream 4 as the input shuffling unit of coded stream 2. The first slave processor can also determine coded stream 3 as the input shuffling unit of coded stream 1, and determine coded stream 3 and coded stream 4 as the input shuffling unit of coded stream 2.

[0131] Step 2: If the first number of first target shuffle units of the high coding type is greater than the second number of second target shuffle units of the low coding type, the second number of first target shuffle units are determined as output shuffle units, and for each output shuffle unit, at least one second target shuffle unit is determined in the second target shuffle unit as the input shuffle unit corresponding to the output shuffle unit.

[0132] In implementation, if the first number of first target shuffle units of high coding type is greater than the second number of second target shuffle units of low coding type, the first slave processor may determine the second number of first target shuffle units as output shuffle units in each first target shuffle unit. Then, for each output shuffle unit, the first slave processor may determine at least one second target shuffle unit in the second target shuffle unit as the input shuffle unit corresponding to the output shuffle unit. Among them, a second target shuffle unit may be used only as an input shuffle unit corresponding to an output shuffle unit, or as an input shuffle unit corresponding to multiple output shuffle units, which is not limited in the embodiments of the present application. For example, taking 4 shuffling units as a shuffling group for shuffling, and each shuffling unit containing a coding stream as an example, when the shuffling type of coding streams 1 to 4 is HHML, the first slave processor can determine coding stream 2 as the output shuffling unit, and determine coding stream 4 as the input shuffling unit of coding stream 2; when the shuffling type of coding streams 1 to 4 is HHHL, the first slave processor can determine coding stream 3 as the output shuffling unit, and determine coding stream 4 as the input shuffling unit of coding stream 1.

[0133] It should be noted that if the first number of first target shuffle units of high coding type is greater than the second number of second target shuffle units of low coding type, and there is a third target shuffle unit of medium coding type in each shuffle unit, the first slave processor can further determine several first target shuffle units as output shuffle units (hereinafter referred to as second output shuffle units) in the first target shuffle units other than the output shuffle units (hereinafter referred to as first output shuffle units) determined as corresponding to the second target shuffle units, and for each second output shuffle unit, the first slave processor can determine at least one third target shuffle unit in the third target shuffle unit as the input shuffle unit corresponding to the second output shuffle unit. For example, taking 4 shuffling units as a shuffling group for shuffling, and each shuffling unit containing a coding stream as an example, when the shuffling type of coding streams 1 to 4 is HHML, the first slave processor can determine coding stream 2 as the first output shuffling unit, and determine coding stream 4 as the input shuffling unit of coding stream 2; at the same time, the first slave processor can also determine coding stream 1 as the second output shuffling unit, and determine coding stream 3 as the input shuffling unit of coding stream 1.

[0134] In addition, for the third target shuffle unit of the medium coding type, for each third target shuffle unit, the first slave processor can determine the third target shuffle unit as an output shuffle unit, and determine itself as an input shuffle unit corresponding to the third target shuffle unit. For example, taking 4 shuffle units as a shuffle group for shuffling, each shuffle unit contains a coding stream as an example, when the shuffle type of coding streams 1 to 4 is MMMM, the first slave processor can determine coding stream 1 as an output shuffle unit, and determine coding stream 1 as an input shuffle unit of coding stream 1, and coding streams 2 to 4 are similar, which will not be repeated here.

[0135] Step 505: Send the first preset number of stream blocks to be shuffled in the output shuffling unit to the input shuffling unit as the first stream block to be encoded in the input shuffling unit, so that the first stream block to be encoded is encoded by the input shuffling unit according to a preset encoding algorithm.

[0136] In implementation, a first preset number may be pre-stored in the first slave processor. The first preset number may be set by a technician based on experience. After the first slave processor determines the output shuffle unit and the input shuffle unit, the first slave processor may send the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream block to be encoded in the input shuffle unit, so that the first stream block to be encoded is encoded by the input shuffle unit according to a preset encoding algorithm. Among them, the first preset number may be greater than or equal to the number of input shuffle units; the stream blocks to be shuffled received by each input shuffle unit may be the same or different; for each input shuffle unit, the first slave processor may also input the third preset number of units to be shuffled in the input shuffle unit into the queue to be encoded of the input shuffle unit as the first stream block to be encoded of the input shuffle unit.

[0137] Optionally, for each output shuffle unit, a second preset number of stream blocks to be shuffled in the output shuffle unit are sent to an input shuffle unit corresponding to the output shuffle unit as the first stream block to be encoded in the input shuffle unit.

[0138] In implementation, a second preset number may be pre-stored in the first slave processor. The second preset number may be set by a technician based on experience. For the case where the output shuffle unit corresponds to the input shuffle unit, for each output shuffle unit, the first slave processor may send the second preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit corresponding to the output shuffle unit as the first stream block to be encoded in the input shuffle unit. The second preset number may be greater than or equal to the number of input shuffle units corresponding to the output shuffle unit, and the number of stream blocks to be shuffled received by each input shuffle unit may be the same or different. In this way, the coding lengths of each shuffle unit can be guaranteed to be similar. For example, Fig. 8A As shown, 4 shuffle units are used as a shuffle group for shuffling, and each shuffle unit contains a code stream. For example, the shuffle type of code streams 1 to 4 is MHLM, then code stream 2 is the output shuffle unit, and code stream 3 is the input shuffle unit of code stream 2. Code stream 1 can output one to-be-shuffled stream block to code stream 1, code stream 2 can output one to-be-shuffled stream block to code stream 3, and code stream 4 can output one to-be-shuffled stream block to code stream 4. In this way, Fig. 9A As shown, after the shuffling is completed, the code length of code stream 1 is N+8, the code length of code stream 2 is N+9, the code length of code stream 3 is N+3, and the code length of code stream 4 is N+6. The shuffling type of code streams 1 to 4 is MMMM. For another example, Figure 8B As shown in the figure, shuffling is performed using four shuffling units as a shuffling group, and each shuffling unit contains one code stream. The shuffling type of code streams 1 to 4 is HHLL, then code stream 1 and code stream 2 are output shuffling units, code stream 3 and code stream 4 are input shuffling units of code stream 1, and code stream 4 is the input shuffling unit of code stream 2. Code stream 1 can output one to-be-shuffled stream block to code stream 3 and code stream 4 respectively, and code stream 2 can output two to-be-shuffled stream blocks to code stream 4. In this way, Fig. 9B As shown, after the shuffling is completed, the code length of code stream 1 is N+15, the code length of code stream 2 is N+10, the code length of code stream 3 is N+11, and the code length of code stream 4 is N+9. The shuffling type of code stream 1 to code stream 4 is MMMM.

[0139] As an optional implementation, the first slave processor may determine at least one second shuffle group corresponding to the data block to be encoded according to the second shuffle level. The second shuffle group includes a plurality of second shuffle units, and the second shuffle unit includes at least one coding stream. Then, the first slave processor may re-shuffle the stream blocks to be encoded in each second shuffle unit as the stream blocks to be shuffled until the coding length of each second shuffle unit meets the preset proximity condition.

[0140] In implementation, after the first slave processor shuffles the coding stream corresponding to the data block to be coded according to the first shuffling level, the first slave processor may further determine at least one second shuffling group corresponding to the data block to be coded according to the second shuffling level. The second shuffling group includes a plurality of second shuffling units, and the second shuffling unit includes at least one coding stream. The processing process of the first slave processor determining at least one second shuffling group corresponding to the data block to be coded according to the second shuffling level is similar to step 501, and will not be repeated here. Then, the first slave processor can re-shuffle the stream blocks to be coded in each second shuffling unit as the stream blocks to be shuffled until the coding length of each second shuffling unit meets the preset proximity condition.

[0141] It should be noted that after the first slave processor shuffles the coded stream corresponding to the coded data block according to the second shuffle level, it can further shuffle the coded stream corresponding to the coded data block according to the third shuffle level. For example, the first slave processor can shuffle the coded stream corresponding to the coded data block according to shuffle level 1-shuffle level 2-shuffle level 3, or shuffle the coded stream corresponding to the coded data block according to shuffle level 1-shuffle level 3-shuffle level 2, or shuffle the coded stream corresponding to the coded data block according to shuffle level 2-shuffle level 3-shuffle level 1.

[0142] As an optional implementation, when the first slave processor detects that encoding of a first encoded stream among multiple encoded streams is completed, a third preset number of to-be-encoded stream blocks in a second encoded stream that has not been fully encoded among the multiple encoded streams are sent to the first encoded stream as to-be-encoded stream blocks in the first encoded stream.

[0143] In implementation, in order to further balance the coding length of each coding stream and improve the coding rate when encoding small data blocks. A third preset number may be pre-stored in the first slave processor. The third preset number may be set by a technician based on experience. When the first slave processor detects that the first coding stream in a plurality of coding streams is encoded (that is, the first coding stream outputs a coding stream end (StreamFinish) mark), a third preset number of to-be-encoded stream blocks in the second coding stream that has not been encoded in the plurality of coding streams may be sent to the first coding stream as to-be-encoded stream blocks in the first coding stream. The second coding stream may be all the unencoded coding streams in the plurality of coding streams, or may be part of the unencoded coding streams in the plurality of coding streams.

[0144] As an optional implementation manner, the first slave processor encodes the first to-be-encoded stream block through the input shuffling unit according to a preset encoding algorithm as follows:

[0145] Step 1: Encode the preset characters contained in the first to-be-encoded stream block according to a first encoding rule corresponding to the preset characters to obtain first encoded data.

[0146] In implementation, the first slave processor may pre-store a first encoding rule corresponding to a preset character. The first encoding rule corresponding to the preset character may be set by a technician based on experience. The first slave processor may encode the preset character contained in the first to-be-encoded stream block according to the first encoding rule corresponding to the preset character to obtain first encoded data. Since the neural network data has a sparse characteristic, the technician may set a number of consecutive all-zero characters as preset characters. Table 1 shows the preset characters, as shown in Table 1:

[0147] Table 1

[0148] name describe StreamFinish End of encoding stream SingleZero Single all 0 data DoubleZero Two consecutive all-0 data TripleZero Three consecutive all-0 data QuadZero Four consecutive all-0 data Literals Other 8-bit character encodings

[0149] Step 2: Encode the first coded data according to a preset second coding rule.

[0150] In implementation, the first slave processor may pre-store a second encoding rule. The second encoding rule may be a prefix code encoding algorithm or other encoding algorithms, which is not limited in the embodiment of the present application. After the first slave processor obtains the first encoded data, it may encode the first encoded data according to the preset second encoding rule.

[0151] As an optional implementation, the first slave processor encodes the data blocks to be encoded, and after obtaining the encoded data blocks, a coding header block of the encoded data blocks corresponding to each data block to be encoded can be generated. The coding header block contains the storage address of the encoded data block corresponding to the coding header block. Then, the first slave processor can store each coding header block, and store each coded data block after each coding header block.

[0152] In implementation, for the coded data block corresponding to the to-be-coded data block, such as Fig.10As shown, the first slave processor adopts the form of header-data block mapping for storage. The mapping form is divided into two parts, namely, the coding header part and the coding data block part. The starting address of the coding header part is the coding header address; the space occupied by the coding header part is the size of the total number of coding headers (head total number) coding header blocks, and the total number of coding headers can be greater than or equal to the number of valid coding header blocks. Among them, the size of each coding header block is 16 bits (byte), and each coding header block stores the starting address and actual size of the coding data block corresponding to the coding header block, and each coding header block is stored continuously in the storage device. The coding data block part is stored next to the end address of the coding header part. Each coding data block part contains a number of coding data blocks, and each coding data block corresponds to the h coding header block one by one. Among them, the storage format of the coding data block is divided into two types: packing format and unpacking format.

[0153] Optionally, for the packing format, the coded data block consists of coded data, and the size of the coded data is equal to the size of the to-be-coded data in the to-be-coded data block after being encoded.

[0154] In implementation, Fig.10 As shown, in the packing format, the coded data blocks are stored closely, each coded data block is composed of coded data, and the size of the coded data is equal to the size of the coded data in the coded data block after being coded. That is, the space occupied by the coded data block is the actual size of the coded data block after being coded.

[0155] Optionally, for a non-packed format, the coded data block consists of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the data block to be coded.

[0156] In implementation, Fig.10 As shown, in the non-packed format, each coded data block consists of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the data block to be coded. That is, each coded data block occupies the same space and is equal to the size of a complete data block to be coded before encoding. Among them, the first part is the coded data, and the second part is the reserved padding data.

[0157] As an optional implementation, the coded data block is composed of coded data sub-blocks corresponding to multiple source data sub-blocks belonging to the same source data block. In a packed format, the coded data sub-block is composed of coded data, and the size of the coded data is equal to the size of the to-be-coded data in the source data sub-block after being encoded. In a non-packed format, the coded data sub-block is composed of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the source data sub-block.

[0158] In implementation, when the first slave processor determines multiple coding areas in the source data according to different coding broadcast microinstructions, it may divide a complete source data block into multiple source data sub-blocks. The coding areas corresponding to the coding broadcast microinstructions are on the adjacent side, and either they all encode complete source data blocks, and the source data blocks do not overlap each other; or they each encode a part of the same source data block (that is, source data sub-blocks), and the boundaries of the source data sub-blocks in the source data block just overlap. Fig.11 As shown, the four coding areas determined by the four coding broadcast microinstructions in the source data divide part of the source data block (represented by gray oblique line blocks) into multiple source data sub-blocks, and the boundaries of each source data sub-block in the same source data block just overlap. The first slave processor encodes each source data sub-block in the same source data block according to different coding broadcast microinstructions to obtain coded data sub-blocks. When the first slave processor stores the coded data sub-blocks corresponding to the multiple source data sub-blocks in the same source data block, the coded data sub-blocks can be stored in the same coded data block. In this way, multiple coding broadcast microinstructions can be realized to collaboratively complete the splicing of specific coding areas, and the effect is exactly the same as encoding through one coding broadcast microinstruction, and the execution order of these coding broadcast microinstructions can be arbitrary or even concurrently executed, so that the coding task can be divided in the case of multi-core source data division and block division for pipeline execution within a single core.

[0159] like Fig. 12A As shown in , a source data block is divided into two parts in both low-dimensional and high-dimensional dimensions, so that the source data block is divided into four source data sub-blocks, namely TL (top-left), TR (top-right), BL (bottom-left) and BR (bottom-right). The size of each source data sub-block is as follows: Fig. 12AAs shown, the first slave processor can be specified by four parameters, block left, block right, block top, and block bottom, inside the source data block. Each source data sub-block can be coded data or non-coded data. In the coded data block in the non-packed format, the above-mentioned 4 source data sub-blocks corresponding to the 4 coded data sub-blocks can be stored in a fixed order of TL-TR-BL-BR, and each coded data sub-block consists of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the source data sub-block. That is, the space occupied by each coded data sub-block is the size of the source data sub-block corresponding to the coded data sub-block before encoding. In this way, the space of the coded data block is the same as the size of the source data block, thereby ensuring that if each source data sub-block of the source data block is encoded by different coded broadcast microinstructions, each coded broadcast microinstruction can calculate the address of the coded data sub-block it is responsible for based on the partition information (which can be calculated through the instruction domain), thereby realizing the splicing of the results of multiple coded broadcast microinstructions.

[0160] like Fig. 12A As shown, the first slave processor can convert the coded data block in the non-packed format into the coded data block in the packed format by means of coding move (Move) and the like. In the coded data block in the packed format, each coded data sub-block is composed of coded data, and the size of the coded data is equal to the size of the coded data in the source data sub-block after being coded. Among them, the coded data sub-blocks are stored closely, and the starting address of each coded data sub-block needs to be accumulated according to the actual size of the previous coded data sub-block, and the space occupied by the entire coded data block is the sum of the sizes of all coded data sub-blocks.

[0161] like Fig. 12B As shown, a source data block is divided into two parts in high dimension, so that the source data block is divided into two source data sub-blocks, namely TL and BL, or BL and BR. Fig. 12C As shown, a source data block is divided into two parts in a low dimension, so that the source data block is divided into two source data sub-blocks, namely TL and TR, or TR and BR.

[0162] A source data block is not divided in low dimension or high dimension, and has only one source data sub-block, which can be TL, TR, BL or BR. Fig.12D As shown, a source data block has only one source data sub-block TL.

[0163] In order to support the splicing of different coding areas, the format of the coding header corresponding to the coding data block containing multiple coding data sub-blocks is shown in Table 2.

[0164] Table 2

[0165]

[0166] As an optional implementation, if the total encoding length of the to-be-encoded stream blocks in each first shuffle group is greater than the original length of the to-be-encoded data block, the encoding process of the to-be-encoded data block is terminated.

[0167] In implementation, in order to ensure that the coded data block can be stored in a non-packed format, it is necessary to ensure that the size of the coded data block cannot exceed the size of the data block to be encoded. When the first slave processor performs shuffling processing on the data block to be encoded, if it is detected that the total coding length of the stream blocks to be encoded in each first shuffle group is greater than the original length of the data block to be encoded, the encoding processing of the data block to be encoded is terminated. Then the first slave processor can resend a request to read the data block to be encoded, and the read data block to be encoded does not need to be encoded and can be directly stored. Optionally, the first slave processor can also terminate the encoding processing of the data block to be encoded if it is detected that the coding length output by the encoding processing is greater than the size of the data block to be encoded when encoding the data block to be encoded.

[0168] The embodiment of the present application provides a shuffling method. A first slave processor receives a coding broadcast microinstruction sent by a master processor. If the coding broadcast microinstruction does not carry an identifier of a target slave processor, or if the identifier of a first slave processor is included in at least one identifier of a target slave processor carried by the coding broadcast microinstruction, the first slave processor determines at least one first shuffling group corresponding to a data block to be encoded according to a first shuffling level. The first shuffling group includes a plurality of first shuffling units, and the first shuffling unit includes at least one coding stream. Then, the first slave processor determines the coding length of each first shuffling unit, and determines an output shuffling unit and an input shuffling unit in each first shuffling unit according to the coding length of each first shuffling unit. Afterwards, the first slave processor sends a first preset number of stream blocks to be shuffled in the output shuffling unit to the input shuffling unit as the first stream block to be encoded in the input shuffling unit, so that the first stream block to be encoded is encoded by the input shuffling unit according to a preset coding algorithm. In this way, by shuffling the coding streams of the coded data blocks, the coding lengths of the coding streams can be guaranteed to be similar, thereby avoiding excessive complements due to the alignment requirements between the coding streams, thereby reducing the coding rate. At the same time, deadlock between the coding streams can also be avoided. In addition, for different coding broadcast microinstructions, the main processor can send different coding broadcast microinstructions to different slave processor groups including multiple slave processors, and each slave processor group only performs coding processing on the source data blocks in the coding area corresponding to the received coding broadcast microinstruction, so that multiple slave processor groups can simultaneously perform coding processing on the same source data, thereby improving the efficiency of coding, and, for the same coding broadcast microinstruction, the main processor can send the coding broadcast microinstruction to different slave processors, and multiple slave processors jointly perform coding processing on all source data blocks in the coding area corresponding to the received coding broadcast microinstruction, so that multiple slave processors can simultaneously perform coding processing on the source data blocks in the same coding area, thereby further improving the efficiency of coding.

[0169] The embodiment of the present application also provides a shuffling method, which is applied to the decoding process. Fig.13 As shown, the specific steps are as follows:

[0170] Step 1301, receiving a decoded broadcast microinstruction sent by a main processor.

[0171] The processing process of step 1301 is similar to the processing process of step 501 and will not be repeated here.

[0172] Step 1202: If the decoded broadcast microinstruction does not carry the identifier of the target slave processor, or the identifier of the first slave processor is included in the identifier of the at least one target slave processor carried by the encoded broadcast microinstruction, the first slave processor determines at least one first shuffle group corresponding to the to-be-decoded data block according to the first shuffle level. The first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one decoding stream.

[0173] Optionally, the first slave processor determines, according to the first shuffle level, a processing process of at least one first shuffle group corresponding to the to-be-decoded data block as follows: the first slave processor obtains multiple decoded streams corresponding to the to-be-decoded data block, divides the multiple decoded streams into multiple first shuffle units according to the first shuffle level, and divides the multiple first shuffle units into at least one first shuffle group. The first shuffle unit includes at least one decoded stream, and the first shuffle group includes multiple first shuffle units.

[0174] The processing process of step 1302 is similar to the processing process of step 502 and will not be repeated here.

[0175] Step 1303: determine the encoding length of each first shuffle unit.

[0176] Optionally, for each first shuffle unit in each first shuffle group, the first slave processor determines the total coding length of the to-be-decoded stream blocks in the decoded stream contained in the first shuffle unit as the coding length of the first shuffle unit. In the case where the shuffling process and the decoding process are performed simultaneously, the first slave processor may also determine the total coding length of the to-be-decoded stream blocks and the decoded stream blocks in the decoded stream contained in the first shuffle unit as the coding length of the first shuffle unit.

[0177] The processing process of step 1303 is similar to the processing process of step 503 and will not be repeated here.

[0178] Step 1304: Determine an output shuffle unit and an input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit.

[0179] The processing of step 1304 is similar to that of step 504 and will not be described again here.

[0180] Optional, such as Fig.14 As shown, the first slave processor determines the processing process of the output shuffle unit and the input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit as follows:

[0181] Step 1401, determining the shuffling type of each first shuffling unit according to the encoding length of each first shuffling unit. There are various ways for the first slave processor to determine the shuffling type of each first shuffling unit according to the encoding length of each first shuffling unit. The embodiment of the present application provides two feasible ways, which are as follows:

[0182] Mode 1: For each first shuffle unit, the first slave processor may determine the shuffle type of the first shuffle unit according to the first difference between the code length of the first shuffle unit and the code lengths of other first shuffle units. The specific processing process is as follows:

[0183] Step 1: for each first shuffle unit in each first shuffle unit, determine a first difference between a code length of the first shuffle unit and code lengths of other first shuffle units.

[0184] Example 5: Fig.15 As shown, taking 4 shuffling units as a shuffling group for shuffling, each shuffling unit containing a decoding stream as an example, the coding length of decoding stream 1 is N+5, the coding length of decoding stream 2 is N+9, the coding length of decoding stream 3 is N, and the coding length of decoding stream 4 is N+3, where N is a positive integer, the first difference corresponding to decoding stream 1 is {-4, 5, 2}, the first difference corresponding to decoding stream 2 is {4, 9, 6}, the first difference corresponding to decoding stream 3 is {-5, -9, -3}, and the first difference corresponding to decoding stream 4 is {-2, -6, 3}.

[0185] Step 2: Determine the shuffling type of the first shuffling unit according to the first difference corresponding to the first shuffling unit.

[0186] Step three: if there is a target difference whose absolute value is greater than or equal to the first preset difference threshold value in the first difference corresponding to the first shuffle unit, and the target difference values ​​are all positive numbers, then determine that the shuffle type of the first shuffle unit is a high coding type.

[0187] For example, in Example 5 above, if Fig.15 As shown, the first preset difference threshold is 7, and the shuffle type of the decoded stream 2 is H.

[0188] Step 4: If there is a target difference whose absolute value is greater than or equal to the first preset difference threshold value in the first difference values ​​corresponding to the first shuffle unit, and there is a negative target difference in the target difference values, then determine that the shuffle type of the first shuffle unit is a low coding type.

[0189] For example, in Example 5 above, if Fig.15 As shown, the first preset difference threshold is 7, and the shuffle type of the decoded stream 3 is L.

[0190] Step 5: If there is no target difference value whose absolute value is greater than or equal to the first preset difference threshold value in the first difference values ​​corresponding to the first shuffle unit, it is determined that the shuffle type of the first shuffle unit is a medium coding type.

[0191] For example, in Example 5 above, if Fig.15 As shown, the first preset difference threshold is 7, and the shuffle type of the decoded stream 1 and the decoded stream 4 is M.

[0192] Mode 2: For each first shuffle unit, the first slave processor may determine the shuffle type of the first shuffle unit according to the second difference between the code length of the first shuffle unit and the average code length. The specific processing process is as follows:

[0193] Step 1: Determine the average code length according to the code length of each first shuffle unit.

[0194] Step 2: for each first shuffle unit in each first shuffle unit, determine a second difference between the code length of the first shuffle unit and the average code length.

[0195] Step three: determining the shuffling type of the first shuffling unit according to the second difference corresponding to the first shuffling unit.

[0196] Step 4: If the absolute value of the second difference corresponding to the first shuffle unit is greater than or equal to the second preset difference threshold, and the second difference is a positive number, determine that the shuffle type of the first shuffle unit is a high coding type.

[0197] Step 5: If the absolute value of the second difference corresponding to the first shuffle unit is greater than or equal to the second preset difference threshold, and the second difference is a negative number, determine that the shuffle type of the first shuffle unit is a low coding type.

[0198] Step six: if the absolute value of the second difference corresponding to the first shuffling unit is less than the second preset difference threshold, determine that the shuffling type of the first shuffling unit is the medium coding type.

[0199] The processing process of step 1401 is similar to that of step 601 and will not be repeated here.

[0200] Step 1402: According to the shuffling type of each first shuffling unit and a preset shuffling rule, in each first shuffling unit, an output shuffling unit and an input shuffling unit corresponding to each output shuffling unit are determined.

[0201] Optionally, the first slave processor determines, in each first shuffling unit, a processing process of determining an output shuffling unit and an input shuffling unit corresponding to each output shuffling unit according to the shuffling type of each first shuffling unit and a preset shuffling rule as follows:

[0202] Step 1: If the first number of the first target shuffle units of the high decoding type is greater than the second number of the second target shuffle units of the low decoding type, the second target shuffle unit is determined as the output shuffle unit, and for each output shuffle unit, at least one first target shuffle unit is determined in the first target shuffle unit as the input shuffle unit corresponding to the output shuffle unit.

[0203] Step 2: If the first number of first target shuffle units of the high decoding type is less than or equal to the second number of second target shuffle units of the low decoding type, the first number of second target shuffle units are determined as output shuffle units, and for each output shuffle unit, at least one first target shuffle unit is determined in the first target shuffle unit as the input shuffle unit corresponding to the output shuffle unit.

[0204] The processing process of step 1402 is similar to the processing process of step 602 and will not be repeated here.

[0205] Step 1305 , sending a first preset number of to-be-shuffled stream blocks in the output shuffling unit to the input shuffling unit as the first to-be-decoded stream blocks in the input shuffling unit, so that the first to-be-decoded stream blocks are decoded by the input shuffling unit according to a preset decoding algorithm.

[0206] Optionally, for each output shuffle unit, a second preset number of to-be-shuffled stream blocks in the output shuffle unit are sent to an input shuffle unit corresponding to the output shuffle unit as the first to-be-decoded stream block in the input shuffle unit.

[0207] For example, Fig.16 As shown, shuffling is performed using 4 shuffle units as a shuffle group, and each shuffle unit contains a decoding stream. The shuffle type of decoding streams 1 to 4 is MHLM, then decoding stream 3 is the output shuffle unit, and decoding stream 2 is the input shuffle unit of decoding stream 3. Then decoding stream 1 can output 1 to-be-shuffled stream block to decoding stream 1, decoding stream 3 can output 1 to-be-shuffled stream block to decoding stream 2, and decoding stream 4 can output 1 to-be-shuffled stream block to decoding stream 4. In this way, Fig.17 As shown, after the shuffling is completed, the encoding length of the decoding stream 1 is N+8, the encoding length of the decoding stream 2 is N+9, the encoding length of the decoding stream 3 is N+3, and the encoding length of the decoding stream 4 is N+6. The shuffling type of the decoding stream 1 to the decoding stream 4 is MMMM.

[0208] The processing process of step 1305 is similar to the processing process of step 505 and will not be repeated here.

[0209] As an optional implementation, the first slave processor determines at least one second shuffle group corresponding to the data block to be decoded according to the second shuffle level. The second shuffle group includes a plurality of second shuffle units, and the second shuffle unit includes at least one decoding stream. Then, the first slave processor re-shuffles the stream blocks to be decoded in each second shuffle unit as the stream blocks to be shuffled until the encoding length of each second shuffle unit meets the preset proximity condition.

[0210] In implementation, after the first slave processor shuffles the decoding stream corresponding to the data block to be decoded according to the first shuffling level, the first slave processor may further determine at least one second shuffling group corresponding to the data block to be decoded according to the second shuffling level. The second shuffling group includes a plurality of second shuffling units, and the second shuffling unit includes at least one decoding stream. The processing process of the first slave processor determining at least one second shuffling group corresponding to the data block to be decoded according to the second shuffling level is similar to step 1301, and will not be repeated here. Then, the first slave processor can re-shuffle the stream blocks to be decoded in each second shuffling unit as the stream blocks to be shuffled until the encoding length of each second shuffling unit meets the preset proximity condition.

[0211] It should be noted that after the first slave processor shuffles the decoded stream corresponding to the data block to be decoded according to the second shuffle level, it can further shuffle the decoded stream corresponding to the data block to be decoded according to the third shuffle level. For example, the first slave processor can shuffle the decoded stream corresponding to the data block to be decoded according to shuffle level 1-shuffle level 2-shuffle level 3, or shuffle the decoded stream corresponding to the data block to be decoded according to shuffle level 1-shuffle level 3-shuffle level 2, or shuffle the decoded stream corresponding to the data block to be decoded according to shuffle level 2-shuffle level 3-shuffle level 1.

[0212] As an optional implementation, when the first slave processor detects that decoding of a first decoded stream among multiple decoded streams is completed, a second preset number of to-be-decoded stream blocks in a second decoded stream that has not been decoded among the multiple decoded streams are sent to the first decoded stream as to-be-decoded stream blocks in the first decoded stream.

[0213] In implementation, in order to further balance the coding length of each decoding stream and improve the decoding rate when decoding small data blocks. A third preset number may be pre-stored in the first slave processor. The third preset number may be set by a technician based on experience. When the first slave processor detects that the decoding of the first decoding stream among multiple decoding streams is completed (that is, the first decoding stream outputs the decoding stream end (StreamFinish) mark), the third preset number of to-be-decoded stream blocks in the second decoding stream that has not been decoded in the multiple decoding streams may be sent to the first decoding stream as the to-be-decoded stream blocks in the first decoding stream. Among them, the second decoding stream may be all the decoding streams that have not been decoded in the multiple decoding streams, or may be some of the decoding streams that have not been decoded in the multiple decoding streams.

[0214] As an optional implementation manner, the process of obtaining the decoded stream from the first slave processor is as follows:

[0215] Step 1: Obtain the encoding header data corresponding to the data to be decoded.

[0216] In implementation, for a coded data block, such as Fig.10 As shown, the first slave processor uses a header-data block mapping form for storage. When the first slave processor needs to obtain the data to be decoded, the first slave processor needs to first obtain the encoding header data corresponding to the data to be decoded. Fig.18 As shown, the format of the encoding header data is a two-dimensional format, with the low dimension being X and the high dimension being Y, and the size of the encoding header data is the low-dimensional encoding header size (head size X)*the high-dimensional encoding header size (head size Y). The encoding header data can be further evenly divided into multiple encoding header blocks in two dimensions.

[0217] Step 2: According to the received decoding broadcast microinstruction, in the encoding header data, a decoding area corresponding to the decoding broadcast microinstruction and including at least one encoding header block is determined, and at least one to-be-decoded data block corresponding to the at least one encoding header block is obtained. The encoding header block includes a storage address of an encoding data block corresponding to the encoding header block.

[0218] In implementation, after the first slave processor obtains the encoding header data, it can determine the decoding area including at least one encoding header block corresponding to the decoding broadcast microinstruction in the encoding header data according to the received decoding broadcast microinstruction. Fig.18As shown, the starting address of the decoding area is the starting position of the coding head (head start), which can be obtained by the low-dimensional coding head offset (head offset X) and the high-dimensional coding head offset (head offset Y). The decoding area contains the number of low-dimensional coding heads (head number X) coding head blocks in the low-dimensional direction, and the number of high-dimensional coding heads (head number Y) coding head blocks in the high-dimensional direction. Among them, the coding head block contains the storage address of the coded data block corresponding to the coding head block. After the first slave processor obtains the decoding area, for each coding head block in the decoding area, the first slave processor can obtain the data block to be decoded according to the storage address of the coded data block stored in the coding head block.

[0219] Step three: for each data block to be decoded in at least one data block to be decoded, divide the data block to be decoded into multiple stream blocks, and send the multiple stream blocks to multiple decoding streams corresponding to the data block to be decoded as stream blocks to be shuffled in the multiple decoding streams.

[0220] In implementation, in order to improve the throughput of decoding, the first slave processor may decode the same data block to be decoded in parallel through multiple decoding streams. Similarly, when the first slave processor performs shuffling, for each data block to be decoded, the first slave processor may divide the data block to be decoded into multiple stream blocks, and send the multiple stream blocks to the multiple decoding streams corresponding to the data block to be decoded as stream blocks to be shuffled in the multiple decoding streams. Optionally, the first slave processor may divide the data block to be decoded into multiple row sequences, each row sequence containing at least one data sub-block to be decoded. Then, for each data sub-block to be decoded in each row sequence, the first slave processor may divide the data sub-block to be decoded into multiple stream blocks. In this way, it can be ensured that the number of stream blocks in each decoding stream is similar.

[0221] Optionally, in the packaged format, the data block to be decoded consists of encoded data, and the size of the encoded data is equal to the size of the encoded data in the data block to be encoded.

[0222] In implementation, Fig.10 As shown, in the packing format, the decoded data blocks are stored closely, each decoded data block is composed of coded data, and the size of the coded data is equal to the size of the coded data in the coded data block after being coded. That is, the space occupied by the decoded data block is the actual size of the coded data block after being coded.

[0223] Optionally, in a non-packed format, the data block to be decoded consists of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the data block to be encoded.

[0224] In implementation, Fig.10As shown, in the non-packed format, each decoded data block consists of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the data block to be encoded. That is, each decoded data block occupies the same space and is equal to the size of a complete data block to be encoded before encoding. Among them, the first part is the coded data, and the second part is the reserved padding data.

[0225] Optionally, the data block to be decoded is composed of coded data sub-blocks corresponding to multiple source data sub-blocks belonging to the same source data block. In a packed format, the coded data sub-block is composed of coded data, and the size of the coded data is equal to the size of the coded data in the source data sub-block after encoding. In a non-packed format, the coded data sub-block is composed of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the source data sub-block.

[0226] In implementation, when the first slave processor determines multiple coding areas in the source data according to different coding broadcast microinstructions, it may divide a complete source data block into multiple source data sub-blocks. The coding areas corresponding to the coding broadcast microinstructions are on the adjacent side, and either they all encode complete source data blocks, and the source data blocks do not overlap each other; or they each encode a part of the same source data block (that is, source data sub-blocks), and the boundaries of the source data sub-blocks in the source data block just overlap. Fig.11 As shown, the four coding areas determined by the four coding broadcast microinstructions in the source data divide part of the source data block (represented by gray oblique line blocks) into multiple source data sub-blocks, and the boundaries of each source data sub-block in the same source data block just overlap. The first slave processor encodes each source data sub-block in the same source data block according to different coding broadcast microinstructions to obtain coded data sub-blocks. When the first slave processor stores the coded data sub-blocks corresponding to the multiple source data sub-blocks in the same source data block, the coded data sub-blocks can be stored in the same coded data block. In this way, multiple coding broadcast microinstructions can be realized to collaboratively complete the splicing of specific coding areas, and the effect is exactly the same as encoding through one coding broadcast microinstruction, and the execution order of these coding broadcast microinstructions can be arbitrary or even concurrently executed, so that the coding task can be divided in the case of multi-core source data division and block division for pipeline execution within a single core.

[0227] like Fig. 12A As shown in , a source data block is divided into two parts in both low-dimensional and high-dimensional dimensions, so that the source data block is divided into four source data sub-blocks, namely TL (top-left), TR (top-right), BL (bottom-left) and BR (bottom-right). The size of each source data sub-block is as follows: Fig. 12AAs shown, the first slave processor can be specified by four parameters, block left, block right, block top, and block bottom, inside the source data block. Each source data sub-block can be coded data or non-coded data. In the coded data block in the non-packed format, the above-mentioned 4 source data sub-blocks corresponding to the 4 coded data sub-blocks can be stored in a fixed order of TL-TR-BL-BR, and each coded data sub-block consists of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the source data sub-block. That is, the space occupied by each coded data sub-block is the size of the source data sub-block corresponding to the coded data sub-block before encoding. In this way, the space of the coded data block is the same as the size of the source data block, thereby ensuring that if each source data sub-block of the source data block is encoded by different coded broadcast microinstructions, each coded broadcast microinstruction can calculate the address of the coded data sub-block it is responsible for based on the partition information (which can be calculated through the instruction domain), thereby realizing the splicing of the results of multiple coded broadcast microinstructions.

[0228] like Fig. 12A As shown, the first slave processor can convert the coded data block in the non-packed format into the coded data block in the packed format by means of coding move (Move) and the like. In the coded data block in the packed format, each coded data sub-block is composed of coded data, and the size of the coded data is equal to the size of the coded data in the source data sub-block after being coded. Among them, the coded data sub-blocks are stored closely, and the starting address of each coded data sub-block needs to be accumulated according to the actual size of the previous coded data sub-block, and the space occupied by the entire coded data block is the sum of the sizes of all coded data sub-blocks.

[0229] like Fig. 12B As shown, a source data block is divided into two parts in high dimension, so that the source data block is divided into two source data sub-blocks, namely TL and BL, or BL and BR. Fig. 12C As shown, a source data block is divided into two parts in a low dimension, so that the source data block is divided into two source data sub-blocks, namely TL and TR, or TR and BR.

[0230] A source data block is not divided in low dimension or high dimension, and has only one source data sub-block, which can be TL, TR, BL or BR. Fig.12D As shown, a source data block has only one source data sub-block TL.

[0231] Optionally, the data division during decoding may be different from that during encoding. When the data division of the decoded broadcast microinstruction is not aligned with the division of the encoded data block, there will be a boundary data block during encoding. For the boundary data block, if it only has the TL part, then if this part is in the form of unencoded source data, then only the required part can be read out. If it is in the form of encoded encoded data, then the entire encoded data block needs to be decompressed and only the required part is written to the destination address. If the boundary data block itself contains four parts and is different from the division during encoding, then there will be a further division of the four encoded data sub-blocks. Fig.19 As shown, the solid-line box represents the data division during encoding, and the dotted-line box represents the data division during decoding. Their division points are different, so that the data block to be decoded during decoding may be a part of an encoded data block, such as the TL block represented by the left-slashed square, or it may be a part of up to 4 sub-data blocks, such as the BR block represented by the vertical-lined square.

[0232] This division has Fig. 20 The four cases shown correspond to different positional relationships between the intersection points of the decoding partitions and the encoding partitions. Considering that four different data blocks (TL, TR, BL, BR) need to be taken for decoding in each case, there are a total of 16 different data blocks for decoding. Only the most general case is considered here. Other cases where the partitions are less than 4 blocks or the partitions are aligned during encoding and decoding can be regarded as special cases of these four cases.

[0233] The embodiment of the present application provides a shuffling method. The first slave processor determines at least one first shuffle group corresponding to the data block to be decoded according to the first shuffle level. The first shuffle group includes multiple first shuffle units, and the first shuffle unit includes at least one decoding stream. Then, the first slave processor determines the coding length of each first shuffle unit, and determines the output shuffle unit and the input shuffle unit in each first shuffle unit according to the coding length of each first shuffle unit. After that, the first slave processor sends the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream block to be decoded in the input shuffle unit, so that the first stream block to be decoded is decoded by the input shuffle unit according to the preset decoding algorithm. In this way, by shuffling the decoding streams of the data block to be decoded, the coding lengths of the decoding streams can be guaranteed to be similar, thereby avoiding excessive complements caused by the alignment requirements between the decoding streams, thereby reducing the decoding stream. At the same time, deadlock between the decoding streams can also be avoided. In addition, for different decoding broadcast microinstructions, the main processor can send different decoding broadcast microinstructions to different slave processor groups including multiple slave processors, and each slave processor group only decodes and processes the encoded data blocks in the decoding area corresponding to the received decoding broadcast microinstruction, so that multiple slave processor groups can decode and process the same encoded data at the same time, thereby improving the decoding efficiency, and, for the same decoding broadcast microinstruction, the main processor can send the decoding broadcast microinstruction to different slave processors, and multiple slave processors jointly decode and process all the encoded data blocks in the decoding area corresponding to the received decoding broadcast microinstruction, so that multiple slave processors can decode and process the encoded data blocks in the same decoding area at the same time, thereby further improving the decoding efficiency.

[0234] The embodiment of the present application also provides a computing device, including: a main processor and a plurality of slave processors connected to the main processor;

[0235] The master processor is used to receive source data and send the source data to the multiple slave processors;

[0236] The multiple slave processors are used to encode the to-be-encoded data blocks corresponding to the encoding broadcast microinstructions using the above method according to the encoding broadcast microinstructions to obtain the encoded data blocks, and transmit the encoded data blocks to the master processor;

[0237] The main processor is further used to determine the coded data corresponding to the source data according to each coded data block.

[0238] As an optional implementation, the computing device further includes a branch processor located between the main processor and the slave processor.

[0239] The branch processor is used for data forwarding between the main processor and the slave processor.

[0240] As an optional implementation, the master processor includes a control module and a master on-chip storage module, and the slave processor includes a computing module;

[0241] The control module is used to decode the machine instructions received by the master processor into coded broadcast microinstructions, use the coded broadcast microinstructions to control the slave processor to perform operations according to the source data in the master on-chip storage module, and write the data into the off-chip storage module;

[0242] The control module includes an encoding unit, and the encoding unit is used to execute the encoded broadcast microinstruction.

[0243] As an optional implementation, the master processor includes a control module, and the slave processor includes a computing module and a slave on-chip storage module.

[0244] The control module is used to decode the machine instructions received by the master processor into coded broadcast microinstructions, use the coded broadcast microinstructions to control the slave processor to perform operations according to the source data in the slave on-chip storage module, and write the data into the off-chip storage module;

[0245] The control module includes an encoding unit, and the encoding unit is used to execute the encoded broadcast microinstruction.

[0246] As an optional implementation, the master processor is further configured to send the encoding broadcast microinstruction to the slave processor to instruct the slave processor to execute an encoding process.

[0247] The embodiment of the present application also provides a computing device, including: a main processor and a plurality of slave processors connected to the main processor;

[0248] The master processor is configured to receive the encoded data and send the encoded data to the plurality of slave processors;

[0249] The multiple slave processors are used to decode the to-be-decoded data blocks corresponding to the decoded broadcast microinstructions using the above method according to the decoded broadcast microinstructions to obtain decoded data blocks, and transmit the decoded data blocks to the master processor;

[0250] The main processor is further used to determine source data corresponding to the encoded data according to each decoded data block.

[0251] As an optional implementation, the computing device further includes a branch processor located between the main processor and the slave processor.

[0252] The branch processor is used for data forwarding between the main processor and the slave processor.

[0253] As an optional implementation, the master processor includes a control module and a master on-chip storage module, and the slave processor includes a computing module;

[0254] The control module is used to decode the machine instructions received by the master processor into decoded broadcast microinstructions, use the decoded broadcast microinstructions to control the slave processor to perform operations according to the encoded data in the master on-chip storage module, and write the encoded data into the off-chip storage module;

[0255] The control module includes a decoding unit, and the decoding unit is used to execute the decoded broadcast microinstruction.

[0256] As an optional implementation, the master processor includes a control module, and the slave processor includes a computing module and a slave on-chip storage module.

[0257] The control module is used to decode the machine instructions received by the master processor into decoded broadcast microinstructions, and use the decoded broadcast microinstructions to control the slave processor to perform operations according to the encoded data in the slave on-chip storage module, and write the encoded data into the off-chip storage module;

[0258] The control module includes a decoding unit, and the decoding unit is used to execute the decoded broadcast microinstruction.

[0259] As an optional implementation, the master processor is further configured to send the decoding broadcast microinstruction to the slave processor to instruct the slave processor to execute a decoding process.

[0260] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should know that the present disclosure is not limited by the order of the actions described, because according to the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.

[0261] It should be further explained that although Figure 2 The steps in the flowchart of -4 are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-At least part of the steps in 4 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0262] It should be understood that the above-mentioned device embodiments are only illustrative, and the device disclosed herein may also be implemented in other ways. For example, the division of units / modules described in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components may be combined, or may be integrated into another system, or some features may be ignored or not executed.

[0263] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present disclosure may be integrated into one unit / module, or each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.

[0264] If the integrated unit / module is implemented in the form of hardware, the hardware can be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. If not specifically stated, the artificial intelligence processor can be any appropriate hardware processor, such as CPU, GPU, FPGA, DSP, and ASIC, etc. If not specifically stated, the storage unit can be any appropriate magnetic storage medium or magneto-optical storage medium, such as resistive random access memory RRAM (Resistive Random Access Memory), dynamic random access memory DRAM (Dynamic Random Access Memory), static random access memory SRAM (Static Random-Access Memory), enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), high-bandwidth memory HBM (High-Bandwidth Memory), hybrid memory cube HMC (Hybrid Memory Cube), etc.

[0265] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution disclosed herein is essentially or partly contributed to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and contains several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the disclosure. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0266] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0267] The foregoing content can be better understood in accordance with the following terms:

[0268] Clause A1, corresponding right 1; Clause A2, corresponding right 2; Clause A3, corresponding right 3; Clause A4, corresponding right 4; Clause A5, corresponding right 5; Clause A6, corresponding right 6; Clause A7, corresponding right 7; Clause A8, corresponding right 8; Clause A9, corresponding right 9; Clause A10, corresponding right 10; Clause A11, corresponding right 11; Clause A12, corresponding right 12; Clause A13, corresponding right 13; Clause A14, corresponding right 14; Clause A15, corresponding right 15; Clause A16, corresponding right 16; Clause A17, corresponding right 17; Clause A18, corresponding right 18; Clause A19, corresponding right 19; Clause A20, corresponding right 20; Clause A21, corresponding right 21; Clause A22, corresponding right 22; Clause A23, corresponding right 23; Clause A A24, corresponding right 24; clause A25, corresponding right 25; clause A26, corresponding right 26; clause A27, corresponding right 27; clause A28, corresponding right 28; clause A29, corresponding right 29; clause A30, corresponding right 30; clause A31, corresponding right 31; clause A32, corresponding right 32; clause A33, corresponding right 33; clause A34, corresponding right 34; clause A35, corresponding right 35; clause A36, corresponding right 36; clause A37, corresponding right 37; clause A38, corresponding right 38; clause A39, corresponding right 39; clause A40, corresponding right 40; clause A41, corresponding right 41; clause A42, corresponding right 42; clause A43, corresponding right 43; clause A44, corresponding right 44; clause A45, corresponding right 45.

[0269] For example, clause A1, a shuffling method, the method being applied to a first slave processor in a master-slave processor architecture, the method comprising:

[0270] receiving a coded broadcast microinstruction sent by a master processor, wherein the coded broadcast microinstruction carries identifiers of multiple target slave processors;

[0271] If the encoding broadcast microinstruction does not carry the identifier of the target slave processor, or the identifier of the first slave processor is included in at least one identifier of the target slave processor carried by the encoding broadcast microinstruction, the first slave processor determines, according to the first shuffling level, at least one first shuffling group corresponding to the to-be-encoded data block, the first shuffling group includes a plurality of first shuffling units, and the first shuffling unit includes at least one encoding stream;

[0272] Determining the code length of each first shuffle unit;

[0273] According to the code length of each of the first shuffling units, determining an output shuffling unit and an input shuffling unit in each of the first shuffling units;

[0274] A first preset number of to-be-shuffled stream blocks in the output shuffling unit are sent to the input shuffling unit as first to-be-encoded stream blocks in the input shuffling unit, so that the first to-be-encoded stream blocks are encoded by the input shuffling unit according to a preset encoding algorithm.

[0275] Clause A2. The method according to clause A1, wherein determining, according to the first shuffling level, at least one first shuffling group corresponding to the to-be-encoded data block comprises:

[0276] Obtain multiple encoding streams corresponding to the data block to be encoded;

[0277] According to a first shuffle level, the plurality of coded streams are divided into a plurality of first shuffle units, and the plurality of first shuffle units are divided into at least one first shuffle group, wherein the first shuffle unit contains at least one coded stream, and the first shuffle group contains a plurality of first shuffle units.

[0278] Clause A3. The method according to clause A1, wherein determining the encoding length of each first shuffle unit comprises:

[0279] For each first shuffle unit in each first shuffle group, the total coding length of the to-be-coded stream blocks in the coded stream included in the first shuffle unit is determined as the coding length of the first shuffle unit.

[0280] Clause A4. The method according to clause A1, wherein the step of determining an output shuffle unit and an input shuffle unit in each of the first shuffle units according to the encoding length of each of the first shuffle units comprises:

[0281] Determining a shuffling type of each of the first shuffling units according to the code length of each of the first shuffling units;

[0282] According to the shuffling types of the first shuffling units and the preset shuffling rules, in the first shuffling units, an output shuffling unit and an input shuffling unit corresponding to each output shuffling unit are determined;

[0283] The step of sending the first preset number of to-be-shuffled stream blocks in the output shuffling unit to the input shuffling unit as the first to-be-encoded stream blocks in the input shuffling unit comprises:

[0284] For each output shuffle unit, a second preset number of to-be-shuffled stream blocks in the output shuffle unit are sent to an input shuffle unit corresponding to the output shuffle unit as the first to-be-encoded stream block in the input shuffle unit.

[0285] Clause A5. The method according to clause A4, wherein determining the shuffling type of each of the first shuffling units according to the encoding length of each of the first shuffling units comprises:

[0286] For each of the first shuffling units, determining a first difference between a code length of the first shuffling unit and code lengths of other first shuffling units;

[0287] A shuffling type of the first shuffling unit is determined according to a first difference value corresponding to the first shuffling unit.

[0288] Clause A6. The method according to clause A5, wherein determining the shuffle type of the first shuffle unit according to the first difference corresponding to the first shuffle unit comprises:

[0289] If there is a target difference whose absolute value is greater than or equal to the first preset difference threshold value in the first difference value corresponding to the first shuffle unit, and the target difference values ​​are all positive numbers, then determining that the shuffle type of the first shuffle unit is a high coding type;

[0290] If there is a target difference whose absolute value is greater than or equal to a first preset difference threshold value in the first difference values ​​corresponding to the first shuffle unit, and there is a negative target difference in the target difference values, it is determined that the shuffle type of the first shuffle unit is a low coding type.

[0291] Clause A7. The method according to clause A6, further comprising:

[0292] If there is no target difference value whose absolute value is greater than or equal to the first preset difference threshold value in the first difference values ​​corresponding to the first shuffle unit, it is determined that the shuffle type of the first shuffle unit is the medium coding type.

[0293] Clause A8. The method according to clause A4, wherein determining the shuffling type of each of the first shuffling units according to the encoding length of each of the first shuffling units comprises:

[0294] Determining an average code length according to the code lengths of the first shuffle units;

[0295] For each of the first shuffling units, determining a second difference between a code length of the first shuffling unit and the average code length;

[0296] A shuffling type of the first shuffling unit is determined according to the second difference value corresponding to the first shuffling unit.

[0297] Clause A9. The method according to clause A8, wherein determining the shuffle type of the first shuffle unit according to the second difference corresponding to the first shuffle unit comprises:

[0298] If the absolute value of the second difference corresponding to the first shuffling unit is greater than or equal to the second preset difference threshold, and the second difference is a positive number, determining that the shuffling type of the first shuffling unit is a high coding type;

[0299] If the absolute value of the second difference corresponding to the first shuffle unit is greater than or equal to the second preset difference threshold, and the second difference is a negative number, it is determined that the shuffle type of the first shuffle unit is a low coding type.

[0300] Clause A10. The method according to clause A9, further comprising:

[0301] If the absolute value of the second difference corresponding to the first shuffling unit is less than the second preset difference threshold, it is determined that the shuffling type of the first shuffling unit is the medium coding type.

[0302] Clause A11. The method according to clause A4, wherein, according to the shuffling type of each of the first shuffling units and the preset shuffling rule, in each of the first shuffling units, an output shuffling unit and an input shuffling unit corresponding to each of the output shuffling units are determined, comprising:

[0303] If the first number of the first target shuffle units of the high coding type is less than or equal to the second number of the second target shuffle units of the low coding type, the first target shuffle unit is determined as the output shuffle unit, and for each output shuffle unit, at least one second target shuffle unit is determined in the second target shuffle unit as the input shuffle unit corresponding to the output shuffle unit;

[0304] If the first number of first target shuffle units of the high coding type is greater than the second number of second target shuffle units of the low coding type, the second number of first target shuffle units are determined as output shuffle units, and for each output shuffle unit, in the second target shuffle unit, at least one second target shuffle unit is determined as the input shuffle unit corresponding to the output shuffle unit.

[0305] Clause A12. The method according to clause A1, further comprising:

[0306] Obtain source data to be encoded;

[0307] According to the received encoding broadcast microinstruction, in the source data, determining an encoding region corresponding to the encoding broadcast microinstruction, wherein the encoding region includes at least one data block to be encoded, and the data block to be encoded is a source data block or a source data sub-block;

[0308] For each data block to be encoded in the at least one data block to be encoded, the data block to be encoded is divided into multiple stream blocks, and the multiple stream blocks are sent to multiple encoding streams corresponding to the data block to be encoded as stream blocks to be shuffled in the multiple encoding streams.

[0309] Clause A13. The method according to clause A1, further comprising:

[0310] When it is detected that the encoding of a first encoded stream among multiple encoded streams is completed, a fourth preset number of to-be-encoded stream blocks in a second encoded stream that has not been completely encoded among the multiple encoded streams are sent to the first encoded stream as to-be-encoded stream blocks in the first encoded stream.

[0311] Clause A14. The method according to clause A1, further comprising:

[0312] If the total encoding length of the to-be-encoded stream blocks in each first shuffle group is greater than the original length of the to-be-encoded data block, the encoding process of the to-be-encoded data block is terminated.

[0313] Clause A15. A method according to clause A1, comprising:

[0314] Determine, according to the second shuffling level, at least one second shuffling group corresponding to the to-be-encoded data block, wherein the second shuffling group includes a plurality of second shuffling units, and the second shuffling unit includes at least one encoding stream;

[0315] The to-be-encoded stream blocks in each second shuffling unit are used as to-be-shuffled stream blocks and shuffled again until the encoding length of each second shuffling unit meets a preset proximity condition.

[0316] Clause A16. The method according to clause A1, wherein encoding the first to-be-encoded stream block according to a preset encoding algorithm by the input shuffling unit comprises:

[0317] Encoding the preset characters contained in the first to-be-encoded stream block according to a first encoding rule corresponding to the preset characters to obtain first encoded data;

[0318] The first coded data is encoded according to a preset second coding rule.

[0319] Clause A17. The method according to clause A12, further comprising:

[0320] Generate a coding header block for a coded data block corresponding to each to-be-coded data block, wherein the coding header block includes a storage address of the coded data block corresponding to the coding header block;

[0321] Each encoding header block is stored, and each encoding data block is stored after each encoding header block.

[0322] Clause A18. A method according to clause A17, wherein the coded data block is composed of coded data, and the size of the coded data is equal to the size of the coded data in the coded data block after being coded; or

[0323] The coded data block consists of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the data block to be coded.

[0324] Clause A19. A method according to clause A17, wherein the coded data block is composed of coded data sub-blocks corresponding to multiple source data sub-blocks belonging to the same source data block;

[0325] The coded data sub-block is composed of coded data, and the size of the coded data is equal to the size of the to-be-coded data in the source data sub-block after being coded; or

[0326] The coded data sub-block consists of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the source data sub-block.

[0327] Clause A20. A shuffling method, the method being applied to a first slave processor in a master-slave processor architecture, the method comprising:

[0328] receiving a decoded broadcast microinstruction sent by a master processor, wherein the decoded broadcast microinstruction carries identifiers of multiple target slave processors;

[0329] If the decoding broadcast microinstruction does not carry the identifier of the target slave processor, or the identifier of the first slave processor is included in at least one identifier of the target slave processor carried by the encoding broadcast microinstruction, the first slave processor determines, according to the first shuffling level, at least one first shuffling group corresponding to the to-be-decoded data block, the first shuffling group includes a plurality of first shuffling units, and the first shuffling unit includes at least one decoding stream;

[0330] Determining the code length of each first shuffle unit;

[0331] According to the code length of each of the first shuffling units, determining an output shuffling unit and an input shuffling unit in each of the first shuffling units;

[0332] A first preset number of to-be-shuffled stream blocks in the output shuffling unit are sent to the input shuffling unit as first to-be-decoded stream blocks in the input shuffling unit, so that the first to-be-decoded stream blocks are decoded by the input shuffling unit according to a preset decoding algorithm.

[0333] Clause A21. The method according to clause A20, wherein determining, according to the first shuffling level, at least one first shuffling group corresponding to the to-be-decoded data block comprises:

[0334] Obtain multiple decoding streams corresponding to the data blocks to be decoded;

[0335] According to a first shuffle level, the plurality of decoded streams are divided into a plurality of first shuffle units, and the plurality of first shuffle units are divided into at least one first shuffle group, wherein the first shuffle unit includes at least one decoded stream, and the first shuffle group includes a plurality of first shuffle units.

[0336] Clause A22. The method according to clause A20, wherein determining the encoding length of each first shuffle unit comprises:

[0337] For each first shuffle unit in each first shuffle group, the total coding length of the to-be-decoded stream blocks in the decoded stream contained in the first shuffle unit is determined as the coding length of the first shuffle unit.

[0338] Clause A23. The method according to clause A20, wherein, according to the encoding length of each of the first shuffle units, determining an output shuffle unit and an input shuffle unit in each of the first shuffle units comprises:

[0339] Determining a shuffling type of each of the first shuffling units according to the code length of each of the first shuffling units;

[0340] According to the shuffling types of the first shuffling units and the preset shuffling rules, in the first shuffling units, an output shuffling unit and an input shuffling unit corresponding to each output shuffling unit are determined;

[0341] The step of sending the first preset number of to-be-shuffled stream blocks in the output shuffling unit to the input shuffling unit as the first to-be-decoded stream blocks in the input shuffling unit comprises:

[0342] For each output shuffle unit, a second preset number of to-be-shuffled stream blocks in the output shuffle unit are sent to an input shuffle unit corresponding to the output shuffle unit as the first to-be-decoded stream blocks in the input shuffle unit.

[0343] Clause A24. The method according to clause A23, wherein determining the shuffling type of each of the first shuffling units according to the encoding length of each of the first shuffling units comprises:

[0344] For each of the first shuffling units, determining a first difference between a code length of the first shuffling unit and code lengths of other first shuffling units;

[0345] A shuffling type of the first shuffling unit is determined according to a first difference value corresponding to the first shuffling unit.

[0346] Clause A25. The method according to clause A24, wherein determining the shuffle type of the first shuffle unit according to the first difference corresponding to the first shuffle unit comprises:

[0347] If there is a target difference whose absolute value is greater than or equal to the first preset difference threshold value in the first difference value corresponding to the first shuffle unit, and the target difference values ​​are all positive numbers, then determining that the shuffle type of the first shuffle unit is a high coding type;

[0348] If there is a target difference whose absolute value is greater than or equal to a first preset difference threshold value in the first difference values ​​corresponding to the first shuffle unit, and there is a negative target difference in the target difference values, it is determined that the shuffle type of the first shuffle unit is a low coding type.

[0349] Clause A26. A method according to clause A25, further comprising:

[0350] If there is no target difference value whose absolute value is greater than or equal to the first preset difference threshold value in the first difference values ​​corresponding to the first shuffle unit, it is determined that the shuffle type of the first shuffle unit is the medium coding type.

[0351] Clause A27. A method according to clause A23, wherein determining the shuffling type of each of the first shuffling units according to the encoding length of each of the first shuffling units comprises:

[0352] Determining an average code length according to the code lengths of the first shuffle units;

[0353] For each of the first shuffling units, determining a second difference between a code length of the first shuffling unit and the average code length;

[0354] A shuffling type of the first shuffling unit is determined according to the second difference value corresponding to the first shuffling unit.

[0355] Clause A28. The method according to clause A27, wherein determining the shuffle type of the first shuffle unit according to the second difference corresponding to the first shuffle unit comprises:

[0356] If the absolute value of the second difference corresponding to the first shuffling unit is greater than or equal to the second preset difference threshold, and the second difference is a positive number, determining that the shuffling type of the first shuffling unit is a high coding type;

[0357] If the absolute value of the second difference corresponding to the first shuffle unit is greater than or equal to the second preset difference threshold, and the second difference is a negative number, it is determined that the shuffle type of the first shuffle unit is a low coding type.

[0358] Clause A29. A method according to clause A28, further comprising:

[0359] If the absolute value of the second difference corresponding to the first shuffling unit is less than the second preset difference threshold, it is determined that the shuffling type of the first shuffling unit is the medium coding type.

[0360] Clause A30. The method according to clause A23, wherein, according to the shuffling type of each of the first shuffling units and the preset shuffling rule, in each of the first shuffling units, an output shuffling unit and an input shuffling unit corresponding to each of the output shuffling units are determined, comprising:

[0361] If the first number of the first target shuffle units of the high decoding type is greater than the second number of the second target shuffle units of the low decoding type, the second target shuffle units are determined as output shuffle units, and for each output shuffle unit, at least one first target shuffle unit is determined in the first target shuffle unit as an input shuffle unit corresponding to the output shuffle unit;

[0362] If the first number of first target shuffle units of the high decoding type is less than or equal to the second number of second target shuffle units of the low decoding type, the first number of second target shuffle units are determined as output shuffle units, and for each output shuffle unit, in the first target shuffle unit, at least one first target shuffle unit is determined as the input shuffle unit corresponding to the output shuffle unit.

[0363] Clause A31. A method according to clause A20, further comprising:

[0364] Obtain the encoding header data corresponding to the data to be decoded;

[0365] According to the received decoding broadcast microinstruction, in the encoding header data, a decoding area corresponding to the decoding broadcast microinstruction and including at least one encoding header block is determined, and at least one to-be-decoded data block corresponding to the at least one encoding header block is obtained, wherein the encoding header block includes a storage address of an encoding data block corresponding to the encoding header block;

[0366] For each data block to be decoded in the at least one data block to be decoded, the data block to be decoded is divided into multiple stream blocks, and the multiple stream blocks are sent to multiple decoding streams corresponding to the data block to be decoded as stream blocks to be shuffled in the multiple decoding streams.

[0367] Clause A32. A method according to clause A31, wherein the data block to be decoded is composed of coded data, and the size of the coded data is equal to the size of the coded data in the data block to be encoded; or

[0368] The data block to be decoded consists of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the data block to be encoded.

[0369] Clause A33. A method according to clause A31, wherein the data block to be decoded is composed of coded data sub-blocks corresponding to multiple source data sub-blocks belonging to the same source data block;

[0370] The coded data sub-block is composed of coded data, and the size of the coded data is equal to the size of the to-be-coded data in the source data sub-block after being coded; or

[0371] The coded data sub-block consists of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the source data sub-block.

[0372] Clause A34. A method according to clause A20, further comprising:

[0373] When it is detected that decoding of a first decoded stream among multiple decoded streams is completed, a second preset number of to-be-decoded stream blocks in a second decoded stream that has not been decoded among the multiple decoded streams are sent to the first decoded stream as to-be-decoded stream blocks in the first decoded stream.

[0374] Clause A35. A method according to clause A20, further comprising:

[0375] Determine, according to the second shuffling level, at least one second shuffling group corresponding to the to-be-decoded data block, wherein the second shuffling group includes a plurality of second shuffling units, and the second shuffling unit includes at least one decoding stream;

[0376] The to-be-decoded stream blocks in each second shuffling unit are used as to-be-shuffled stream blocks and shuffled again until the encoding length of each second shuffling unit meets a preset proximity condition.

[0377] Clause A36. A computing device comprising: a master processor and a plurality of slave processors connected to the master processor;

[0378] The master processor is used to receive source data and send the source data to the multiple slave processors;

[0379] The multiple slave processors are used to encode the to-be-encoded data block corresponding to the encoding broadcast microinstruction using the method described in any one of clauses A1 to A19 according to the encoding broadcast microinstruction to obtain the encoded data block, and transmit the encoded data block to the master processor;

[0380] The main processor is further used to determine the coded data corresponding to the source data according to each coded data block.

[0381] Clause A37. A computing device according to clause A36, wherein the computing device further comprises a branch processor located between the master processor and the slave processor,

[0382] The branch processor is used for data forwarding between the main processor and the slave processor.

[0383] Clause A38. The computing device according to clause A36, wherein the master processor comprises a control module and a master on-chip storage module, and the slave processor comprises a computing module;

[0384] The control module is used to decode the machine instructions received by the master processor into coded broadcast microinstructions, use the coded broadcast microinstructions to control the slave processor to perform operations according to the source data in the master on-chip storage module, and write the data into the off-chip storage module;

[0385] The control module includes an encoding unit, and the encoding unit is used to execute the encoded broadcast microinstruction.

[0386] Item A39. According to the computing device described in Item A36, the main processor includes a control module, and the slave processor includes a computing module and a slave on-chip storage module.

[0387] The control module is used to decode the machine instructions received by the master processor into coded broadcast microinstructions, use the coded broadcast microinstructions to control the slave processor to perform operations according to the source data in the slave on-chip storage module, and write the data into the off-chip storage module;

[0388] The control module includes an encoding unit, and the encoding unit is used to execute the encoded broadcast microinstruction.

[0389] Item A40. In the computing device according to Item A38 or Item A39, the main processor is further used to send the encoding broadcast microinstruction to the slave processor to instruct the slave processor to execute the encoding process.

[0390] Clause A41. A computing device comprising: a master processor and a plurality of slave processors connected to the master processor;

[0391] The master processor is configured to receive the encoded data and send the encoded data to the plurality of slave processors;

[0392] The plurality of slave processors are configured to decode the to-be-decoded data blocks corresponding to the decoded broadcast microinstructions using the method described in any one of clauses A20 to A35 according to the decoded broadcast microinstructions to obtain decoded data blocks, and transmit the decoded data blocks to the master processor;

[0393] The main processor is further used to determine source data corresponding to the encoded data according to each decoded data block.

[0394] Clause A42. A computing device according to clause A41, further comprising a branch processor located between the master processor and the slave processor,

[0395] The branch processor is used for data forwarding between the main processor and the slave processor.

[0396] Clause A43. The computing device according to clause A41, wherein the master processor comprises a control module and a master on-chip storage module, and the slave processor comprises a computing module;

[0397] The control module is used to decode the machine instructions received by the master processor into decoded broadcast microinstructions, use the decoded broadcast microinstructions to control the slave processor to perform operations according to the encoded data in the master on-chip storage module, and write the encoded data into the off-chip storage module;

[0398] The control module includes a decoding unit, and the decoding unit is used to execute the decoded broadcast microinstruction.

[0399] Item A44. According to the computing device described in Item A41, the main processor includes a control module, and the slave processor includes a computing module and a slave on-chip storage module.

[0400] The control module is used to decode the machine instructions received by the master processor into decoded broadcast microinstructions, and use the decoded broadcast microinstructions to control the slave processor to perform operations according to the encoded data in the slave on-chip storage module, and write the encoded data into the off-chip storage module;

[0401] The control module includes a decoding unit, and the decoding unit is used to execute the decoded broadcast microinstruction.

[0402] Item A45. In the computing device according to Item A43 or Item A44, the master processor is also used to send the decoding broadcast microinstruction to the slave processor to instruct the slave processor to perform a decoding process.

[0403] The control module comprises a decoding unit, and the decoding unit is used for executing a decoded broadcast microinstruction and decoding the decoded broadcast microinstruction into a broadcast microinstruction.

[0404] The embodiments of the present disclosure are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is only used to help understand the method and its core idea of ​​the present disclosure. At the same time, changes or deformations made by those skilled in the art based on the ideas of the present disclosure, the specific implementation methods and the scope of application of the present disclosure, all belong to the scope of protection of the present disclosure. In summary, the content of this specification should not be understood as a limitation on the present disclosure.

Claims

1. A shuffling method, characterized in that: The method is applied to a first slave processor in a master-slave processor architecture, and the method comprises: receiving encoded broadcast microinstructions sent by the host processor; If the encoding broadcast microinstruction does not carry the identifier of the target slave processor, or if the encoding broadcast microinstruction carries the identifier of at least one target slave processor, and the identifier of the at least one target slave processor includes the identifier of the first slave processor, the first slave processor obtains a plurality of encoding streams corresponding to the to-be-encoded data block, divides the plurality of encoding streams into a plurality of first shuffling units according to a first shuffling level, and divides the plurality of first shuffling units into at least one first shuffling group, wherein the first shuffling group includes a plurality of first shuffling units, and the first shuffling unit includes at least one encoding stream; Determining the code length of each first shuffle unit; According to the code length of each of the first shuffling units, determining an output shuffling unit and an input shuffling unit in each of the first shuffling units; A first preset number of to-be-shuffled stream blocks in the output shuffling unit are sent to the input shuffling unit as first to-be-encoded stream blocks in the input shuffling unit, so that the first to-be-encoded stream blocks are encoded by the input shuffling unit according to a preset encoding algorithm.

2. The method according to claim 1, characterized in that The step of determining the encoding length of each first shuffling unit comprises: For each first shuffle unit in each first shuffle group, the total coding length of the to-be-coded stream blocks in the coded stream included in the first shuffle unit is determined as the coding length of the first shuffle unit.

3. The method according to claim 1, characterized in that Determining an output shuffling unit and an input shuffling unit in each of the first shuffling units according to the encoding length of each of the first shuffling units comprises: Determining a shuffling type of each of the first shuffling units according to the code length of each of the first shuffling units; According to the shuffling types of the first shuffling units and the preset shuffling rules, in the first shuffling units, an output shuffling unit and an input shuffling unit corresponding to each output shuffling unit are determined; The step of sending the first preset number of to-be-shuffled stream blocks in the output shuffling unit to the input shuffling unit as the first to-be-encoded stream blocks in the input shuffling unit comprises: For each output shuffle unit, a second preset number of to-be-shuffled stream blocks in the output shuffle unit are sent to an input shuffle unit corresponding to the output shuffle unit as the first to-be-encoded stream block in the input shuffle unit.

4. The method according to claim 3, characterized in that Determining the shuffling type of each of the first shuffling units according to the encoding length of each of the first shuffling units comprises: For each of the first shuffling units, determining a first difference between a code length of the first shuffling unit and code lengths of other first shuffling units; A shuffling type of the first shuffling unit is determined according to a first difference value corresponding to the first shuffling unit.

5. The method according to claim 4, characterized in that Determining the shuffling type of the first shuffling unit according to the first difference corresponding to the first shuffling unit includes: If there is a target difference whose absolute value is greater than or equal to the first preset difference threshold value in the first difference value corresponding to the first shuffle unit, and the target difference values ​​are all positive numbers, then determining that the shuffle type of the first shuffle unit is a high coding type; If there is a target difference whose absolute value is greater than or equal to a first preset difference threshold value in the first difference values ​​corresponding to the first shuffle unit, and there is a negative target difference in the target difference values, it is determined that the shuffle type of the first shuffle unit is a low coding type.

6. The method according to claim 5, characterized in that The method further comprises: If there is no target difference value whose absolute value is greater than or equal to the first preset difference threshold value in the first difference values ​​corresponding to the first shuffle unit, it is determined that the shuffle type of the first shuffle unit is the medium coding type.

7. The method according to claim 3, characterized in that Determining the shuffling type of each of the first shuffling units according to the encoding length of each of the first shuffling units comprises: Determining an average code length according to the code lengths of the first shuffle units; For each of the first shuffling units, determining a second difference between a code length of the first shuffling unit and the average code length; A shuffling type of the first shuffling unit is determined according to the second difference value corresponding to the first shuffling unit.

8. The method according to claim 7, characterized in that Determining the shuffling type of the first shuffling unit according to the second difference corresponding to the first shuffling unit includes: If the absolute value of the second difference corresponding to the first shuffling unit is greater than or equal to the second preset difference threshold, and the second difference is a positive number, determining that the shuffling type of the first shuffling unit is a high coding type; If the absolute value of the second difference corresponding to the first shuffle unit is greater than or equal to the second preset difference threshold, and the second difference is a negative number, it is determined that the shuffle type of the first shuffle unit is a low coding type.

9. The method according to claim 8, characterized in that The method further comprises: If the absolute value of the second difference corresponding to the first shuffling unit is less than the second preset difference threshold, it is determined that the shuffling type of the first shuffling unit is the medium coding type.

10. The method according to claim 3, characterized in that The step of determining, in each of the first shuffling units, an output shuffling unit and an input shuffling unit corresponding to each output shuffling unit according to the shuffling type of each of the first shuffling units and a preset shuffling rule comprises: If the first number of the first target shuffle units of the high coding type is less than or equal to the second number of the second target shuffle units of the low coding type, the first target shuffle unit is determined as the output shuffle unit, and for each output shuffle unit, at least one second target shuffle unit is determined in the second target shuffle unit as the input shuffle unit corresponding to the output shuffle unit; If the first number of first target shuffle units of the high coding type is greater than the second number of second target shuffle units of the low coding type, the second number of first target shuffle units are determined as output shuffle units, and for each output shuffle unit, in the second target shuffle unit, at least one second target shuffle unit is determined as the input shuffle unit corresponding to the output shuffle unit.

11. The method according to claim 1, characterized in that: The method further comprises: Obtain source data to be encoded; According to the received encoding broadcast microinstruction, in the source data, determining an encoding region corresponding to the encoding broadcast microinstruction, wherein the encoding region includes at least one data block to be encoded, and the data block to be encoded is a source data block or a source data sub-block; For each data block to be encoded in the at least one data block to be encoded, the data block to be encoded is divided into multiple stream blocks, and the multiple stream blocks are sent to multiple encoding streams corresponding to the data block to be encoded as stream blocks to be shuffled in the multiple encoding streams.

12. The method according to claim 1, characterized in that The method further comprises: When it is detected that the encoding of a first encoded stream among multiple encoded streams is completed, a fourth preset number of to-be-encoded stream blocks in a second encoded stream that has not been completely encoded among the multiple encoded streams are sent to the first encoded stream as to-be-encoded stream blocks in the first encoded stream.

13. The method according to claim 1, characterized in that The method further comprises: If the total encoding length of the to-be-encoded stream blocks in each first shuffle group is greater than the original length of the to-be-encoded data block, the encoding process of the to-be-encoded data block is terminated.

14. The method according to claim 1, characterized in that The method comprises: Determine, according to the second shuffling level, at least one second shuffling group corresponding to the to-be-encoded data block, wherein the second shuffling group includes a plurality of second shuffling units, and the second shuffling unit includes at least one encoding stream; The to-be-encoded stream blocks in each second shuffling unit are used as to-be-shuffled stream blocks and shuffled again until the encoding length of each second shuffling unit meets a preset proximity condition.

15. The method according to claim 1, characterized in that The step of encoding the first to-be-encoded stream block according to a preset encoding algorithm by the input shuffling unit includes: Encoding the preset characters contained in the first to-be-encoded stream block according to a first encoding rule corresponding to the preset characters to obtain first encoded data; The first coded data is encoded according to a preset second coding rule.

16. The method according to claim 11, characterized in that The method further comprises: Generate a coding header block for a coded data block corresponding to each to-be-coded data block, wherein the coding header block includes a storage address of the coded data block corresponding to the coding header block; Each encoding header block is stored, and each encoding data block is stored after each encoding header block.

17. The method according to claim 16, characterized in that The coded data block is composed of coded data, and the size of the coded data is equal to the size of the coded data in the coded data block after being coded; or The coded data block consists of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the data block to be coded.

18. The method according to claim 16, characterized in that The coded data block is composed of coded data sub-blocks corresponding to a plurality of source data sub-blocks belonging to the same source data block; The coded data sub-block is composed of coded data, and the size of the coded data is equal to the size of the to-be-coded data in the source data sub-block after being encoded; or, The coded data sub-block consists of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the source data sub-block.

19. A shuffling method, characterized in that: The method is applied to a first slave processor in a master-slave processor architecture, and the method comprises: receiving decoded broadcast microinstructions sent by the host processor; If the decode broadcast microinstruction does not carry the identifier of the target slave processor, or if the decode broadcast microinstruction carries the identifier of at least one target slave processor, and the identifier of the at least one target slave processor includes the identifier of the first slave processor, the first slave processor obtains a plurality of decoded streams corresponding to the to-be-decoded data block, divides the plurality of decoded streams into a plurality of first shuffle units according to a first shuffle level, and divides the plurality of first shuffle units into at least one first shuffle group, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one decoded stream; Determining the code length of each first shuffle unit; According to the code length of each of the first shuffling units, determining an output shuffling unit and an input shuffling unit in each of the first shuffling units; A first preset number of to-be-shuffled stream blocks in the output shuffling unit are sent to the input shuffling unit as first to-be-decoded stream blocks in the input shuffling unit, so that the first to-be-decoded stream blocks are decoded by the input shuffling unit according to a preset decoding algorithm.

20. The method according to claim 19, characterized in that The step of determining the encoding length of each first shuffling unit comprises: For each first shuffle unit in each first shuffle group, the total coding length of the to-be-decoded stream blocks in the decoded stream contained in the first shuffle unit is determined as the coding length of the first shuffle unit.

21. The method according to claim 19, characterized in that Determining an output shuffling unit and an input shuffling unit in each of the first shuffling units according to the encoding length of each of the first shuffling units comprises: Determining a shuffling type of each of the first shuffling units according to the code length of each of the first shuffling units; According to the shuffling types of the first shuffling units and the preset shuffling rules, in the first shuffling units, an output shuffling unit and an input shuffling unit corresponding to each output shuffling unit are determined; The step of sending the first preset number of to-be-shuffled stream blocks in the output shuffling unit to the input shuffling unit as the first to-be-decoded stream blocks in the input shuffling unit comprises: For each output shuffle unit, a second preset number of to-be-shuffled stream blocks in the output shuffle unit are sent to an input shuffle unit corresponding to the output shuffle unit as the first to-be-decoded stream blocks in the input shuffle unit.

22. The method according to claim 21, characterized in that Determining the shuffling type of each of the first shuffling units according to the encoding length of each of the first shuffling units comprises: For each of the first shuffling units, determining a first difference between a code length of the first shuffling unit and code lengths of other first shuffling units; A shuffling type of the first shuffling unit is determined according to a first difference value corresponding to the first shuffling unit.

23. The method according to claim 22, characterized in that Determining the shuffling type of the first shuffling unit according to the first difference corresponding to the first shuffling unit includes: If there is a target difference whose absolute value is greater than or equal to the first preset difference threshold value in the first difference value corresponding to the first shuffle unit, and the target difference values ​​are all positive numbers, then determining that the shuffle type of the first shuffle unit is a high coding type; If there is a target difference whose absolute value is greater than or equal to a first preset difference threshold value in the first difference values ​​corresponding to the first shuffle unit, and there is a negative target difference in the target difference values, it is determined that the shuffle type of the first shuffle unit is a low coding type.

24. The method according to claim 23, characterized in that The method further comprises: If there is no target difference value whose absolute value is greater than or equal to the first preset difference threshold value in the first difference values ​​corresponding to the first shuffle unit, it is determined that the shuffle type of the first shuffle unit is the medium coding type.

25. The method according to claim 21, characterized in that Determining the shuffling type of each of the first shuffling units according to the encoding length of each of the first shuffling units comprises: Determining an average code length according to the code lengths of the first shuffle units; For each of the first shuffling units, determining a second difference between a code length of the first shuffling unit and the average code length; A shuffling type of the first shuffling unit is determined according to the second difference value corresponding to the first shuffling unit.

26. The method according to claim 25, characterized in that Determining the shuffling type of the first shuffling unit according to the second difference corresponding to the first shuffling unit includes: If the absolute value of the second difference corresponding to the first shuffling unit is greater than or equal to the second preset difference threshold, and the second difference is a positive number, determining that the shuffling type of the first shuffling unit is a high coding type; If the absolute value of the second difference corresponding to the first shuffle unit is greater than or equal to the second preset difference threshold, and the second difference is a negative number, it is determined that the shuffle type of the first shuffle unit is a low coding type.

27. The method according to claim 26, characterized in that The method further comprises: If the absolute value of the second difference corresponding to the first shuffling unit is less than the second preset difference threshold, it is determined that the shuffling type of the first shuffling unit is the medium coding type.

28. The method according to claim 21, characterized in that The step of determining, in each of the first shuffling units, an output shuffling unit and an input shuffling unit corresponding to each output shuffling unit according to the shuffling type of each of the first shuffling units and a preset shuffling rule comprises: If the first number of the first target shuffle units of the high decoding type is greater than the second number of the second target shuffle units of the low decoding type, the second target shuffle units are determined as output shuffle units, and for each output shuffle unit, at least one first target shuffle unit is determined in the first target shuffle unit as an input shuffle unit corresponding to the output shuffle unit; If the first number of first target shuffle units of the high decoding type is less than or equal to the second number of second target shuffle units of the low decoding type, the first number of second target shuffle units are determined as output shuffle units, and for each output shuffle unit, in the first target shuffle unit, at least one first target shuffle unit is determined as the input shuffle unit corresponding to the output shuffle unit.

29. The method according to claim 19, characterized in that The method further comprises: Obtain the encoding header data corresponding to the data to be decoded; According to the received decoding broadcast microinstruction, in the encoding header data, a decoding area corresponding to the decoding broadcast microinstruction and including at least one encoding header block is determined, and at least one to-be-decoded data block corresponding to the at least one encoding header block is obtained, wherein the encoding header block includes a storage address of an encoding data block corresponding to the encoding header block; For each data block to be decoded in the at least one data block to be decoded, the data block to be decoded is divided into multiple stream blocks, and the multiple stream blocks are sent to multiple decoding streams corresponding to the data block to be decoded as stream blocks to be shuffled in the multiple decoding streams.

30. The method according to claim 29, characterized in that The data block to be decoded is composed of coded data, and the size of the coded data is equal to the size of the coded data in the data block to be encoded; or The data block to be decoded consists of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the data block to be encoded.

31. The method according to claim 29, characterized in that The to-be-decoded data block is composed of coded data sub-blocks corresponding to a plurality of source data sub-blocks in the same source data block; The coded data sub-block is composed of coded data, and the size of the coded data is equal to the size of the to-be-coded data in the source data sub-block after being encoded; or, The coded data sub-block consists of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the source data sub-block.

32. The method according to claim 19, characterized in that The method further comprises: When it is detected that decoding of a first decoded stream among multiple decoded streams is completed, a second preset number of to-be-decoded stream blocks in a second decoded stream that has not been decoded among the multiple decoded streams are sent to the first decoded stream as to-be-decoded stream blocks in the first decoded stream.

33. The method according to claim 19, characterized in that The method further comprises: Determine, according to the second shuffling level, at least one second shuffling group corresponding to the to-be-decoded data block, wherein the second shuffling group includes a plurality of second shuffling units, and the second shuffling unit includes at least one decoding stream; The to-be-decoded stream blocks in each second shuffling unit are used as to-be-shuffled stream blocks and shuffled again until the encoding length of each second shuffling unit meets a preset proximity condition.

34. A computing device, characterized in that: include: A master processor and a plurality of slave processors connected to the master processor; The master processor is used to receive source data and send the source data to the multiple slave processors; The multiple slave processors are used to encode the to-be-encoded data block corresponding to the encoding broadcast microinstruction using the method described in any one of claims 1-18 according to the encoding broadcast microinstruction to obtain the encoded data block, and transmit the encoded data block to the master processor; The main processor is further used to determine the coded data corresponding to the source data according to each coded data block.

35. The computing device according to claim 34, characterized in that The computing device further includes a branch processor located between the master processor and the slave processor, The branch processor is used for data forwarding between the main processor and the slave processor.

36. The computing device of claim 34, wherein: The master processor includes a control module, and the slave processor includes a computing module and a slave on-chip storage module; The control module is used to decode the machine instructions received by the master processor into coded broadcast microinstructions, use the coded broadcast microinstructions to control the slave processor to perform operations according to the source data in the slave on-chip storage module, and write the data into the off-chip storage module; The control module includes an encoding unit, and the encoding unit is used to execute the encoded broadcast microinstruction.

37. The computing device according to claim 36, characterized in that The master processor is further configured to send the encoding broadcast microinstruction to the slave processor, instructing the slave processor to execute an encoding process.

38. A computing device, characterized in that: include: A master processor and a plurality of slave processors connected to the master processor; The master processor is configured to receive the encoded data and send the encoded data to the plurality of slave processors; The multiple slave processors are used to decode the to-be-decoded data blocks corresponding to the decoded broadcast microinstructions using the method described in any one of claims 19-33 according to the decoded broadcast microinstructions to obtain decoded data blocks, and transmit the decoded data blocks to the master processor; The main processor is further used to determine source data corresponding to the encoded data according to each decoded data block.

39. The computing device according to claim 38, characterized in that The computing device further includes a branch processor located between the master processor and the slave processor, The branch processor is used for data forwarding between the main processor and the slave processor.

40. The computing device of claim 38, wherein: The master processor includes a control module, and the slave processor includes a computing module and a slave on-chip storage module; The control module is used to decode the machine instructions received by the master processor into decoded broadcast microinstructions, and use the decoded broadcast microinstructions to control the slave processor to perform operations according to the encoded data in the slave on-chip storage module, and write the encoded data into the off-chip storage module; The control module includes a decoding unit, and the decoding unit is used to execute the decoded broadcast microinstruction.

41. The computing device of claim 40, wherein: The master processor is further configured to send the decoding broadcast microinstruction to the slave processor to instruct the slave processor to execute a decoding process.