Batched sparse code encoding method, device and computer equipment based on redundancy
By calculating the redundancy gap in IoT data packets and constructing a target candidate set, multiple batch codes are generated, solving the problem of low data transmission efficiency caused by limited resources in IoT and achieving more efficient data transmission.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGSU UNIV OF TECH
- Filing Date
- 2026-04-01
- Publication Date
- 2026-07-10
AI Technical Summary
In the Internet of Things (IoT), traditional batch sparse code encoding methods result in low data transmission efficiency and uneven resource allocation when resources are limited. They cannot intelligently allocate resources based on the urgency of data packet decoding, leading to excessive reliance on decoding.
By obtaining the redundancy parameters and current redundancy of the data packet set, the redundancy gap is calculated, a target candidate set is constructed, and multiple batch codes are generated based on the redundancy gap and preset value selection strategy. The internal code is then processed and sent to the IoT target node.
It enables on-demand, non-equal probability data packet selection and encoding resource allocation under limited resources, avoiding blind and uneven resource allocation and waste, and improving data transmission efficiency.
Smart Images

Figure CN122372148A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data transmission technology, and in particular to a redundancy-based batch sparse code encoding method, apparatus, and computer equipment. Background Technology
[0002] With the rapid development of communication technology, wireless multi-hop networks, with their advantages of distributed operation, flexible networking, and strong scalability, have become a core technology supporting the large-scale application of the Internet of Things (IoT), widely serving numerous scenarios such as smart homes, intelligent transportation, hydrological monitoring, environmental monitoring, and smart healthcare. In IoT multi-hop data transmission, sensed data is not directly transmitted from the source device (such as sensors, terminal devices, etc.) to the target node, but rather relayed through intermediate devices such as sensors, controllers, and gateways, leveraging the Internet and mobile communication technologies to achieve data sharing and intelligent control between devices.
[0003] If all IoT devices communicate directly with remote servers, bottlenecks such as high energy consumption, unstable connections, and low throughput will arise. Furthermore, most IoT services do not have stringent requirements for high reliability and low latency; instead, they are more sensitive to terminal energy consumption and overall transmission efficiency. In traditional data transmission, the data packets to be transmitted need to be encoded using Batched Sparse Codes (BATS). BATS uses equally probable random packet selection to generate batch codes. This is close to optimal under ideal conditions with a very large number of data packets and an infinite number of transmission batches. However, in real-world scenarios with small data packets and limited transmission batches, there are design dilemmas regarding degree values, blindly and unevenly allocated encoding resources, an inability to intelligently allocate resources based on the urgency of data packet decoding, and excessive reliance on decoding. These shortcomings lead to low data transmission efficiency when resources are limited. Summary of the Invention
[0004] In view of this, embodiments of this application provide a batch sparse code encoding method, apparatus, and computer device based on redundancy, so as to at least solve the technical problem of low data transmission efficiency under limited resources.
[0005] According to one aspect of this application, a batch sparse code encoding method based on redundancy is provided. The method includes: obtaining a first data packet set during the outer code encoding process of the batch sparse code, and sampling the first data packet set based on a preset degree distribution to obtain a target degree value for the current batch, wherein the target degree value is used to characterize the number of data packets to be selected from the first data packet set; obtaining a redundancy parameter of the first data packet set and the current redundancy of each data packet in the first data packet set, and determining a redundancy gap for each data packet based on the redundancy parameter and the current redundancy of each data packet, wherein the current redundancy is used to represent the cumulative number of times the data packet has been selected in historical encoding, and the redundancy gap is used to represent the degree of demand of the data packet for encoding resources; constructing a target candidate set based on the redundancy gap of each data packet and the first data packet set, and selecting multiple target data packets from the target candidate set according to a selection strategy based on the target degree value to construct a second data packet set; generating multiple batch codes based on the second data packet set and a preset maximum transmission batch number of the batch sparse code, and performing inner code encoding processing on the multiple batch codes respectively, so as to send the encoded multiple batch codes to target nodes in the Internet of Things.
[0006] Optionally, the redundancy gap for each data packet is determined using the following formula, based on the redundancy parameter and the current redundancy of each data packet: =
[0007] in, Used to represent redundancy parameters, and N is used to represent the preset maximum number of transmission batches; Used to represent the current redundancy of the i-th data packet, and K is used to represent the total number of data packets in the first data packet set; Used to represent the redundancy gap of the i-th data packet.
[0008] Optionally, based on the redundancy gap of each data packet and the first data packet set, a target candidate set is constructed, including: in response to the redundancy gap being greater than zero, selecting data packets corresponding to the redundancy gap from the first data packet set to construct an initial candidate set; obtaining the number of first data packets in the initial candidate set and comparing the number of first data packets with the target degree value to obtain a comparison result; in response to the comparison result being that the number of first data packets is less than the target degree value, supplementing the initial candidate set with data packets in the first data packet set corresponding to the redundancy gap being equal to zero to obtain the target candidate set, wherein the number of second data packets in the target candidate set is greater than or equal to the target degree value.
[0009] Optionally, based on the target degree value, multiple target data packets are selected from the target candidate set according to the selection strategy to construct a second data packet set, including: determining the probability value of each data packet based on the redundancy gap of each data packet in the target candidate set; sorting the data packets in the target candidate set according to the target sorting method of the probability values to obtain a sorted target candidate set; and selecting data packets with the target degree value from the sorted target candidate set to construct the second data packet set.
[0010] Optionally, the probability value of each data packet is determined based on the redundancy gap of each data packet in the target candidate set using the following formula, including:
[0011] in, Used to represent data packets The probability value; j is used to iterate through all data packets in the target candidate set.
[0012] Optionally, the method further includes: obtaining the initial redundancy of each data packet in the target candidate set and the decrement function of the target redundancy value; and determining the current redundancy of each data packet in the first data packet set and the data packet in the target candidate set based on the initial redundancy and the decrement function of each data packet in the target candidate set.
[0013] Optionally, based on the second data packet set and the preset maximum number of transmission batches for the batched sparse code, multiple batch codes are generated, including: constructing a target matrix based on the second data packet set; obtaining the coefficient matrix in the target domain; and generating multiple batch codes based on the target matrix, the coefficient matrix, and the preset maximum number of transmission batches.
[0014] Optionally, based on the target matrix, the coefficient matrix, and the preset maximum number of transmission batches, multiple batch codes are generated, including: obtaining the index value of the current batch; in response to the index value being equal to the preset maximum number of transmission batches, and / or the current redundancy of each data packet in the first data packet set being greater than or equal to the redundancy parameter, generating multiple batch codes based on multiple target matrices and multiple coefficient matrices under different batches.
[0015] According to another aspect of this application, a batch sparse code encoding apparatus based on redundancy is provided. The apparatus includes: a first acquisition unit, configured to acquire a first data packet set during the outer code encoding process of the batch sparse code, and sample the first data packet set based on a preset degree distribution to obtain a target degree value for the current batch, wherein the target degree value characterizes the number of data packets to be selected from the first data packet set; and a first determination unit, configured to acquire a redundancy parameter of the first data packet set and the current redundancy of each data packet in the first data packet set, and determine the redundancy of each data packet based on the redundancy parameter and the current redundancy of each data packet. The redundancy gap is defined as follows: The redundancy gap represents the cumulative number of times a data packet has been selected in historical encoding, and the redundancy gap represents the degree of data packet demand for encoding resources. The construction unit is used to construct a target candidate set based on the redundancy gap of each data packet and the first data packet set, and to select multiple target data packets from the target candidate set according to the selection strategy based on the target degree value to construct a second data packet set. The sending unit is used to generate multiple batch codes based on the second data packet set and the preset maximum number of transmission batches for the batched sparse code, and to perform internal code encoding processing on each batch code to send the encoded batch codes to the target nodes in the Internet of Things.
[0016] According to another aspect of this application, a storage medium is provided on which a computer program is stored, which, when executed by a processor, implements the above-described redundancy-based batch sparse code encoding method.
[0017] According to another aspect of this application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the program to implement the above-described redundancy-based batch sparse code encoding method.
[0018] By employing the above technical solution, this application provides a batch sparse code encoding method based on redundancy. The method includes: first, sampling a target degree value (i.e., the number of data packets to be selected) from a first data packet set according to a preset degree distribution; then, calculating the redundancy gap (the difference between the target redundancy and the current redundancy) for each data packet based on the redundancy parameter of the first data packet set and the current redundancy of each data packet, to reflect the degree of data packet demand for encoding resources; then, constructing a candidate set based on the redundancy gap, and selecting target data packets from the target candidate set according to a selection strategy to form a second data packet set; and finally, performing batch code generation and internal code encoding on the selected data packet set (second data packet set), and finally sending it to the target node in the Internet of Things. Because the above process fully considers the differences in the degree of demand for encoding resources among various data packets, and achieves on-demand, non-equal probability data packet selection and encoding resource allocation through the redundancy gap, it avoids the blind and uneven resource allocation, insufficient coverage, or waste caused by random packet selection. This effectively solves the technical problem of low data transmission efficiency under limited resource conditions, and achieves the technical effect of improving data transmission efficiency under limited resource conditions.
[0019] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0020] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart illustrating a batch sparse code encoding method based on redundancy provided in an embodiment of this application is shown. Figure 2 The diagram shows a comparison curve of the decoding rate between a PPO-based encoding optimization scheme and a traditional scheme provided in an embodiment of this application. Figure 3 This illustration shows a schematic diagram of a data packet redundancy distribution provided in an embodiment of this application; Figure 4 A schematic diagram of a redundancy-based batch sparse code encoding device provided in an embodiment of this application is shown. Figure 5 A schematic diagram of the device structure of a computer device provided in an embodiment of this application is shown. Detailed Implementation
[0021] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.
[0022] In this embodiment, Figure 1 The following is a flowchart illustrating a batch sparse code encoding method based on redundancy provided in an embodiment of this application. Figure 1 As shown, the method includes: Step S101: Obtain the first data packet set in the outer code encoding process of the batch sparse code, and sample the first data packet set based on the preset degree distribution to obtain the target degree value of the current batch.
[0023] In the technical solution provided by step S101 of this application, it is necessary to obtain the first data packet set in the outer code encoding process of the batch sparse code, and then to sample the first data packet set obtained above according to the preset degree distribution in order to obtain the target degree value of the current batch, wherein the target degree value is used to characterize the number of data packets to be selected from the first data packet set.
[0024] Optionally, the first data packet set can be called the sensing data packet set, and is represented by X. The data packets in this set can be called the input data packets, i.e. Where K represents the total number of data packets in the first data packet set. The target degree value can be simply referred to as the degree value, and is represented by d. The preset degree distribution can be simply referred to as the degree distribution, and is represented by Ψ.
[0025] For example, consider a multi-hop IoT transmission system where the source node needs to upload a set of sensing data packets to the target node. (K represents the total number of data packets). Due to power and energy-saving limitations, the source node cannot transmit reliably directly and requires the assistance of a relay node. Forwarding. Furthermore, based on degree distribution... ( The degree value d is obtained by sampling the set of perception data packets.
[0026] It should be noted that this is only a preferred implementation method for obtaining the target degree value of the current batch. The process and method of obtaining the target degree value of the current batch are not specifically limited. As long as the sampling process of the first data packet set is based on the preset degree distribution to obtain the target degree value of the current batch, the process and method are within the protection scope of this application and will not be listed here.
[0027] Step S102: Obtain the redundancy parameter of the first data packet set and the current redundancy of each data packet in the first data packet set, and determine the redundancy gap of each data packet based on the redundancy parameter and the current redundancy of each data packet.
[0028] In the technical solution provided by step S102 of this application, it is necessary to obtain the redundancy parameter of the first data packet set and the current redundancy of each data packet in the first data packet set. Then, based on the redundancy parameter obtained above and the current redundancy of each data packet, the redundancy gap of each data packet is determined. The current redundancy is used to represent the cumulative number of times the data packet has been selected in historical encoding, and the redundancy gap is used to represent the degree of demand of the data packet for encoding resources.
[0029] Optionally, the redundancy parameter is used to represent the number of times the target is selected for each input data packet, and is represented by η. Where N is the preset maximum number of transmission batches. The specific value is determined by the specific application and scenario.
[0030] Optionally, the current redundancy can be represented by c, i.e., the number of data packets. Current redundancy ( ), used to represent the cumulative number of times the i-th input data packet has been selected in the historical encoding, and initialized to a value of . The current redundancy level reflects the "encoding coverage status" of each data packet in real time.
[0031] Optionally, redundancy gaps are used to represent directly quantized input data packets. The "demand level" for encoding resources can be determined through... To indicate, when >0 indicates an input data packet Coverage is still required, and The larger the size, the more urgent the need.
[0032] For example, when the first set of data packets contains data packets , and At that time, the redundancy parameter η is set to 5. If If a code is selected twice in the historical encoding, its current redundancy level is... The value is 2, which allows us to determine the current redundancy of other data packets. Based on the redundancy parameters obtained above and the current redundancy of each data packet, we can determine the redundancy gap of each data packet, and this redundancy gap quantifies the specific requirements of the data packet for encoding resources.
[0033] It is understood that this is only a preferred implementation of determining the redundancy gap of each data packet, and the process and method of determining the redundancy gap of each data packet are not specifically limited. As long as it is based on the redundancy parameter and the current redundancy of each data packet, the process and method of determining the redundancy gap of each data packet are within the protection scope of this application, and will not be listed here.
[0034] Step S103: Based on the redundancy gap of each data packet and the first data packet set, construct a target candidate set, and based on the target degree value, select multiple target data packets from the target candidate set according to the selection strategy to construct a second data packet set.
[0035] In the technical solution provided by step S103 of this application, after obtaining the redundancy gap of each data packet, a target candidate set can be constructed based on the redundancy gap of each data packet and the first data packet set. Then, based on the target degree value, multiple target data packets are selected from the target candidate set according to the selection strategy to achieve the purpose of constructing the second data packet set.
[0036] Optionally, the target data packet can be referred to as the selected data packet. The second data packet set is the data packet set S constructed using the selected data packet.
[0037] For example, calculate the redundancy gap for each packet in the first packet set. To construct a target candidate set, and to filter from the target candidate set according to the selection rules, multiple selected data packets can be obtained, and a data packet set S can be constructed from the multiple selected data packets.
[0038] It is understood that this is only a preferred implementation of obtaining the second data packet set, and the process and method of obtaining the second data packet set are not specifically limited. As long as the process and method of selecting multiple target data packets from the target candidate set according to the selection strategy based on the target degree value to construct the second data packet set are within the protection scope of this application, they will not be listed here.
[0039] Step S104: Based on the second data packet set and the preset maximum number of transmission batches of the batch sparse code, generate multiple batch codes, and perform internal code encoding on the multiple batch codes respectively, so as to send the encoded multiple batch codes to the target node in the Internet of Things.
[0040] In the technical solution provided in step S104 of this application, multiple batch codes can be generated based on the second data packet set obtained in the above steps and the preset maximum transmission batch number of the batched sparse code. These multiple batch codes are then subjected to internal code encoding processing to obtain encoded batch codes, which are then sent to the target node in the Internet of Things (IoT). The batch codes can be represented by Y. The target node in the IoT can be a preset receiving end. The preset maximum transmission batch number can be called the preset total batch number, represented by N.
[0041] For example, if each batch code contains M encoded packets, random linear network coding (RLNC) can be performed on the M encoded packets within each batch code, limiting the operation to within the batch only. Assume nodes... Receive this batch Each encoded packet, through the transition matrix To perform recoding and generate M new encoded packets, the expression for achieving the above recoding is: At this point, the encoded batch code is forwarded to the next hop node until the target node (the receiver). The receiver then uses any standard BATS decoding algorithm to recover the code, and the decoder does not need to know that the source has adopted an improved selection strategy.
[0042] It should be noted that this is only a preferred implementation method for obtaining multiple batch codes, and the process and method for obtaining multiple batch codes are not specifically limited. As long as the process and method for generating multiple batch codes are based on the second data packet set and the preset maximum number of transmission batches of the batch sparse code, they are all within the protection scope of this application and will not be listed here.
[0043] Furthermore, at the receiving end, the Belief Propagation (BP) decoding algorithm can be used for decoding operations. The specific process is as follows: Step 1, Batch reception and storage: The target node receives each batch of codes and stores the relevant encoded packets and associated information; Step 2, Decodable batch identification: Traverse the received batch codes, and if the rank of the coefficient matrix of a certain batch code is equal to its degree value... ( , If the product of the generator matrix and the transition matrix is used, it is determined to be a readable batch code; Step 3, readable data packet recovery: For the readable batch code, the Gaussian elimination algorithm is used to solve the linear equation system. Restore the associated input data packets Step 4, Batch Update: Substitute the recovered data packet into other undecoded batch codes, delete the association trace of the data packet in the batch, and update the batch's degree value, coefficient matrix, and encoded packet data. This step includes: deleting the index of the recovered data packet based on the associated data packet index of the current batch; deleting the coefficient matrix... The corresponding line in the data packet that has been recovered; update the encoded packet data. ( Used to represent the row corresponding to the recovered data packet in the coefficient matrix, and the degree value of the current batch is decremented by one. Step 5, iterative decoding: Repeat the above steps until there are no new decodable batch codes or all data packets are successfully decoded.
[0044] Furthermore, after successful decoding, the above problem needs to be modeled, as shown in the following modeling process: Step 1, Optimize the objective. Under constraints, maximize the decoding rate; the objective function is: Step two, constraints. Degree distribution constraint: and Redundancy parameter constraints: Incremental function constraints: and .
[0045] For another example, a joint optimization strategy can be used to solve for the optimality distribution. Redundancy parameter and increment function To achieve the solution of the problem, the specific implementation method is as follows: Step 1, Discretize the parameter space: For and ( The first step involves discretizing the data to reduce the complexity of the solution. The second step is to construct the reinforcement learning model: using the degree distribution Ψ, redundancy parameter η, and increment function α(d) as the action space of the agent, the decoding rate R as the reward function, and the channel state of the encoded transmission and the data packet redundancy coverage state as the state space, a reinforcement learning optimization model is constructed. The third step is to optimize the degree distribution: based on the constructed reinforcement learning model, for each set of discrete... and The optimal degree distribution is learned through iterative interaction between the agent and the environment. To maximize the decoding rate R; Step 4, Optimal solution selection: Traverse all discrete parameter combinations and their corresponding optimal solutions. Select the one with the highest decoding rate R. , , As the final solution.
[0046] In the technical solution provided by steps S101 to S104 of this application, the target degree value is first sampled from the acquired first data packet set according to a preset degree distribution. Then, based on the redundancy parameter of the first data packet set and the current redundancy of each data packet, the redundancy gap of each data packet is calculated to reflect the degree of demand of the data packet for encoding resources. Then, a candidate set is constructed based on the redundancy gap, and target data packets are selected from the target candidate set according to the selection strategy to form a second data packet set. Batch code generation and internal code encoding are performed on the second data packet set, and finally, it is sent to the target node in the Internet of Things. Since the above process fully considers the differences in the degree of demand of each data packet for encoding resources, the selection of data packets and the allocation of encoding resources on demand and with non-equal probability are realized through the redundancy gap. This avoids the blind and uneven allocation of resources, insufficient coverage or waste caused by random packet selection, thereby effectively solving the technical problem of low data transmission efficiency under limited resources and achieving the technical effect of improving data transmission efficiency under limited resources.
[0047] The method described in this embodiment will be further described below.
[0048] As an optional implementation, the redundancy gap of each data packet is determined using the following formula, based on the redundancy parameter and the current redundancy of each data packet: =
[0049] in, Used to represent redundancy parameters, and N is used to represent the preset maximum number of transmission batches; Used to represent the current redundancy of the i-th data packet, and K is used to represent the total number of data packets in the first data packet set, and can be initialized for all packets. = 0; Used to represent the redundancy gap of the i-th data packet.
[0050] In this embodiment, the difference between the redundancy parameter and the current redundancy of each data packet is determined as the redundancy gap of each data packet.
[0051] Optionally, the redundancy parameter Current redundancy of the i-th data packet The difference between them is determined as the redundancy gap of the i-th data packet. Therefore, based on the above calculation method, the redundancy gap of each data packet in the first data packet set can be obtained, and the calculation formula is as follows: = .
[0052] Optionally, by introducing a redundancy parameter , the current redundancy and redundancy gap are used to quantify the coding coverage status and resource requirement degree of each data packet in real time. Based on the non-uniform probability selection mechanism of redundancy, data packets with a large redundancy gap (i.e., insufficient coding coverage and urgent decoding requirements) are given a higher selection probability, fundamentally reducing the risk of overall decoding failure caused by insufficient coverage of individual data packets. This is especially applicable to practical scenarios with a finite code length K and a finite number of transmission batches N (such as small data packet transmission), and can improve the decoding reliability under limited resource constraints.
[0053] As an optional embodiment, a target candidate set is constructed based on the redundancy gap of each data packet and the first data packet set, including: in response to the redundancy gap being greater than zero, screening out data packets corresponding to the redundancy gap from the first data packet set to construct an initial candidate set; obtaining the number of the first data packets in the initial candidate set and comparing the number of the first data packets with a target degree value to obtain a comparison result; in response to the comparison result indicating that the number of the first data packets is less than the target degree value, supplementing data packets corresponding to the redundancy gap equal to zero in the first data packet set to the initial candidate set to obtain a target candidate set, where the number of the second data packets in the target candidate set is greater than or equal to the target degree value.
[0054] In this embodiment, when the redundancy gap is greater than zero, data packets corresponding to the redundancy gap can be screened out from the first data packet set to construct an initial candidate set. Then, the number of the first data packets in the initial candidate set is obtained and compared with the target degree value. If the number of the first data packets is less than the target degree value, data packets corresponding to the redundancy gap equal to zero in the first data packet set are supplemented to the initial candidate set, and the above operation of supplementing data packets is repeatedly executed until the scale of the candidate set is greater than or equal to the target degree value, so as to achieve the purpose of obtaining the target candidate set.
[0055] Optionally, the initial candidate set can be simply referred to as the candidate set and can be represented by C. The number of the first data packets is used to represent the number of data packets in the initial candidate set and can be represented by |C|.
[0056] For example, from the sensed data packet set , all >0 data packets are selected to form a candidate set C. If |C| < d, it indicates that the scale of the initial candidate set is insufficient and data packets need to be supplemented to meet the selection requirement of the batch degree value d. Data packets of in the current sensed data packet set can be incorporated into the initial candidate set (if there are multiple equal data packets, all can be incorporated), and the supplementation is repeated until the scale of the initial candidate set C is |C| ≥ d, and the initial candidate set at this time is determined as the target candidate set.
[0057] Optionally, after obtaining the comparison result, the method further includes: in response to the comparison result that the number of first data packets is greater than or equal to the target degree value, determining the initial candidate set as the target candidate set.
[0058] For another example, if |C| ≥ d, it means that the size of the initial candidate set meets the requirement of selecting d data packets in the current batch. In this case, the initial candidate set C remains unchanged and proceeds to the subsequent selection decision stage.
[0059] As an optional implementation, based on the target degree value, multiple target data packets are selected from the target candidate set according to a selection strategy to construct a second data packet set, including: determining the probability value of each data packet based on the redundancy gap of each data packet in the target candidate set; sorting the data packets in the target candidate set according to the target sorting method of the probability values to obtain a sorted target candidate set; and selecting data packets with the target degree value from the sorted target candidate set to construct the second data packet set.
[0060] In this embodiment, the probability value of each data packet is determined based on the redundancy gap of each data packet in the target candidate set. Then, the data packets in the target candidate set are sorted according to the target sorting method of the probability values to obtain the sorted target candidate set. Finally, a target degree value of data packets is selected from the sorted target candidate set to construct the second data packet set.
[0061] Optionally, the probability value can be represented by P, then the data packet The probability value is The target can be sorted in descending order.
[0062] For example, after obtaining the redundancy gap of each data packet in the target candidate set, the probability value of each data packet can be calculated first, and the data packets in the target candidate set can be sorted in descending order of probability value. Then, the first d data packets are selected from the sorted target candidate set to construct the data packet set S, ensuring that data packets with urgent needs get priority for encoding.
[0063] As an optional implementation, the probability value of each data packet is determined based on the redundancy gap of each data packet in the target candidate set using the following formula, including:
[0064] in, Used to represent data packets The probability value; j is used to iterate through all data packets in the target candidate set.
[0065] In this embodiment, after obtaining the redundancy gap of each data packet in the target candidate set, the redundancy gaps of all data packets in the target candidate set are summed to obtain the target sum value. The ratio of the redundancy gap of the i-th data packet to the target sum value is determined as the probability value of the i-th data packet. Through the above calculation method, the probability value of each data packet in the target candidate set can be obtained, and the calculation method is as follows:
[0066] in, Used to represent data packets The probability value, which can be simply referred to as probability. That is, selecting d data packets from |C| for external encoding, each data packet... The probability of being selected should be related to Proportional, that is The larger, the better The higher the probability of being selected, the less likely it is to be selected; conversely, the lower the probability, the less likely it is to be selected.
[0067] As an optional embodiment, the method further includes, through the following formula: obtaining the initial redundancy of each data packet in the target candidate set and the decrement function of the target redundancy value; and determining the current redundancy of each data packet in the first data packet set corresponding to the data packets in the target candidate set based on the initial redundancy and the decrement function of each data packet in the target candidate set.
[0068] In this embodiment, the initial redundancy of each data packet in the target candidate set and the decrement function of the target redundancy value are obtained. Then, based on the initial redundancy and decrement function of each data packet in the target candidate set, the current redundancy of each data packet corresponding to the data packet in the first data packet set and the data packet in the target candidate set is determined.
[0069] Optionally, the decreasing function can be called the degree-increment correlation function, or the increment function, which can be obtained through... Let m represent the m-th batch. The degree-incremental correlation function is a decreasing function of the sampling degree d, and the smaller d is, the larger α(d) is; the larger d is, the smaller α(d) is, that is: α(1)>α(2)>...>α(D), where D is the maximum degree value.
[0070] Furthermore, the degree-increment correlation function is used to reflect the differentiated weights of the contribution of different degree batches to the redundancy of data packets. The probability that the rank of the coefficient matrix of a batch with a small degree value equals the degree value d is higher, making it easier to decode independently. Therefore, a larger increment α(d) is assigned to batches with small degree values: allowing data packets with large redundancy gaps to quickly accumulate redundancy and reach the target threshold (redundancy parameter η) as soon as possible; when the redundancy of a data packet approaches or reaches η, its redundancy gap Δη...i The smaller the number of selections, the lower the probability of being selected in subsequent batches, thus avoiding repeated selections and reducing resource waste.
[0071] Furthermore, large-degree batches contain a large number of data packets, with each individual packet contributing a small percentage to the batch's successful decoding. Additionally, the probability that the rank of the coefficient matrix is less than the degree value d is relatively high, making decoding difficult and requiring assistance from other batches. Allocating a large increment to these batches could lead to excessive accumulation of data packet redundancy. Therefore, a smaller increment α(d) is assigned to large-degree batches: due to the small increment, even if the same data packet is selected multiple times in a large-degree batch, its redundancy will not quickly saturate. This balances the uniformity of data packet coverage without negatively impacting overall transmission efficiency due to "difficult-to-decode batches" consuming excessive resources.
[0072] Optionally, based on the initial redundancy and decreasing function of each data packet in the target candidate set, the current redundancy of each data packet corresponding to the data packets in the target candidate set is updated using the following formula, so that the updated current redundancy is determined as the current redundancy of the data packet, including: .
[0073] For example, after selecting d data packets from |C| according to probability values, the redundancy of the selected data packets needs to be updated, as shown below: .
[0074] As an optional implementation method, multiple batch codes are generated based on a second data packet set and a preset maximum number of transmission batches for the batched sparse code, including: constructing a target matrix based on the second data packet set; obtaining a coefficient matrix in the target domain; and generating multiple batch codes based on the target matrix, the coefficient matrix, and the preset maximum number of transmission batches.
[0075] In this embodiment, a target matrix can be constructed based on the second data packet set, and then a coefficient matrix in the target domain can be obtained. Based on the target matrix, coefficient matrix and preset maximum transmission batch number obtained above, the purpose of generating multiple batch codes can be achieved.
[0076] Optionally, a target matrix is constructed using data from the selected data packet set S, and the target matrix can be represented by B. The target domain can be a finite field, through... The coefficient matrix can be represented by G, and the dimension of G is... .
[0077] For example, using data from the selected data packet set S, a target matrix B is constructed, and then a coefficient matrix is generated using random elements. (Elements are taken from a finite field) The selected d data packets are linearly combined to generate a batch code Y=B containing M encoded packets. G, based on the preset maximum number of transmission batches and the batch code calculation method mentioned above, can generate a batch code corresponding to each batch.
[0078] As an optional implementation, multiple batch codes are generated based on the target matrix, the coefficient matrix, and the preset maximum number of transmission batches, including: obtaining the index value of the current batch; in response to the index value being equal to the preset maximum number of transmission batches, and / or the current redundancy of each data packet in the first data packet set being greater than or equal to the redundancy parameter, multiple batch codes are generated based on multiple target matrices and multiple coefficient matrices under different batches.
[0079] In this embodiment, the index value of the current batch is obtained. If the index value is equal to the preset maximum number of transmission batches, and / or the current redundancy of each data packet in the first data packet set is greater than or equal to the redundancy parameter, then multiple batch codes can be generated based on multiple target matrices and multiple coefficient matrices under different batches.
[0080] For example, in a loop that generates multiple batch codes, the required loop termination condition is: reaching a preset total batch size N, or all data packets... ≥η.
[0081] By applying the technical solution of this embodiment, the target degree value is first sampled from the acquired first data packet set according to a preset degree distribution. Then, based on the redundancy parameter of the first data packet set and the current redundancy of each data packet, the redundancy gap of each data packet is calculated to reflect the degree of demand for encoding resources by the data packet. Next, a candidate set is constructed based on the redundancy gap, and target data packets are selected from the target candidate set according to a selection strategy to form a second data packet set. Batch code generation and internal code encoding are performed on the second data packet set, and finally, it is sent to the target node in the Internet of Things. Because the above process fully considers the differences in the degree of demand for encoding resources by each data packet, and achieves on-demand, non-equal probability data packet selection and encoding resource allocation through redundancy gaps, it avoids the blind and uneven resource allocation, insufficient coverage, or waste caused by random packet selection. This effectively solves the technical problem of low data transmission efficiency under limited resources, and achieves the technical effect of improving data transmission efficiency under limited resources.
[0082] Furthermore, as a refinement and extension of the specific implementation of the above embodiments, in order to fully illustrate the specific implementation process of this embodiment, this embodiment considers a multi-hop Internet of Things transmission system. In the network model of this system, the source node needs to upload a set of sensing data packets to the target node. (K represents the total number of data packets). Due to power and energy-saving limitations, the source node cannot transmit reliably directly and requires the assistance of a relay node. Forwarding is performed. The system employs erasable channel modeling and uses a matrix. Indicates the transmission status between nodes. Represents a node Towards The probability of erasing transmitted data.
[0083] Optionally, the data encoding process during transmission is as follows: Step 1: Define the core parameters.
[0084] Redundancy parameter η: The number of times the target is selected for each input data packet. Where N is the preset maximum number of transmission batches. The specific value is determined by the specific application and scenario.
[0085] Current redundancy : The cumulative number of times the i-th input data packet has been selected in the historical encoding, and its initial value. It can reflect the "encoding coverage status" of each data packet in real time.
[0086] Redundancy gap = : Quantify the degree of encoding resource requirements of data packets. >0 indicates an input data packet Coverage is still required, and The larger the size, the more urgent the need.
[0087] Degree-Incremental Association Function α(d) is a decreasing function of the sampling degree value d, where the smaller d is, the larger α(d) is; the larger d is, the smaller α(d) is, i.e.: α(1)>α(2)>...>α(D), where D is the maximum degree value, and m is used to represent the m-th batch. This is used to reflect the differentiated weights that reflect the contribution of different degree value batches to the redundancy of data packets.
[0088] Step 2, external code encoding (source node).
[0089] The first step is degree sampling. Based on the degree distribution... ( The degree value d is obtained by sampling the set of perception data packets.
[0090] The second step is data packet selection. This involves calculating the redundancy gap for all data packets. n Packets with a value greater than 0 are used to form the candidate set C. If |C| < d, it indicates that the size of the initial candidate set is insufficient, and packets need to be supplemented to meet the selection requirement of the batch degree value d. That is, the packets in the current sensed packet set can be incorporated into the initial candidate set (if there are multiple equal packets, all can be incorporated), and the supplementation is repeated until the size of the initial candidate set C is |C| ≥ d; if |C| ≥ d, it means that the size of the initial candidate set meets the requirement of selecting d packets in the current batch, and then the initial candidate set C remains unchanged and enters the subsequent selection decision-making process.
[0091] Furthermore, according to the probability value of each packet, d packets are selected from |C| for outer coding, and the probability of each packet being selected should be proportional to , that is the larger is, the greater the probability of being selected; vice versa. The current redundancy of the selected packets is updated to: . The calculation method of the probability value is:
[0092] Step 3, linear combination. Use the data in the selected packet set S to form the target matrix B, and then through the coefficient matrix generated by random elements (the elements are taken from the finite field ), perform a linear combination on the selected d packets to generate a batch code Y = B G containing M coded packets.
[0093] Step 3, inner code encoding (relay node).
[0094] If each batch code contains M coded packets, random linear network coding (RLNC) can be performed on the M coded packets inside each batch code, only limiting the operations within the batch. Assume that node receives coded packets of this batch, and through the transfer matrix performs re-encoding to generate new M coded packets. The expression for realizing the above re-encoding is: , and at this time, the encoded batch code is forwarded to the next-hop node until the destination node.
[0095] Optionally, the decoding process during data transmission is as follows: At the receiving end, the BP decoding algorithm can be used for decoding operations. The specific process is as follows: Step 1, batch reception and storage: The destination node receives each batch code and stores the relevant coded packets and associated information; Step 2, identifiable batch recognition: Traverse the received batch codes. If the rank of the coefficient matrix of a certain batch code is equal to its degree value ( , If the product of the generator matrix and the transition matrix is used, it is determined to be a readable batch code; Step 3, readable data packet recovery: For the readable batch code, the Gaussian elimination algorithm is used to solve the linear equation system. Restore the associated input data packets Step 4, Batch Update: Substitute the recovered data packet into other undecoded batch codes, delete the association trace of the data packet in the batch, and update the batch's degree value, coefficient matrix, and encoded packet data. This step includes: deleting the index of the recovered data packet based on the associated data packet index of the current batch; deleting the coefficient matrix... The corresponding line in the data packet that has been recovered; update the encoded packet data. ( Used to represent the row corresponding to the recovered data packet in the coefficient matrix, and the degree value of the current batch is decremented by one. Step 5, iterative decoding: Repeat the above steps until there are no new decodable batch codes or all data packets are successfully decoded.
[0096] Furthermore, after successful decoding, the above problem needs to be modeled, as shown in the following modeling process: Step 1, Optimize the objective. Under constraints, maximize the decoding rate; the objective function is: Step two, constraints. Degree distribution constraint: and Redundancy parameter constraints: Incremental function constraints: and .
[0097] Furthermore, a joint optimization strategy can be employed to solve for the optimal degree distribution. Redundancy parameter and increment function To achieve the solution of the problem, the specific implementation method is as follows: Step 1, Discretize the parameter space: For and ( The first step involves discretizing the data to reduce the complexity of the solution. The second step is to construct the reinforcement learning model: using the degree distribution Ψ, redundancy parameter η, and increment function α(d) as the action space of the agent, the decoding rate R as the reward function, and the channel state of the encoded transmission and the data packet redundancy coverage state as the state space, a reinforcement learning optimization model is constructed. The third step is to optimize the degree distribution: based on the constructed reinforcement learning model, for each set of discrete... and The optimal degree distribution is learned through iterative interaction between the agent and the environment. To maximize the decoding rate R; Step 4, Optimal solution selection: Traverse all discrete parameter combinations and their corresponding optimal solutions. Select the one with the highest decoding rate R. , , As the final solution.
[0098] In this embodiment, the encoding and decoding process of traditional BATS codes is as follows: External code encoding (source node). Degree sampling: Obtain the degree value d by sampling according to the degree distribution Ψ; Data packet selection: Select d different data packets from K input data packets completely randomly and with equal probability to form a set B; Linear combination: Use a randomly generated coefficient matrix to linearly combine the selected d data packets to generate a batch code containing M encoded packets. Internal encoding (relay node). Random linear network coding (RLNC) is performed on the M encoded packets within each batch code, limited to intra-batch operations. Decoding (destination node): After receiving a sufficient number of batches, algorithms such as BP, Gaussian elimination, and deactivated decoding are used to recover the original data.
[0099] In this embodiment, the data packet selection strategy is optimized only in the external code stage, which can reduce the cost and threshold of technology upgrades. At the same time, each batch of coding only adds one redundancy calculation and packet selection decision operation. The computational complexity and storage overhead are negligible compared to the core operations of channel coding, which has the characteristics of low deployment cost and is easy to implement in engineering and large-scale promotion.
[0100] Optionally, the redundancy parameter and the degree-increment correlation function can be dynamically adjusted according to specific application scenarios. For example, the redundancy parameter can be appropriately increased for scenarios with high reliability requirements, the function curve of the degree-increment correlation function can be optimized for scenarios with low latency requirements, and the degree distribution and redundancy strategy can be flexibly matched for different network channel conditions, thereby adapting to the differentiated needs of various data transmission scenarios and having a wider range of applications.
[0101] In the embodiments of this application, Figure 2 This illustration shows a schematic diagram comparing the decoding rate of a PPO-based encoding optimization scheme and a traditional scheme, as provided in an embodiment of this application. Figure 2 As shown, the horizontal axis represents the number of training rounds, and the vertical axis represents the decoding rate. The solid line represents the scheme of this application, and the dashed line represents the traditional scheme. Figure 2 As can be seen, the proposed scheme (ppo) achieves a stable decoding rate of 0.78~0.82 after training, which is significantly higher than the traditional scheme of 0.58~0.62, thus demonstrating the performance advantage of the proposed scheme.
[0102] Optionally, Proximal Policy Optimization (PPO) is a policy gradient algorithm that ensures the stability of the training process by limiting the step size of policy updates. It is used to dynamically decide how to select the optimal combination of data packets from the target candidate set.
[0103] In the embodiments of this application, Figure 3 This illustration shows a schematic diagram of a data packet redundancy distribution provided in an embodiment of this application, such as... Figure 3 As shown, the horizontal axis represents the packet index, the vertical axis represents cumulative redundancy, the bar chart represents the actual redundancy value of each packet, and the dashed line represents the average redundancy. Figure 3 It is evident that the proposed scheme (PPO control) improves the reliability of critical data packets by differentiating redundancy allocation, while ensuring the overall redundancy level remains stable, thereby optimizing the decoding rate.
[0104] In this embodiment, the target degree value is first sampled from the acquired first data packet set according to a preset degree distribution. Then, based on the redundancy parameter of the first data packet set and the current redundancy of each data packet, the redundancy gap of each data packet is calculated to reflect the degree of demand for encoding resources by the data packet. Next, a candidate set is constructed based on the redundancy gap, and target data packets are selected from the target candidate set according to a selection strategy to form a second data packet set. Batch code generation and internal code encoding are then performed on the second data packet set, and finally, it is sent to the target node in the Internet of Things. Because the above process fully considers the differences in the degree of demand for encoding resources by each data packet, and achieves on-demand, non-equal probability data packet selection and encoding resource allocation through redundancy gaps, it avoids the blind and uneven resource allocation, insufficient coverage, or waste caused by random packet selection. This effectively solves the technical problem of low data transmission efficiency under limited resources, achieving the technical effect of improving data transmission efficiency under limited resources.
[0105] Furthermore, as Figure 1 In the specific implementation of the method, in the embodiments of this application, Figure 4 This illustration shows a schematic diagram of a redundancy-based batch sparse code encoding device according to an embodiment of this application. Figure 4 As shown, the redundancy-based batch sparse code encoding device 400 includes: a first acquisition unit 401, a first determination unit 402, a construction unit 403, and a transmission unit 404.
[0106] The first acquisition unit 401 is used to acquire the first data packet set in the outer code encoding process of the batch sparse code, and to sample the first data packet set based on the preset degree distribution to obtain the target degree value of the current batch, wherein the target degree value is used to characterize the number of data packets to be selected from the first data packet set.
[0107] The first determining unit 402 is used to obtain the redundancy parameter of the first data packet set and the current redundancy of each data packet in the first data packet set, and to determine the redundancy gap of each data packet based on the redundancy parameter and the current redundancy of each data packet. The current redundancy is used to represent the cumulative number of times the data packet has been selected in historical encoding, and the redundancy gap is used to represent the degree of demand of the data packet for encoding resources.
[0108] The construction unit 403 is used to construct a target candidate set based on the redundancy gap of each data packet and the first data packet set, and to select multiple target data packets from the target candidate set according to the selection strategy based on the target degree value to construct a second data packet set.
[0109] The sending unit 404 is used to generate multiple batch codes based on the second data packet set and the preset maximum number of transmission batches of the batch sparse code, and to perform internal code encoding processing on the multiple batch codes respectively, so as to send the encoded multiple batch codes to the target node in the Internet of Things.
[0110] Optionally, the device is further configured to: determine the redundancy gap of each data packet based on the redundancy parameter and the current redundancy of each data packet using the following formula, including: =
[0111] in, Used to represent redundancy parameters, and N is used to represent the preset maximum number of transmission batches; Used to represent the current redundancy of the i-th data packet, and K is used to represent the total number of data packets in the first data packet set; Used to represent the redundancy gap of the i-th data packet.
[0112] Optionally, the device is further configured to: construct a target candidate set based on the redundancy gap of each data packet and a first data packet set, including: in response to a redundancy gap being greater than zero, selecting data packets corresponding to the redundancy gap from the first data packet set to construct an initial candidate set; obtaining the number of first data packets in the initial candidate set and comparing the number of first data packets with a target degree value to obtain a comparison result; in response to a comparison result that the number of first data packets is less than the target degree value, supplementing the initial candidate set with data packets from the first data packet set that correspond to a redundancy gap equal to zero to obtain a target candidate set, wherein the number of second data packets in the target candidate set is greater than or equal to the target degree value.
[0113] Optionally, the device is further configured to: select multiple target data packets from the target candidate set according to a selection strategy based on the target degree value to construct a second data packet set, including: determining the probability value of each data packet based on the redundancy gap of each data packet in the target candidate set; sorting the data packets in the target candidate set according to the target sorting method of the probability values to obtain a sorted target candidate set; and selecting data packets with the target degree value from the sorted target candidate set to construct the second data packet set.
[0114] Optionally, the device is further configured to: determine the probability value of each data packet based on the redundancy gap of each data packet in the target candidate set using the following formula, including:
[0115] in, Used to represent data packets The probability value; j is used to iterate through all data packets in the target candidate set.
[0116] Optionally, the device is further configured to: obtain the initial redundancy of each data packet in the target candidate set, and the decrement function of the target redundancy value; and, based on the initial redundancy and decrement function of each data packet in the target candidate set, determine the current redundancy of each data packet in the first data packet set corresponding to the data packets in the target candidate set.
[0117] Optionally, the device is also used to: generate multiple batch codes based on a second data packet set and a preset maximum number of transmission batches for the batched sparse code, including: constructing a target matrix based on the second data packet set; obtaining a coefficient matrix in the target domain; and generating multiple batch codes based on the target matrix, the coefficient matrix, and the preset maximum number of transmission batches.
[0118] Optionally, the device is also used to: generate multiple batch codes based on a target matrix, a coefficient matrix, and a preset maximum number of transmission batches, including: obtaining the index value of the current batch; in response to the index value being equal to the preset maximum number of transmission batches, and / or the current redundancy of each data packet in the first data packet set being greater than or equal to a redundancy parameter, generating multiple batch codes based on multiple target matrices and multiple coefficient matrices under different batches.
[0119] In this embodiment, a first acquisition unit acquires a first data packet set during the outer code encoding process of the batched sparse code, and samples the first data packet set based on a preset degree distribution to obtain the target degree value of the current batch. The target degree value characterizes the number of data packets to be selected from the first data packet set. A first determination unit acquires a redundancy parameter of the first data packet set and the current redundancy of each data packet in the first data packet set. Based on the redundancy parameter and the current redundancy of each data packet, a redundancy gap is determined for each data packet. The current redundancy represents the cumulative number of times a data packet has been selected in historical encoding, and the redundancy gap represents the number of data packets selected. Based on the packet's demand for encoding resources, the construction unit builds a target candidate set based on the redundancy gap of each data packet and the first data packet set. Then, based on the target degree value, multiple target data packets are selected from the target candidate set according to a selection strategy to construct a second data packet set. The sending unit generates multiple batch codes based on the second data packet set and the preset maximum number of transmission batches for the batched sparse code. These batch codes are then internally encoded and sent to the target nodes in the Internet of Things. This effectively solves the technical problem of low data transmission efficiency under limited resources, achieving the technical effect of improving data transmission efficiency under limited resources.
[0120] It should be noted that other corresponding descriptions of the functional units involved in the redundancy-based batch sparse code encoding device provided in this application embodiment can be found in [reference]. Figure 1 The corresponding descriptions in [the document] will not be repeated here.
[0121] This application also provides a computer device, which may specifically be a personal computer, a server, a network device, etc. Figure 5 This application provides a schematic diagram of the device structure of a computer device according to an embodiment of the present application. Figure 5 As shown, the computer device includes a bus, a processor, memory, and a communication interface, and may also include an input / output interface and a display device. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores location information. The network interface allows communication with external terminals via a network connection. When the computer program is executed by the processor, it implements the steps in the various method embodiments.
[0122] Those skilled in the art will understand that Figure 5The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0123] In one embodiment, a computer-readable storage medium is provided, which may be non-volatile or volatile, having stored thereon a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0124] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0125] It should be noted that the user personal information involved in the embodiments of this application is all authorized (with the knowledge and consent) by the relevant parties or fully authorized by all parties, and the executing entity can obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with the relevant laws and regulations of the relevant countries and regions, and do not violate public order and good morals. It should be noted that if any software tools or components other than those of this company appear in the embodiments of this application, they are merely illustrative examples and do not represent actual use.
[0126] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, graphics processors, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0127] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are 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.
[0128] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A batch sparse code encoding method based on redundancy, characterized in that, The method includes: The first data packet set in the outer code encoding process of the batch sparse code is obtained, and the first data packet set is sampled based on a preset degree distribution to obtain the target degree value of the current batch, wherein the target degree value is used to characterize the number of data packets to be selected from the first data packet set; Obtain the redundancy parameter of the first data packet set and the current redundancy of each data packet in the first data packet set, and determine the redundancy gap of each data packet based on the redundancy parameter and the current redundancy of each data packet, wherein the current redundancy is used to represent the cumulative number of times the data packet has been selected in historical encoding, and the redundancy gap is used to represent the degree of demand of the data packet for encoding resources; Based on the redundancy gap of each data packet and the first data packet set, a target candidate set is constructed, and based on the target degree value, multiple target data packets are selected from the target candidate set according to the selection strategy to construct a second data packet set; Based on the second data packet set and the preset maximum number of transmission batches of the batch sparse code, multiple batch codes are generated, and internal code encoding is performed on each of the multiple batch codes to send the encoded multiple batch codes to the target node in the Internet of Things.
2. The method according to claim 1, characterized in that, The redundancy gap for each data packet is determined using the following formula, based on the redundancy parameter and the current redundancy of each data packet: = in, Used to represent the redundancy parameter, and N is used to represent the preset maximum number of transmission batches; The current redundancy used to represent the i-th data packet, and K is used to represent the total number of data packets in the first data packet set; This is used to represent the redundancy gap of the i-th data packet.
3. The method according to claim 1, characterized in that, Based on the redundancy gap of each data packet and the first data packet set, a target candidate set is constructed, including: In response to the redundancy gap being greater than zero, data packets corresponding to the redundancy gap are selected from the first data packet set to construct an initial candidate set; Obtain the first data packet count of the initial candidate set, and compare the first data packet count with the target degree value to obtain the comparison result; In response to the comparison result that the number of the first data packets is less than the target degree value, the data packets in the first data packet set that correspond to the redundancy gap being equal to zero are added to the initial candidate set to obtain the target candidate set, wherein the number of the second data packets in the target candidate set is greater than or equal to the target degree value.
4. The method according to claim 1, characterized in that, Based on the target degree value, multiple target data packets are selected from the target candidate set according to the selection strategy to construct a second data packet set, including: Based on the redundancy gap of each data packet in the target candidate set, determine the probability value of each data packet; According to the target sorting method of the probability values, the data packets in the target candidate set are sorted to obtain the sorted target candidate set; Select the target degree value data packets from the sorted target candidate set to construct the second data packet set.
5. The method according to claim 4, characterized in that, The probability value of each data packet is determined based on the redundancy gap of each data packet in the target candidate set using the following formula, including: in, Used to represent data packets The probability value; j is used to traverse all data packets in the target candidate set.
6. The method according to claim 4, characterized in that, The method further includes: Obtain the initial redundancy of each data packet in the target candidate set, and the decrement function of the target redundancy value; Based on the initial redundancy of each data packet in the target candidate set and the decreasing function, the current redundancy of each data packet in the first data packet set and the data packets in the target candidate set are determined.
7. The method according to claim 1, characterized in that, Based on the second data packet set and the preset maximum transmission batch size of the batched sparse code, multiple batch codes are generated, including: Based on the second data packet set, construct the target matrix; Obtain the coefficient matrix in the target domain, and generate multiple batch codes based on the target matrix, the coefficient matrix, and the preset maximum number of transmission batches.
8. The method according to claim 7, characterized in that, Based on the target matrix, the coefficient matrix, and the preset maximum transmission batch number, multiple batch codes are generated, including: Obtain the index value of the current batch; In response to the index value being equal to the preset maximum number of transmission batches, and / or the current redundancy of each data packet in the first data packet set being greater than or equal to the redundancy parameter, multiple batch codes are generated based on multiple target matrices and multiple coefficient matrices under different batches.
9. A batch sparse code encoding device based on redundancy, characterized in that, The device includes: The first acquisition unit is used to acquire the first data packet set in the outer code encoding process of the batch sparse code, and to sample the first data packet set based on a preset degree distribution to obtain the target degree value of the current batch, wherein the target degree value is used to characterize the number of data packets to be selected from the first data packet set; The first determining unit is configured to obtain the redundancy parameter of the first data packet set and the current redundancy of each data packet in the first data packet set, and determine the redundancy gap of each data packet based on the redundancy parameter and the current redundancy of each data packet, wherein the current redundancy is used to represent the cumulative number of times the data packet has been selected in historical encoding, and the redundancy gap is used to represent the degree of demand of the data packet for encoding resources. The construction unit is configured to construct a target candidate set based on the redundancy gap of each data packet and the first data packet set, and select multiple target data packets from the target candidate set according to the selection strategy based on the target degree value to construct a second data packet set; The sending unit is configured to generate multiple batch codes based on the second data packet set and the preset maximum number of transmission batches of the batch sparse code, and to perform internal code encoding processing on the multiple batch codes respectively, so as to send the encoded multiple batch codes to the target node in the Internet of Things.
10. A computer device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 8.