Balanced ternary numerical value-based three-dimensional structured coding method and system

By using a three-dimensional structured encoding method based on balanced ternary values, the density and security issues of binary and traditional ternary encoding are resolved, achieving high-density, tamper-resistant data encoding and enhancing the system's security and fault tolerance.

CN120915299APending Publication Date: 2025-11-07袁泉
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510973863.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-15
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

In existing technologies, binary information has low encoding density and poor fault tolerance, while traditional ternary encoding has high computational complexity and insufficient system security.

Method used

A three-dimensional structured coding method based on balanced ternary values ​​is adopted. By converting decimal data into a balanced ternary numerical sequence, a three-dimensional coding unit is generated. System-level conservation verification is performed using right-end appending rules, path constraint extension, timestamp obfuscation mechanism, and context-dependent coding mechanism.

Benefits of technology

It achieves high-density, tamper-resistant data encoding, ensuring that the encoding generation logic is irreversible, thus enhancing the system's security and fault tolerance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120915299A_ABST
    Figure CN120915299A_ABST
Patent Text Reader

Abstract

The invention discloses a three-dimensional structured coding method and system based on balanced ternary numerical values, and the method comprises the steps: S1, inputting data, and converting the data into a balanced ternary numerical value sequence; s2, setting a right end addition rule, and generating a three-dimensional coding unit by using the numerical sequence; and S3, carrying out system-level conservation verification on all the effective code sets. According to the scheme, high-density and tamper-resistant data coding is realized by adding path constraint and a system-level conservation mechanism at the right end, path uniqueness constraint is generated based on a coding rule of a numerical set {-1, 0, + 1}, a global conservation verification and dynamic compensation mechanism is set, and the scheme does not depend on a specific symbol form and is suitable for the field of information security and high-density data storage.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of information coding, in particular to a three-dimensional structured coding method and system based on balanced ternary numerical values. BACKGROUND

[0002] Information coding is the process of converting information elements into computer recognizable symbols through specific rules, aiming to realize the standardized storage, retrieval and efficient processing of information; information coding converts analog / digital information into computer processable codes (such as binary, ASCII, etc.) by establishing a unique correspondence between symbols and information elements, and gives it a special meaning to support classification, sorting and transmission, and is widely used in database management, file system, communication protocol (such as postal code, music symbol) and computer internal data processing.

[0003] In the prior art, when using binary for information coding, there are problems of low information density and poor fault tolerance, and when using traditional ternary for information coding, the standard ternary (0, 1, 2) does not utilize symmetry, resulting in high computational complexity, and there are problems of generating a large number of invalid states when generating codes by free combination, reducing system security. SUMMARY

[0004] In view of the above technical problems, the present application provides a three-dimensional structured coding method and system based on balanced ternary numerical values.

[0005] The present application is implemented by using the following technical solutions: In a first aspect, the three-dimensional structured coding method based on balanced ternary numerical values comprises the following steps: Step S1: input data, convert the data into a balanced ternary numerical value sequence; Step S2: set a right-end appending rule, and generate a three-dimensional coding unit using the numerical value sequence; Step S3: implement system-level conservation verification on the entire valid coding set.

[0006] Specifically, the data input in step S1 is a decimal numerical value, which is converted into a balanced ternary to obtain a corresponding numerical value list, wherein each numerical value is selected from the numerical value set {-1, 0, +1}.

[0007] Specifically, the generation of the three-dimensional coding unit in step S2 comprises: Divide the balanced ternary numerical value sequence from left to right into units, each unit including three numerical units in the form of (a1, a2, a3), and the unit dimensions a1, a2, a3∈{-1, 0, +1}; According to the right-end appending rule, for units with less than three numerical values at the right end, use the null value ∅ to fill in the gaps.

[0008] Specifically, step S2 further includes: Arbitrarily symbolize the three-dimensional coding unit, mapping the numerical values ​​{-1, 0, +1} to {-, o, +}.

[0009] Specifically, step S2 further includes verifying duplicate 3D coding units. When duplicate 3D coding units occur during the generation process, processing is performed, including: Path constraint extension rule: When consecutive identical units are detected, a dimensionality upgrade operation is forcibly triggered; Timestamp obfuscation mechanism: Set a dynamic perturbation factor and embed the timestamp hash value into the encoding generation process to ensure that the same input data generates different units; Compensation unit randomization: Non-deterministic compensation, when a duplicate unit is detected, the compensation unit type is randomly selected; Context-dependent encoding: The previous encoding unit is used as the state input to dynamically adjust the generation rule of the current unit and generate the current unit through an irreversible function.

[0010] Specifically, step S3, the conservation verification, includes: The summation of each dimension of all three-dimensional coding units in the coding sequence is calculated; If the sum of dimensions is not zero, then a compensation unit is appended to the end of the sequence; Iterate through the above process until the sum of all dimensions is 0, and then output the verification sequence.

[0011] Specifically, the compensation unit types include inverse units and chaotic sequences, selected from the numerical set {-1, 0, +1}, and follow a right-end appending rule.

[0012] Firstly, a three-dimensional structured coding system based on balanced ternary values ​​is provided to implement the aforementioned three-dimensional structured coding method based on balanced ternary values, including: Encoding generation module: Converts input decimal data into a balanced ternary numerical sequence to generate a three-dimensional encoding unit; Path tracing module: verifies validity by reverse-stripping the rightmost value; Conservation calculation module: calculates the sum of values ​​in each dimension in real time and triggers compensation operations.

[0013] The beneficial effects of this invention are as follows: This invention achieves high-density, tamper-resistant data encoding through numerical mapping rules, generation path constraints, and system-level conservation verification mechanisms; the numerical system of this invention can be mapped to any symbol (such as `○ / + / -` or `zero / positive / negative`), without depending on the specific symbol form; the path constraints make the encoding generation logic irreversible; and data tampering is detected through global conservation. Attached Figure Description

[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiments or prior art description. Obviously, the drawings in the following description only show some of the embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from the structures shown in the drawings without creative labor.

[0015] Figure 1 To generate a route schematic diagram for three-dimensional coding in the embodiments of the present application; Figure 2 To generate a flow chart for three-dimensional structured coding based on balanced ternary numerical values in the embodiments of the present application. DETAILED DESCRIPTION

[0016] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the following will combine the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, not all the embodiments. The components of the embodiments of the present application described and shown in the drawings can be arranged and designed in various different configurations.

[0017] It should be noted that: similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0018] The following will describe some embodiments of the present application in detail. The following embodiments and features in the embodiments can be combined with each other without conflict. Figures 1-2 The following will describe some embodiments of the present application in detail. The following embodiments and features in the embodiments can be combined with each other without conflict.

[0019] The present application proposes a three-dimensional structured coding method based on balanced ternary numerical values, including the following steps: Step S1: converting data into a balanced ternary numerical value sequence, wherein each numerical value is selected from `{ -1, 0, +1}`; Step S2: generating a three-dimensional coding unit according to a right-end appending rule, and each unit is in the form of `(a1, a2, a3)`, wherein `a1, a2, a3 ∈ {-1, 0, +1}`; Step S3: implementing system-level conservation verification on the entire valid coding set.

[0020] In the present embodiment, when it is detected that the sum of a certain dimension of the coding sequence is not zero, an inverse numerical unit is inserted to make the whole satisfy the conservation. The numerical values `{ -1, 0, +1}` can be mapped to any three distinguishable symbols.

[0021] For example, Figure 1As shown, the encoding generation in this embodiment is based on a three-dimensional Cartesian coordinate system, and the dimensions 1 / 2 / 3 are labeled. Taking the path of (1, -1, 0) as an example, the generation includes the following steps: Step 1 (empty set): Label the origin position `∅`; Step 2 (one dimension): Extend along the X-axis to `(+1)`; Step 3 (two dimensions): Extend along the Y-axis to `(+1, -1)`; Step 4 (three dimensions): Extend along the Z-axis to `(+1, -1, 0)`.

[0022] In Figure 1 , there is also an arrow label, and the black solid arrow points to the generation direction, labeled "right-end addition rule".

[0023] As Figure 2 shown, the three-dimensional structured encoding based on balanced ternary numerical values and verification in this embodiment includes: S1: input data → convert to balanced ternary numerical sequence; S2: generate three-dimensional units according to the right-end addition rule; S3: detect whether the sum of each dimension is 0? → If not, insert a compensation unit and return to S3 (re-detect); → If yes, go to S4; S4: output the encoded sequence after verification. It also includes a feedback loop: return to S2 from the "no" branch of S3, forming a closed loop.

[0024] Example 1: Data encoding and compensation (numerical representation) 1. Input data: convert the decimal number `85` to balanced ternary: 85 10 = 1 × 3 4 + (-1) × 3³ + 1 × 3² + 0 × 3¹ + 1 × 3 0 ; Get the corresponding numerical sequence: `[+1, -1, +1, 0, +1]`; 2. Three-dimensional packaging: divide into units `(+1, -1, +1)` and `(0, +1, ∅)` (`∅` represents null value); 3. Compensation correction: detect that the sum of dimension 1 is `+1` and the sum of dimension 3 is `+1`, insert the compensation unit `(-1, 0, -1)`. Choose this compensation unit because it satisfies both a) the right-end addition rule and b) solves multi-dimensional imbalance with the smallest number of operations 4. Final sequence: (+1, -1, +1)(0, +1, 0)(-1, 0, -1); Verify that the sum of all dimensions is zero.

[0025] Example 2: Symbolic Representation (Optional Implementation) 1. Symbol mapping: Define `○=0`, `+=+1`, `-=-1`; 2. Generate path: `empty→(+)→(+-)→(+-○)`; 3. Conservation verification: The sum of the sign values ​​of all dimensions is zero (numerical level is the same as in Example 1).

[0026] In one embodiment, the present invention also provides a scheme for handling duplicate coding units during the generation process of three-dimensional coding units. When duplicate three-dimensional coding units (such as `(+1,-1,0)` appearing twice consecutively) occur during the generation process, the following mechanisms can be used to ensure system security and data integrity, including the following processing methods: 1. Path constraint expansion rules Dynamic dimensionality increment: When consecutive identical units are detected, a dimensionality increase operation is forcibly triggered. Original unit: `(a,b,c)`; The unit after dimensionality upgrade is: `(a,b,c,d)`, where `d` is the newly added dimension value (generated according to the conservation rule); Function: To break repetitive patterns while maintaining system-level conservation.

[0027] Example: Repeating sequence: [(+1,-1,0),(+1,-1,0)]; Dimensional upscaling: [(+1,-1,0,+1),(+1,-1,0,-1)]; Verify conservation: Σa_i = (+1) + (-1) = 0.

[0028] 2. Timestamp obfuscation mechanism Dynamic perturbation factor: This factor embeds timestamp hash values ​​into the encoding process to ensure that the same input data generates different units. The timestamp participates in the balanced ternary conversion algorithm. The perturbation factor formula is as follows: d_new = [ (d_orig XOR Hash(t)) mod 3 ] - 1; where t is the current timestamp and XOR represents the exclusive OR operation.

[0029] Effect: The same data generates different encoding units at different times.

[0030] 3. Randomization of compensation units Non-deterministic compensation: When a repetition unit is detected, a random compensation unit type is selected. When the repetition number is 1, the compensation strategy selects to insert a reverse unit (such as `(-1,+1,0)`); when the repetition number is ≥ 2, the compensation strategy selects to insert a chaotic sequence (such as `(0,+1,-1)`). The random seed is based on the system entropy pool to prevent deterministic attacks.

[0031] 4. Context-dependent encoding State machine model: The previous encoding unit is taken as the state input, and the current unit generation rule is dynamically adjusted: State S_t = (a_{t1}, b_{t1}, c_{t1}); Next Unit = f(S_t, Input Data); The function 'f' is designed as an irreversible mapping (such as a one-way hash function); it ensures that the same input data generates different units in different contexts.

[0032] In this embodiment, the present scheme monitors the numerical cumulative sum of each dimension in real time. When the sum of a certain dimension is non-zero, a compensation unit is automatically generated to restore balance with the least compensation operation, maximizing data effectiveness. The conservation equation is located as follows: Let the sum of the current dimension i be Si, and the compensation unit set C be inserted to make Si + ∑_{c∈C} c = 0 = 0, where c is the compensation unit.

[0033] Priority is given to single-unit compensation (k = 1), and secondary selection is given to multi-unit combination compensation.

[0034] In this embodiment, the algorithm flow of the compensation unit includes: Step 1: Dimension imbalance detection, initialization of the sum of each dimension, and return of the current sum of each dimension; Step 2: Compensation strategy selection, including: Single-dimensional imbalance (only one dimension and Si is not 0), generate compensation unit (c = (0, 0, -Si)); for example, if the sum of dimension 3 is +1, insert (0, 0, -1).

[0035] Multi-dimensional imbalance: Use matrix inverse operation to solve the minimum compensation unit set: Minimize ||C||1 Let the sum of the current dimension i be S_i, and the compensation unit set C be inserted to satisfy S_i + ∑_{c∈C} c_i = 0; where ||·||1 is the Manhattan norm.

[0036] Step 3: Compensation unit generation, single-unit compensation and update of the sum; Step 4: Data recombination and verification, insert compensation unit at the end of the original encoding sequence, recalculate the sum of each dimension, and ensure zero.

[0037] In a specific embodiment, the following is described: Step 1: Input data: original encoding unit sequence: 1. (+1, -1, +1); 2. (0, +1, -1); Step 2: Detect imbalance: Dimension 1 sum: +1 + 0 = +1; Dimension 2 sum: -1 + +1 = 0; Dimension 3 sum: +1 + (-1) = 0; Step 3: Compensation operation: insert compensation unit (-1, 0, 0) to get the final sequence: 1. (+1, -1, +1); 2. (0, +1, -1) 3. (-1, 0, 0); Step 4: Verify conservation: Dimension 1: +1 + 0 - 1 = 0; Dimensions 2 / 3 remain balanced.

[0038] The application also proposes a three-dimensional structured encoding system based on balanced ternary numerical values, for implementing the three-dimensional structured encoding method, comprising: Encoding generation module: converts input decimal data into balanced ternary numerical value sequence to generate three-dimensional encoding units; Path tracing module: verifies legality by reversing and stripping the rightmost numerical value; Conservation calculation module: calculates the sum of numerical values in each dimension in real time and triggers compensation operation.

[0039] This scheme reduces operation frequency by delaying compensation and processing multiple units in batches; enhances resistance to analysis by randomly selecting compensation positions for insertion through probabilistic compensation; and dynamically removes compensation unit position information during decoding. Through dynamic dimensioning, timestamp obfuscation, and non-deterministic compensation mechanisms, this scheme can effectively eliminate security risks caused by repeated encoding units while maintaining the core advantages of system-level conservation and path constraints.

[0040] For the foregoing embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that the application is not limited by the order of the described actions, because according to the application, some steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily required by the application.

[0041] In the above embodiments, the basic principles and main features of the present application and the advantages of the present application are described. It should be understood by those skilled in the art that the present application is not limited to the above embodiments, and the above embodiments and the description in the specification are only to illustrate the principles of the present application. Any modifications and changes made by those skilled in the art without departing from the spirit and scope of the present application shall be within the protection scope of the claims of the present application.

Claims

1. A three-dimensional structured encoding method based on balanced ternary numerical values, characterized in that, The method comprises the following steps: Step S1: inputting data and converting the data into a balanced ternary numerical sequence; Step S2: setting a right-end appending rule and generating a three-dimensional coding unit by using the numerical sequence; Step S3: performing a system-level conservation verification on all valid coding sets.

2. The ternary structured encoding method based on balanced ternary numerical values according to claim 1, characterized in that, The data input in the step S1 is a decimal numerical value, which is converted into a balanced ternary to obtain a corresponding numerical list, wherein each numerical value is selected from a numerical set {-1, 0, +1}.

3. The ternary structured encoding method based on balanced ternary numerical values according to claim 1, characterized in that, The generation of the three-dimensional coding unit in the step S2 comprises: unit division is performed on the balanced ternary numerical sequence from left to right, each unit comprising three numerical units in the form of (a1, a2, a3), and the unit dimensions a1, a2, a3 ∈ {-1, 0, +1}; according to the right-end appending rule, for a unit with less than three numerical values at the right end, the unit is filled with a null value ∅.

4. The ternary structured encoding method based on balanced ternary numerical values according to claim 3, characterized in that, The step S2 further comprises: symbolic expression is performed on the three-dimensional coding unit, and the numerical values {-1, 0, +1} are mapped to {-, o, +}.

5. The ternary structured encoding method based on balanced ternary numerical values according to claim 3, characterized by, The step S2 further comprises verification of repeated three-dimensional coding units, and when a repeated three-dimensional coding unit occurs in the generation process, the following processing modes are adopted: path constraint expansion rule: when a continuous same unit is detected, a dimension increasing operation is forcibly triggered; timestamp confusion mechanism: a dynamic disturbance factor is set, a timestamp hash value is embedded into the coding generation process, and it is ensured that the same input data generates different units; compensation unit randomization: non-deterministic compensation, when a repeated unit is detected, a compensation unit type is randomly selected; context-dependent coding: the previous coding unit is taken as a state input, the generation rule of the current unit is dynamically adjusted, and the current unit is generated through an irreversible function.

6. The ternary structured encoding method based on balanced ternary numerical values according to claim 5, characterized by, The conservation verification in the step S3 specifically comprises: sum calculation is performed on each dimension of all three-dimensional coding units in the coding sequence; if the dimension sum is not 0, a compensation unit is appended at the end of the sequence; the above process is iterated until the dimension sum is 0, and a verification sequence is output.

7. The ternary structured encoding method based on balanced ternary numerical values according to claim 6, characterized by, The compensation unit type comprises an inverse unit and a chaotic sequence, which are selected from the numerical set {-1, 0, +1} and comply with the right-end appending rule.

8. A three-dimensional structured encoding system based on balanced ternary numerical values for implementing the three-dimensional structured encoding method based on balanced ternary numerical values according to any one of claims 1 to 7, characterized in that, It comprises: a coding generation module: converting input decimal data into a balanced ternary numerical sequence and generating a three-dimensional coding unit; a path tracing module: verifying the legality of generation by reverse peeling the rightmost numerical value; a conservation calculation module: real-time calculation of the sum of numerical values in each dimension and triggering of a compensation operation.