Symmetrical coding method based on 4HPU
Through the symmetric coding method based on 4HPU, the problems of the binary complement system in representing positive and negative values and path irreversibility are solved, sparse symmetric coding is achieved, power consumption is reduced and hardware execution efficiency is improved. It is suitable for scenarios such as AI edge computing, graph neural networks and low-power chips.
Patent Information
- Application Number
- CN202510827205.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-10-14
AI Technical Summary
The existing binary complement system has problems such as irreversible paths, high power consumption, and poor compressibility when representing positive and negative values, processing directional paths, and performing addition, subtraction, and inversion operations. In particular, in scenarios such as AI edge computing, graph neural networks, low-power chips, and identity systems, there is an urgent need for a structural expression mechanism with strong symmetry, reversible paths, and optimized energy consumption.
A symmetric coding method based on 4HPU is adopted. By defining the mapping relationship between basic units and natural numbers, four-bit-wide numbers are used to form basic units, hierarchical stacking rules are established, and the symmetry of the coding is achieved through the symmetric mapping function. A path chain sequence is constructed to ensure the sparsity and symmetry of the coding.
It realizes sparse symmetric expression of natural numbers, reduces power consumption, improves hardware execution efficiency, supports path reversibility and structural visual expression, and is suitable for scenarios such as AI edge computing, graph neural networks, and low-power chips.
Smart Images

Figure CN120785348A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a symmetrical encoding method based on 4HPU. Background Art
[0002] Existing two's complement systems commonly suffer from the following technical limitations when representing positive and negative values, processing directional paths, and performing addition, subtraction, and inversion operations: The representation of positive and negative numbers relies on the sign bit and two's complement operations, resulting in asymmetric computation paths; the reverse path in multi-layer structures is difficult to restore or complex to represent in hardware; circuit logic requires the use of symbolic judgments and conditional jumps, reducing hardware execution efficiency; and two's complement is not conducive to graph structure path tracing and structural visualization. In particular, in scenarios such as AI edge computing, graph neural networks (GNNs), low-power chips, and identity systems, a structural representation mechanism with strong symmetry, reversible paths, and optimized energy consumption is urgently needed. Summary of the Invention
[0003] The purpose of the present invention is to provide a symmetric encoding method based on 4HPU. The technical problem to be solved is to solve the problems of path irreversibility, high power consumption and poor compressibility caused by traditional binary dense structure.
[0004] To solve the above problems, the present invention adopts the following technical solution: a symmetric encoding method based on 4HPU, comprising the following steps:
[0005] 1. Input initial data, which is a set of discrete natural numbers;
[0006] 2. Define the mapping relationship between basic units and natural numbers to obtain 4HPU encoding, including: defining the basic unit structure, establishing hierarchical stacking rules, and defining the basic unit structure. The basic unit consists of a four-bit wide number 0 or an arrangement of 0 and 1;
[0007] 3. Symmetrically encode the 4HPU code;
[0008] 4. Generate corresponding natural number data sets based on natural numbers;
[0009] 5. Obtain the corresponding natural number data set based on the input initial data.
[0010] Furthermore, when defining the basic unit structure, four four-bit codes with different states are also provided. Each code includes a state, a code, a state meaning, and a default spatial position. The four codes are 0001, 0010, 0100, and 1000, and the states of the four codes are S1, S2, S3, and S4, respectively. Among them, the code corresponding to S1 is 0001, the state meaning is odd-odd state, and the default spatial position is right; the code corresponding to S2 is 0010, the state meaning is odd-even state, and the default spatial position is upward; the code corresponding to S3 is 0100, the state meaning is even-odd state, and the default spatial position is downward; the code corresponding to S4 is 1000, the state meaning is even-even state, and the default spatial position is left.
[0011] Furthermore, in addition to the four four-bit-wide codes with different states, a special state S0 is provided, which is coded as 0000, has a spatial position of inactive, a state meaning of placeholder state, and a default direction of none.
[0012] Furthermore, the 4HPU code is composed of at least one set of basic units, and the bit width is a multiple of 4.
[0013] Furthermore, establishing a hierarchical stacking rule includes taking one basic unit as a group, arranging the group as a layer from right to left, assigning an initial value of 0001 to the basic unit of the first layer, wherein each natural number enables at least one activation bit marked as 1 for distinction, and the rest are marked as 0;
[0014] The activation rule is that only one bit is activated in each group of basic units, the activated bit is 1, and the rest are 0;
[0015] During the initial stacking, 0001, 0010, 0100, and 1000 are used as the starting basic units. When the 4HPU code corresponding to the natural number is at least two layers, the code assigned to the basic unit for each additional layer is 0000. Each natural number uses at least one activation bit for distinction, and the rest are marked as 0.
[0016] Starting with the initial 4-digit number 0001, corresponding to the natural number 1, carry forward and / or add a group of basic units 0000 from right to left, corresponding to a natural number. When the activation bit of a group of basic units is already at the leftmost of the group of basic units, a group of basic units is added and assigned the initial 4-digit number 0000, while the remaining basic units restore their initial values.
[0017] Furthermore, the symmetric encoding of the 4HPU code is obtained by the following symmetric mapping function:
[0018] P(x)=1111-x
[0019] Where: is the 4-bit code of the basic unit, and P(x) is its corresponding symmetric code.
[0020] Furthermore, the natural number data set includes 4HPU codes and symmetric codes corresponding to the natural numbers, and coding node information corresponding to the 4HPU codes and the symmetric codes.
[0021] Furthermore, the coding node information includes P / S / D / L / I, where the identification bit P is the positive and negative signs of the natural number, with values of: 0 for positive and 1 for negative; the state is S, which is the state identifier corresponding to the last group of basic units encoded by 4HPU, such as S1, S2, S3, S4 or S0; D is the spatial direction corresponding to the last group of basic units encoded by 4HPU; L is the number of layers of 4HPU encoding; and the natural number I is the natural number corresponding to the 4HPU encoding.
[0022] Furthermore, step five also includes constructing a 4HPU encoding data set and further establishing a path chain sequence.
[0023] Furthermore, the path chain sequence consists of two parts, including:
[0024] Forward path chain: starting from the basic state S1, it jumps to S2, S3, and S4 in sequence to form a forward closed-loop chain;
[0025] Reverse path chain: With T1 as the entry, it jumps to T2, T3, and T4 in sequence, forming a mirrored reverse closed-loop path;
[0026] Each path node carries standard structure field information (P / S / D / L / I), where: P: positive and negative number identification bit; S : Status field; D: Status direction identifier; L: Coding level, indicating the stacking level of the current coding; I: Natural number, positive numbers are I = 1, 2, 3..., negative numbers are I = -1, -2, -3...;.
[0027] Compared with the existing technology, the present invention encodes natural numbers, uses multiples of 4 to express them, and uses 0 and 1 to represent them, thereby solving the problems of path irreversibility, high power consumption and poor compressibility caused by the traditional binary dense structure. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 This is a diagram of the symmetrical structure of positive and negative numbers in the 4HPU encoding of the present invention.
[0029] Figure 2 Schematic diagram of the four states of 4HPU encoding of the present invention.
[0030] Figure 3 This is a schematic diagram of the inverted mirror structure of the present invention.
[0031] Figure 4 This is the spatial position diagram corresponding to S2 of the present invention.
[0032] Figure 5 This is the natural number + 0 coding structure diagram in the present invention.
[0033] Figure 6 This is the natural number -0 encoding structure diagram in the present invention.
[0034] Figure 7 Schematic diagram of the coding stack expansion of the present invention in a two-dimensional plane.
[0035] Figure 8 This is a structural diagram of the forward and reverse sequences in the pathway chain sequence of the present invention.
[0036] Figure 9 This is a comparison diagram of the sparse structure and dense structure of the present invention.
[0037] Figure 10 It is a path closed loop structure diagram. DETAILED DESCRIPTION
[0038] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0039] The present invention discloses a symmetric encoding method based on 4HPU (4-State Holographic Processing Unit), comprising the following steps:
[0040] 1. As Figure 1 As shown, input the initial data, the initial data is a set of discrete natural numbers N∪{-N}
[0041] ∪{0}, such as {1,2,3,…,N}.
[0042] 2. Define the mapping relationship between basic units and natural numbers.
[0043] like Figure 2 As shown in the figure, the basic unit structure in the 4HPU quaternary logic structure is given. Each basic unit is based on the quadrant division of the two-dimensional plane structure and consists of four quadrants in the form of a grid. Among the four quadrants, only one is defined as an active bit with a value of 1, that is, the black dot in the figure. The other grids are empty and have a value of 0, thus forming four four-bit wide codes for easy computer recognition. The four four-bit wide codes have the following basic states:
[0044] Each code includes state, code, state meaning and default spatial position. The states of the four codes are S1, S2, S3 and S4. Among them, the code corresponding to S1 is 0001, the state meaning is odd-odd state, and the default spatial position is right; the code corresponding to S2 is 0010, the state meaning is odd-even state, and the default spatial position is upward; the code corresponding to S3 is 0100, the state meaning is even-odd state, and the default spatial position is downward; the code corresponding to S4 is 1000, the state meaning is even-even state, and the default spatial position is left. For details, please refer to Table 1. Figures 2 to 4 shown.
[0045] Table 1
[0046] state Code (4 digits) Status meaning Default spatial position S1 0001 Qiqi Status Right → S2 0010 Parity state Up↑ S3 0100 Even-odd state Down↓ S4 1000 Even-even state Left ←
[0047] In Table 1, odd-odd = odd rows + odd columns, even-odd = odd rows + even columns, even-odd = even rows + odd columns, and even-even = even rows + even columns.
[0048] When constructing a one-to-one mapping relationship between natural numbers and structure codes, the present invention adopts a 4HPU coding format with 4 bits as the basic unit, and the overall coding bit width is always a multiple of 4, such as 4 bits, 8 bits, 12 bits or higher bit width.
[0049] In terms of coding structure, 4HPU coding is stacked and combined in a "from right to left, layer by layer" manner, with every four bits forming a basic unit (i.e., a layer (group)), and each group of basic units consists of the numbers "0" and "1".
[0050] The overall code is composed of at least one group of basic units. As the value of natural numbers increases, the number of basic unit groups (level L) will gradually increase to support a larger range of coding expressions.
[0051] In each group of basic units, only one high-level bit (i.e., a "1" active bit) is allowed, and the remaining three bits are "0." If all bits in a group of basic units are 0 (i.e., encoded as 0000), the layer is defined as inactive, denoted as state S0, and is used for placeholders or path buffering.
[0052] For example, the 4HPU code corresponding to the natural number 5 is 0001 0000, which can be disassembled into two groups of basic units, where the high-order group on the left is 0001 (indicating the main group activation state S1) and the low-order group on the right is 0000 (indicating that the current sub-state is not activated, occupying layer S0).
[0053] Therefore, although a natural number code as a whole may contain multiple activation bits, each group of basic units always has no more than one activation bit, thereby maintaining sparsity, logical independence and path reversibility in the multi-layer structure.
[0054] When the 4HPU code corresponding to a natural number contains only one set of basic units (i.e. 4-bit code), the basic unit represents both the main group position of the current natural number and directly represents the basic state (such as S1, S2, etc.) it is in, constituting the smallest unit of the basic structure.
[0055] Establish a hierarchical stacking (arrangement) rule:
[0056] A set of basic units is arranged from right to left as a layer, and the first layer (the first set) of basic units is assigned an initial value of 0001. At least one active bit (marked as 1) is enabled for each natural number to distinguish it, and the rest are marked as 0.
[0057] In the 4HPU code structure of the present application, each set of basic units (every 4 bits) corresponds to a layer in the code structure. The overall structure is stacked from right to left, and the rightmost set of basic units is defined as the basic state layer (also known as the sub-state layer, denoted as L = 1), which is used to represent the state number of the natural number in the current main group, i.e. S1, S2, S3, S4 or S0.
[0058] When the natural number code contains two or more sets of basic units, the leftmost set of basic units is defined as the main number layer (also known as the high-order group), which is used to identify the main group number interval to which the natural number belongs. For example:
[0059] Natural numbers 1-4 only require 1 set of basic units, and their codes are 0001, 0010, 0100, and 1000;
[0060] The code of natural number 5 is 0001 0000, indicating that it consists of two sets of basic units, with the left high-order group 0001 corresponding to the main group state S1 and the right low-order group 0000 indicating that the current sub-state is not activated (S0);
[0061] The code of natural number 10 is 0010 0000, also consisting of two sets of basic units, with the left set activated state being S2 and the right set being S0;
[0062] It can be seen that the judgment of the main group state is based on the position of the active bit in the high-order group, rather than the "nth bit" in the overall code bit string.
[0063] Therefore, the statement "the 5th bit represents the 2nd group" is not accurate, and the logical position should be determined in units of basic unit sets (every 4 bits).
[0064] For any natural number, the rightmost set of basic units (L = 1 layer):
[0065] If the active bit of this set is not all 0, the corresponding state is S1-S4, indicating the sub-state position of the current natural number in the main group;
[0066] If the group is 0000, it is defined as the S0 state, indicating that the current layer is in a placeholder state and is not activated; the S0 state has a special meaning: it can be used as a structure representation of a natural number + 0 (starting point anchor), or as a placeholder structure for the middle layer or the lowest layer, for needs such as path jumping, blank space, or compression modeling.
[0067] During the initial stacking, 0001, 0010, 0100, and 1000 are used as the starting basic units. When the 4HPU code corresponding to the natural number is at least two layers (groups), the code assigned to the basic unit is 0000 for each additional layer (group). Each natural number uses at least one activation bit for distinction, and the rest are marked as 0.
[0068] The mapping rule starts with the initial 4-digit number 0001, corresponding to the natural number 1, and proceeds from right to left and / or adds a group of basic units 0000 to correspond to a natural number. When the activation bit of a group of basic units is already at the leftmost of the group of basic units, a group of basic units is added and assigned the initial 4-digit number 0000, while the remaining basic units restore their initial values.
[0069] The specific relationship is as follows:
[0070] 4-bit code (L=1, L represents the number of layers), the expression range is natural numbers 1 to 4.
[0071] 8-bit code (L=2, L represents the number of layers), the expression range is natural numbers 5 to 20; and so on.
[0072] When the activation bit of the first group of basic units is carried to the first position (the first digit), a group of basic units is stacked and expanded (increased) behind it and assigned an initial value of 0000, while the remaining basic units are reset to the initial values.
[0073] That is, when the activation bit in the first group of basic units is carried to the first position, a basic unit is added (one layer / one group), and each added layer of basic units is given an initial value of 0000, and the first group is reset to 0001, and the remaining basic units are reset to 0000, and so on. The stacking order is from right to left, layer by layer, and the carry is started from the last group of basic units. When the activation bits of the last group of basic units are used in turn, the carry is carried to the previous group of basic units, thereby obtaining the 4HPU code corresponding to each natural number. Specifically, the mapping relationship between the 4HPU code and the natural number is as follows, for example (such as Figure 7 As shown in the figure, it shows how the encoding of natural numbers from 1 to 10 in a two-dimensional plane is stacked from a set of basic units to higher levels):
[0074] 4-bit code (bit width = 4 bits)
[0075] The natural number 1 corresponds to the code 0001 (the first activated bit, the corresponding state is S1).
[0076] The natural number 2 corresponds to the code 0010 (the second activation bit, the corresponding state is S2).
[0077] The natural number 3 corresponds to the code 0100 (the activation bit is the 3rd bit, and its corresponding state is S3).
[0078] The natural number 4 corresponds to the code 1000 (the activation bit is the 4th, and the corresponding state is S4).
[0079] When the activation bits of the first group of basic units are used in sequence and need to be carried, a group of basic units is added behind it as an extension unit. At this time, the first group of basic units is reset to 0001, the second group of basic units is initialized to 0000, and the carry begins.
[0080] 8-bit encoding (bit width = 8 bits)
[0081] The natural number 5 corresponds to the code 0001 0000 (the activation bit is the 5th, indicating the 2nd group, and its corresponding state is S0).
[0082] The natural number 6 corresponds to the code 0001 0001 (activating bits 5 and 1, indicating the second group, and the corresponding state is S1).
[0083] The natural number 7 corresponds to the code 0001 0010 (activation bits 5 and 2, indicating group 2, and the corresponding state is S2).
[0084] The natural number 8 corresponds to the code 0001 0100 (activating bits 5 and 3, indicating group 2, and the corresponding state is S3).
[0085] The natural number 9 corresponds to the code 0001 1000 (the 5th and 4th bits are activated, indicating the 2nd group, and the corresponding state is S4).
[0086] The natural number 10 corresponds to the code 0010 0000 (the activation bit is the 6th bit, indicating the 2nd group, and its corresponding state is S0).
[0087] The natural number 11 corresponds to the code 0010 0001 (the activation bits are the 6th and 1st, indicating the 2nd group, and the corresponding state is S1).
[0088] The natural number 12 corresponds to the code 0010 0010 (the 6th and 2nd bits are activated, indicating the 2nd group, and the corresponding state is S2).
[0089] The natural number 13 corresponds to the code 0010 0100 (the 6th and 3rd bits are activated, indicating the 2nd group, and the corresponding state is S3).
[0090] The natural number 14 corresponds to the code 0010 1000 (the 6th and 4th bits are activated, indicating the 2nd group, and the corresponding state is S4).
[0091] The natural number 15 corresponds to the code 0100 0000 (the activation bit is the 7th, indicating the 2nd group, and its corresponding state is S0).
[0092] The natural number 16 corresponds to the code 0100 0001 (the 7th and 1st bits are activated, indicating the second group, and the corresponding state is S1).
[0093] The natural number 17 corresponds to the code 0100 0010 (activating bits 7 and 2, indicating group 2, and the corresponding state is S2)
[0094] The natural number 18 corresponds to the code 0100 0100 (the 7th and 3rd bits are activated, indicating the second group, and the corresponding state is S3).
[0095] The natural number 19 corresponds to the code 0100 1000 (the 7th and 4th bits are activated, indicating the 2nd group, and the corresponding state is S4).
[0096] The natural number 20 corresponds to the code 1000 0000 (the activation bit is the 8th, indicating the 2nd group, and its corresponding state is S0).
[0097] The natural number 21 corresponds to the code 1000 0001 (bits 8 and 1 are activated, indicating the second group, and the corresponding state is S1).
[0098] The natural number 22 corresponds to the code 1000 0010 (bits 8 and 2 are activated, indicating group 2, and the corresponding state is S2).
[0099] The natural number 23 corresponds to the code 1000 0100 (bits 8 and 3 are activated, indicating the second group, and the corresponding state is S3).
[0100] The natural number 24 corresponds to the code 1000 1000 (bits 8 and 4 are activated, indicating group 2, and the corresponding state is S4).
[0101] When all four bits in the two groups of basic units are used for one round, another group of basic units is added during the carry. At this time, the first group of basic units is reset to 0001, the second group of basic units is reset to 0000, and the third group is given an initial value of 0000.
[0102] 12-bit encoding (bit width = 12 bits)
[0103] The natural number 25 corresponds to the code 0001 0000 0000 (the activation bit is the 9th, indicating the 3rd group, and its corresponding state is S0).
[0104] The natural number 50 corresponds to the code 0010 0000 0000 (the activation bit is the 10th, indicating the 3rd group, and its corresponding state is S0).
[0105] The natural number 75 corresponds to the code 0100 0000 0000 (the activation bit is the 11th, indicating the 3rd group, and its corresponding state is S0).
[0106] The natural number 100 corresponds to the code 1000 0000 0000 (the activation bit is the 12th, indicating the 3rd group, and its corresponding state is S0).
[0107] And so on, continue stacking (arranging).
[0108] The relationship between the encoding (arrangement) level and the natural number scale satisfies:
[0109] C_L = 4 × 5^{L-1} layer capacity (e.g. L = 2 corresponds to C_2 = 20 natural numbers)
[0110] Where L is the number of stack expansions.
[0111] The above encoding method makes it unique. The position encoding of the activation bit in each 4HPU code not only expresses the numerical meaning of the natural number, but also can express the state or movement direction.
[0112] Activating bits on sparsity keeps the code extremely sparse, occupying only a very small number of high-level bits; this helps reduce power consumption and improve channel resolution and anti-interference capabilities.
[0113] In the above natural number stacking mapping rules, the high bits reflect the main layer stacking; the low bits supplement the subdivision status.
[0114] The activation of each bit strictly follows the recursive expansion of 4 bits to maintain the sparse and directional logic of the code.
[0115] This lays the foundation for subsequent positive and negative symmetric mapping, path reverse deduction, and GNN structure input.
[0116] The basic unit has the basic characteristics of maintaining quaternion sparse activation, supporting the synchronization of linear expansion of natural number scale and structural expansion of coding hierarchy; it is convenient for low-power hardware implementation and efficient path backtracking modeling; and it maintains the strict symmetry of the positive and negative number stacking process.
[0117] The present invention also assigns special codes to special values in natural numbers. Figure 5 As shown, the 4HPU corresponding to +0 is encoded as bit 0000, which represents all inactive bits, the starting point of the structure, the direction is outward, and the symbol is ⊙; Figure 6 As shown, the 4HPU code corresponding to -0 is 1111, which represents the fully activated bit, the end point of the structure, the direction is inward, and the symbol is
[0118] 3. Perform symmetrical encoding on the 4HPU code.
[0119] To achieve path symmetry in the coding structure, the present invention defines a one-to-one mapping relationship between the forward state (S series) and the reverse state (T series). This mapping is implemented using the bit-level inversion function P(x). For any 4-bit basic unit, the mapping is defined as follows:
[0120] Symmetric mapping function definition:
[0121] For any set of 4-bit basic encoding states, its inverse state encoding is given by the following inversion mapping function:
[0122] P(x)=1111-x, where
[0123] x is the 4-bit code of the basic unit (such as 0001, 0010, etc.), and P(x) is its corresponding symmetric code;
[0124] For example: P(0001)=1110, P(0010)=1101, P(0100)=1011, P(1000)=0111;
[0125] Special case: P(0000)=1111, P(1111)=0000, corresponding to the mapping between the starting point (S0) and the end point (T0) of the structure path;
[0126] This function supports group-by-group inversion of multiple stacked structures and is applicable to 4HPU extended codes of any bit width, such as 4 bits, 8 bits, and 12 bits, while maintaining consistent path symmetry.
[0127] That is, the four coding activation bits in the basic unit of the 4HPU code are changed from 1 to 0, and the rest are changed from 0 to 1.
[0128] Table 2: List of forward and reverse mapping states
[0129] Forward state Coding (S series) Corresponding reverse state Coding (T series) Path structure meaning (standard terminology) S1 0001 T1 1110 Path start status S2 0010 T2 1101 Path up status S3 0100 T3 1011 Path down status S4 1000 T4 0111 Path end status S0 0000 T0 1111 Special placeholders / path anchors (start / end)
[0130] Table 2 Reference Figure 3
[0131] 4. Generate corresponding natural number data sets based on natural numbers.
[0132] The natural number data set includes the 4HPU code and symmetric code corresponding to the natural number, and the coding node information corresponding to the 4HPU code and the symmetric code.
[0133] The coding node information includes P / S / D / L / I, where the identification bit P is the positive and negative sign of the natural number, with the value: positive is 0 and negative is 1; the state is S, which is the state identifier corresponding to the last group of basic units encoded by 4HPU, such as S1, S2, S3, S4 or S0; D is the spatial direction corresponding to the last group of basic units encoded by 4HPU; L is the number of layers of 4HPU encoding, such as L1, L2...; the natural number I is the natural number corresponding to the 4HPU encoding, which is used for fast indexing and data positioning.
[0134] The specific encoding structure information is as follows Table 3:
[0135] Table 3
[0136] Field content Example P Positive and negative signs 0 (positive) / 1 (negative) S Status bits (S1, S2, S3, S4 or inverted to T1, T2, T3, T4) S2 / T2 D Direction field ↑ / ↓ L Level (Group) Field 1 / 2 / 3… I Natural number number 6
[0137] For example, the encoding node information of each 4HPU encoding is represented by the following code:
[0138] \text{(S1,→,L=1,I=1)}\rightarrow\text{(S2,↑,L=1,I=2)}\rightarrow\cdots]
[0139] The corresponding symmetric encoded encoding node information is represented by the following code:
[0140] \cdots\leftarrow\text{(T2,↓,L=1,I=-2)}\leftarrow\text{(T1,←,L=1,I=-1)}
[0141] The field structures of the two are the same, and the direction D becomes the reverse.
[0142] After obtaining the corresponding coding node information, a natural number data set is established by combining 4HPU coding, symmetric coding, and the coding node information of both.
[0143] 5. Based on the input initial data, the corresponding natural number data set is obtained, and its corresponding 4HPU encoding data set can be constructed, and the path chain sequence can be further established, such as Figure 8 As shown. The path chain sequence consists of two parts:
[0144] Forward path chain (+N, natural positive number): starting from the basic state S1, jumps to S2, S3, S4 in sequence to form a forward closed loop chain; the forward path chain is composed of multiple path nodes
[0145] Reverse path chain (-N, a negative natural number): takes T1 as the entry point and jumps to T2, T3, and T4 in sequence, forming a reverse closed-loop path that is a mirror image of the forward path chain;
[0146] Each path node carries standard structure field information (P / S / D / L / I), where:
[0147] P: positive and negative number identification bit (P=0 is positive, P=1 is reverse);
[0148] S : Status field (such as S1, S2, S3, S4, or corresponding mirror status T1, T2, T3, T4);
[0149] D: The state has its own direction indicator (such as S1 is "right", T1 is "left");
[0150] L: Coding level, indicating the number of stacking layers the current code is in (e.g. L=1 means 4 bits);
[0151] I: natural number, positive numbers are I = 1, 2, 3..., negative numbers are I = -1, -2, -3...;
[0152] For example, some of the encoded nodes in the forward path chain are shown below:
[0153] scss
[0154] (S1, right, L=1, I=1)
[0155] Jump to (S2, up, L=1, I=2)
[0156] Jump to (S3, left, L=1, I=3)
[0157] Jump to (S4, down, L=1, I=4)
[0158] Its mirror image reverse path chain is expressed as:
[0159] scss
[0160] (T1, left, L=1, I=-1)
[0161] Jump to (T2, down, L = 1, I = -2)
[0162] Jump to (T3, right, L=1, I=-3)
[0163] Jump to (T4, up, L=1, I=-4)
[0164] This structure embodies the path symmetry and reversibility of the present invention.
[0165] Figure 8The figure shows the structural closed-loop diagram of the forward and reverse path chains, with S1 (forward path) and T1 (reverse path) as the entry nodes, forming a logical path tensor closed-loop structure, which can be used for various applications such as AI model structure input, state prediction, path tracking, and graph neural network (GNN) embedding modeling.
[0166] The 4HPU structure encoding method proposed in this paper not only achieves sparse symmetric expression of positive and negative natural number encoding, but also supports the construction of important structural chains with path reversibility, direction perception, and state nesting. This structure has significant engineering value in the following typical application scenarios:
[0167] 1) Node path nesting modeling in GNN (structural graph input)
[0168] The structural nodes (S series, T series) encoded with natural numbers are regarded as vertices in the graph network. The nodes carry the following fields: state (S), direction (D), level (L), and index (I). The adjacency matrix between nodes is constructed according to the path chain, and each hop represents a state jump. The direction field D is used to define directed edges. The structural sparsity supports graph compression. The mirror nodes (T series) support backpropagation and GNN symmetric learning.
[0169] Application advantages:
[0170] Explicit path structure tensor input (no additional positional encoding required); supports symmetric graph embedding, reversible learning, and structural attention mechanism; extremely suitable for graph classification, node prediction, path scoring tasks, etc.
[0171] 2) AI behavior state chain modeling (state space → action space)
[0172] S1-S4 are considered the four basic states of the AI behavior process. A coding chain such as S1 jumps to S2 jumps to S3 jumps to S4 represents the action sequence of a task. The corresponding T1 jumps to T2 jumps to T3 jumps to T4 represents a failed reconstruction path or an inversion correction path. The fields L and I of each state node represent its level and execution stage.
[0173] Typical applications:
[0174] AI robot task sequence coding;
[0175] Multi-state behavior prediction and control switching;
[0176] Reuse of multi-path training data structures (reinforcement learning or task scheduling).
[0177] 3) Timing control chain logic modeling (low power consumption, instruction chain)
[0178] Each encoding node represents a control state unit;
[0179] Sparse structure and clear direction: avoid state overlap in traditional control chains;
[0180] The forward path chain is used for process execution; the reverse path chain is used for fault backtracking;
[0181] S0 and T0 serve as the starting / ending states, forming a "path closed-loop control". Figure 10 As shown;
[0182] Application scenarios:
[0183] Embedded chip low-power instruction chain;
[0184] Time-controlled sequence with recoverable state;
[0185] Temporal tensor compression at the node granularity level.
[0186] 4HPU structural coding is not only an innovation in numerical expression, but also a structural tensor expression model with directionality, hierarchy, and reversibility. It is naturally adapted to the structured requirements of modern AI systems for path, state, direction, and hierarchical information, and has significant engineering expansion potential.
[0187] In the symmetric encoding method of the 4HPU of the present invention, the encoding structure has a sparsity characteristic that is significantly different from traditional binary encoding. This is specifically manifested in the following aspects:
[0188] 1. The dense nature of traditional binary coding
[0189] In the traditional binary coding system, the encoding of natural numbers is formed by accumulating bit weights, for example:
[0190] 1=0001, 2=0010, 3=0011, 4=0100, 5=0101, 6=0110, 7=0111, 8=1000. It can be seen that with each increase of a natural number, a new bit will be activated or more bits will be superimposed; the number of "1" bits in the code gradually increases; all combinations within 1000 basically densely traverse all possible bit combinations. This structure is called a dense structure, which is characterized by: almost all coding combinations will be used, and activated bits continue to accumulate.
[0191] 2.4 Sparse characteristics of HPU coding ( Figure 9 shown)
[0192] Different from traditional binary, this invention adopts 4HPU quaternary logic coding system, which has the following sparsity characteristics:
[0193] In each basic coding group (4 bits), only one bit is activated (single high-level bit); natural numbers 1-4 only activate single bits, respectively, without superposition or mixing; after 5, although stacked to 8 bits, 12 bits, 16 bits, each layer of coding still maintains sparse activation, and the activation bit is also set in the expansion unit as a distinction; the overall coding space maintains a large number of idle bits that are not occupied, i.e., there is a significant sparse space. This coding method allows a large number of uniformly distributed but unactivated coding bits to exist even in large-scale natural number range expansion (such as within 100, 500, 1000).
[0194] 3. Continuous and uniform sparse distribution characteristics, 4HPU coding is not only sparse, but also continuous and uniform: activated bits are grouped in four-bit groups, four groups are stacked, forming a smooth hierarchical transition; in each layer of stacking, the activated bits are uniformly distributed, and the space utilization is rhythmic, not random and scattered; such sparse continuity ensures the regularity and compressibility of data in physical transmission, low-power hardware, and path modeling.
[0195] 4. Advantages of sparse structure, compared with dense binary structure, the 4HPU sparse structure of the present application has the following advantages: low power consumption: a small number of bit flips, low frequency of charge switching; high anti-interference: high-level activation is less, signal recognition is stable; structural compressibility: path chain, tensor input can be efficiently coded based on sparse characteristics; excellent path reversibility: because of single activation, the backtracking path is naturally simple and clear.
Claims
1. A symmetric encoding method based on 4HPU, characterized in that: The steps include:
1. Input initial data, which is a set of discrete natural numbers; 2. Define the mapping relationship between basic units and natural numbers to obtain 4HPU encoding, including: defining the basic unit structure, establishing hierarchical stacking rules, and defining the basic unit structure. The basic unit consists of a four-bit wide number 0 or an arrangement of 0 and 1; 3. Symmetrically encode the 4HPU code; 4. Generate corresponding natural number data sets based on natural numbers; 5. Obtain the corresponding natural number data set based on the input initial data.
2. The symmetrical encoding method based on 4HPU according to claim 1, characterized in that: When defining the basic unit structure, four four-bit codes with different states are also set. Each code includes state, code, state meaning, and default spatial position. The four codes are 0001, 0010, 0100, and 1000, and the states of the four codes are S1, S2, S3, and S4. Among them, the code corresponding to S1 is 0001, the state meaning is odd-odd state, and the default spatial position is right; the code corresponding to S2 is 0010, the state meaning is odd-even state, and the default spatial position is upward; the code corresponding to S3 is 0100, the state meaning is even-odd state, and the default spatial position is downward; the code corresponding to S4 is 1000, the state meaning is even-even state, and the default spatial position is left.
3. The symmetrical encoding method based on 4HPU according to claim 2, characterized in that: In addition to the four four-bit wide codes with different states, there is also a special state S0, which is coded as 0000, the spatial position is not activated, the state meaning is the occupied state, and the default direction is none.
4. The symmetrical encoding method based on 4HPU according to claim 1, characterized in that: 4HPU encoding consists of at least one set of basic units, and the bit width is a multiple of 4.
5. The symmetrical encoding method based on 4HPU according to claim 2, characterized in that: Establishing a hierarchical stacking rule includes taking one basic unit as a group, arranging the group as a layer from right to left, assigning an initial value of 0001 to the basic unit of the first layer, wherein each natural number enables at least one activation bit marked as 1 for distinction, and the rest are marked as 0; The activation rule is that only one bit is activated in each group of basic units, the activated bit is 1, and the rest are 0; During the initial stacking, 0001, 0010, 0100, and 1000 are used as the starting basic units. When the 4HPU code corresponding to the natural number is at least two layers, the code assigned to the basic unit for each additional layer is 0000. Each natural number uses at least one activation bit for distinction, and the rest are marked as 0. Starting with the initial 4-digit number 0001, corresponding to the natural number 1, carry forward and / or add a group of basic units 0000 from right to left, corresponding to a natural number. When the activation bit of a group of basic units is already at the leftmost of the group of basic units, a group of basic units is added and assigned the initial 4-digit number 0000, while the remaining basic units restore their initial values.
6. The symmetric encoding method based on 4HPU according to claim 5, characterized in that: Symmetric encoding of 4HPU code is obtained by the following symmetric mapping function: P(x)=1111-x Where: is the 4-bit code of the basic unit, and P(x) is its corresponding symmetric code.
7. The symmetric encoding method based on 4HPU according to claim 1, characterized in that: The natural number data set includes the 4HPU code and symmetric code corresponding to the natural number, and the coding node information corresponding to the 4HPU code and the symmetric code.
8. The symmetric encoding method based on 4HPU according to claim 7, characterized in that: The coding node information includes P / S / D / L / I, where the identification bit P is the positive and negative signs of the natural number, with values of 0 for positive and 1 for negative; the state is S, which is the state identifier corresponding to the last group of basic units encoded in 4HPU, such as S1, S2, S3, S4 or S0; D is the spatial direction corresponding to the last group of basic units encoded in 4HPU; L is the number of layers of 4HPU encoding; and the natural number I is the natural number corresponding to the 4HPU encoding.
9. The symmetrical encoding method based on 4HPU according to claim 1, characterized in that: The step five also includes constructing a 4HPU encoding data set and further establishing a path chain sequence.
10. The symmetric encoding method based on 4HPU according to claim 9, characterized in that: The path chain sequence consists of two parts, including: Forward path chain: starting from the basic state S1, it jumps to S2, S3, and S4 in sequence to form a forward closed-loop chain; Reverse path chain: With T1 as the entry, it jumps to T2, T3, and T4 in sequence, forming a mirrored reverse closed-loop path; Each path node carries standard structure field information (P / S / D / L / I), where: P: positive and negative number identification bit; S : Status field; D: Status direction identifier; L: Coding level, indicating the stacking level of the current coding; I: Natural number, positive numbers are I = 1, 2, 3..., and negative numbers are I = -1, -2, -3...