A three-dimensional force data management method and system
By employing 32-bit compact three-dimensional force vector encoding and zero-copy batch packaging technology, combined with multi-node adaptive anti-collision startup, the problems of high bandwidth consumption and frequent bus contention in three-dimensional force data transmission are solved, thereby achieving data compression and improved system stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- YUANSHENGXIANDA TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2026-02-13
- Publication Date
- 2026-06-02
Smart Images

Figure CN122132341A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of tactile sensor data processing and communication technology, and particularly relates to a management method and system for three-dimensional force data encoding, packet transmission and anti-collision start-up of multi-node tactile sensor systems. Background Technology
[0002] Tactile sensor arrays are widely used in scenarios such as robotic dexterity hands, pressure distribution detection, and human-computer interaction. In order to use tactile information in real time within the control closed loop, sensor nodes need to output three-dimensional force information at a high frequency and transmit it to the host computer via a bus. Existing technologies typically use three 16-bit integers to represent the force components of the X, Y, and Z axes, resulting in a single-point three-dimensional force data occupying 48 bits. When multi-point arrays are superimposed, the communication data volume is large, the number of frames is high, and the latency is high.
[0003] Furthermore, in multi-node parallel networking, multiple devices powering on or simultaneously entering the transmission cycle can lead to bus contention, causing transmission congestion, frame loss, or even bus anomalies. If the receiver uses two's complement or floating-point methods for parsing, it will also increase parsing latency and implementation complexity. Therefore, there is an urgent need for a three-dimensional force data management scheme that maintains direction information and real-time performance while also considering compression, alignment, fast parsing, and multi-node stability.
[0004] In summary, the existing technology has the following defects: (1) Three-dimensional force data is traditionally transmitted using three 16-bit integers, which consumes a lot of bandwidth and buffer, resulting in a large number of frames and high latency; (2) When multiple nodes are powered on at the same time or enter the transmission cycle at the same time, bus contention, transmission congestion and frame loss are likely to occur; (3) If the host computer parsing relies on operations such as two's complement / floating point, the parsing delay is large and the implementation is complicated. Summary of the Invention
[0005] In order to overcome at least one technical defect in the prior art, the present invention provides a three-dimensional force data management method.
[0006] The present invention also provides a system based on the above-mentioned data management method.
[0007] The present invention also provides a computer-readable medium based on the above-described data management method.
[0008] This invention provides a three-dimensional force data management method, comprising the following steps: S100, obtain or calculate the X, Y, and Z components of a three-dimensional force vector; S200 quantizes the amplitudes of the X, Y, and Z axes separately; S300, extract the X-axis sign bit and Y-axis sign bit; separate and encode the X-axis sign bit and Y-axis sign bit from the X amplitude, Y amplitude, and Z amplitude; S400 writes multiple encoded data bits-aligned into a communication frame and sends it.
[0009] Furthermore, in step S200, the amplitude quantization range for the X, Y, and Z axes is 0-1023.
[0010] Furthermore, the separation encoding involves encoding the sign bit and amplitude of the X-axis and Y-axis separately, where the first sign bit indicates the positive or negative sign of the X-axis, the second sign bit indicates the positive or negative sign of the Y-axis, and the amplitude of the Z-axis is non-negative.
[0011] Furthermore, in step S300, the amplitude of the three axes and the sign bits of the X and Y axes are encoded into 32-bit data, with the bit width allocated as follows: 10 bits for X amplitude, 10 bits for Y amplitude, 10 bits for Z amplitude, and 2 bits for sign bit.
[0012] Furthermore, step S300 uses bit field structure writing or bit mask and shift writing, and the decoding step uses bit mask and shift reading to avoid two's complement operation.
[0013] Furthermore, step S400 includes: using the continuously stored three-dimensional force vector array as a source buffer, and using a memory copy instruction to directly move the array to at least one fixed-length data frame buffer to achieve zero-copy batch packaging.
[0014] Furthermore, the fixed-length data frame is a 64-byte data frame, and in the 64 three-dimensional force vector scenarios formed by the 16x16 matrix, four 64-byte data frames are packaged together.
[0015] Furthermore, the identification field of the communication frame includes a device identifier and a packet sequence number to support parallel communication of multiple devices on the same bus and packet reassembly at the receiving end.
[0016] Furthermore, the method also includes: S500, multi-node adaptive anti-collision startup steps: After the device is powered on, it reads the chip's unique identifier, generates a random seed in combination with the hardware counter, generates a random startup delay and waits, and then initializes the communication peripherals and starts sending.
[0017] Furthermore, the random start delay is formed by superimposing at least two levels of random delay, and the superimposed delay is limited so that it falls within a preset minimum and maximum delay range.
[0018] The present invention also provides a data management system, comprising: a data acquisition module, an encoding module, a packaging and sending module, and an anti-collision startup module; wherein the encoding module is used to perform the 32-bit compact encoding described in the above technical solution, the packaging and sending module is used to perform the zero-copy batch packaging and sending described in the above technical solution, and the anti-collision startup module is used to perform the random delay staggered startup described in the above technical solution.
[0019] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described data management method.
[0020] Compared with the prior art, the beneficial effects of the present invention using the above solution are as follows: The 3D force data is compressed by about 33% (from 48 bits to 32 bits). In a scenario with 64 3D force vectors in a 16x16 matrix, the number of communication frames is reduced from 6 frames to 4 frames, thus reducing bandwidth usage and buffering. The number of instructions parsed by the host computer is reduced and no complement operation is required. When multiple nodes are powered on at the same time, the initialization and transmission are staggered by random delay, which significantly reduces the probability of bus contention and frame loss and improves system stability. Attached Figure Description
[0021] Figure 1 This is a schematic diagram of the overall process for three-dimensional force data management in this invention; Figure 2 This is a schematic diagram of the 32-bit compact three-dimensional force vector bit layout of the present invention; Figure 3 This is a schematic diagram of the random delay generation process for multi-node adaptive anti-collision startup of the present invention. Detailed Implementation
[0022] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0023] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below. Example
[0024] The main application scenarios of this invention are: multi-point tactile sensor arrays outputting three-dimensional force (X / Y / Z) data on a CAN / CAN-FD bus; single-node or multi-node parallel networking (such as multiple fingers / multiple sensors being powered on and transmitting data simultaneously). The host computer / controller needs to receive and parse the three-dimensional force data from each node in real time.
[0025] The main technical solution of this invention is as follows: A) A 32-bit compact three-dimensional force vector encoding format is adopted to quantize and compress the X / Y / Z amplitudes to 10 bits respectively, with 1 bit for each of the X / Y sign bits, forming a 10+10+10+2 bit aligned encoding; B) Zero-copy batch packing is adopted, and the continuous Force3D array is directly moved to multiple 64-byte CAN-FD data frames by memcpy, avoiding byte-by-byte assembly; C) Combine a multi-node adaptive anti-collision startup system, using the chip's unique ID and hardware counter to generate multi-level random startup delays, staggered initialization and transmission, and reduce bus contention.
[0026] like Figure 1 As shown, the specific steps in this embodiment include: After the S1 device is powered on, it reads the chip's unique ID and counter, generates multiple levels of random delay, and waits. S2 initializes FDCAN and enters the data transmission loop; S3 acquires / calculates the X / Y / Z components of each three-dimensional force vector, extracts the X / Y symbols, and clips the amplitude to 0-1023; S4 packs the X amplitude, Y amplitude, Z amplitude, and sign bit into 32-bit data by bit field / shift; Write a multi-point Force3D data array to several 64-byte data frames using zero copy; The S5 bus sends data frames, which are received by the host computer and then decoded using a mask and shifter to recover the X / Y / Z symbols.
[0027] In the above steps, a 32-bit MCU is used as the processor, and the tactile sensor array outputs a three-dimensional force vector array; a batch of Force3D data is carried by a CAN-FD 64-byte data frame with extended ID; during the power-on initialization phase, the random delay function generate_random_delay() is called, and after the delay is completed, FDCAN and ADC DMA are started; during operation, the data is periodically packaged and sent, and the receiving end decodes and recovers the signed X / Y / Z by bit field.
[0028] like Figure 2 As shown, in this embodiment, each three-dimensional force vector is carried by a 32-bit integer, with the bit field allocation as follows: the X amplitude occupies the lower 10 bits, the Y amplitude occupies the next lower 10 bits, the Z amplitude occupies the next higher 10 bits, and the highest 2 bits are the sign field, where 1 bit represents the X sign and 1 bit represents the Y sign. The X / Y amplitudes are stored in absolute value form, and the sign field is used to recover the four-quadrant direction information. The Z-axis has a non-negative amplitude.
[0029] During encoding, the X / Y / Z components are first acquired (which can be calculated by sensor algorithms), and the amplitude is clipped to 0-1023. Then, the X and Y sign bits are extracted and written into the sign field bit by bit, resulting in a 32-bit compact code. The receiver obtains the X / Y / Z amplitude through masking and shifting, and recovers the positive and negative signs of X and Y based on the sign field.
[0030] To improve packaging efficiency and DMA / caching friendliness, this embodiment stores the Force3D array contiguously with 32-bit alignment and directly moves it to multiple fixed-length data frame buffers using memory copy instructions. For 64 three-dimensional force vectors, the total number of bytes after encoding is 64 × 4 = 256 bytes, which can be split into four 64-byte data frames. This method avoids byte-by-byte assembly and circular writing, reducing CPU overhead. Furthermore, the communication frame identifier field can include a device identifier and a packet sequence number to support addressing and receiver packet reassembly when multiple nodes are connected in parallel.
[0031] like Figure 3 As shown, in a multi-device parallel bus scenario, to avoid bus contention caused by multiple devices immediately transmitting after power-on, this embodiment performs a random delay before the communication peripherals are initialized: The chip's unique identifier (UID) is read and a random seed is generated using a hardware counter; multiple levels of random delays are generated based on the random seed and superimposed; then, the delay results are limited to ensure the delay falls within a preset range; the device waits for the delay before initializing the bus peripherals and entering the transmission loop. Through this peak-shaving mechanism, the probability of transmission conflicts within the same time window can be significantly reduced, improving system stability and power-on consistency.
[0032] The working principle of this embodiment is as follows: with the effective accuracy of the sensor as a constraint, the amplitude of each axis is limited to a range of 10 bits and the sign-amplitude separation is used; 32-bit alignment is used to enable the CPU to complete the read and write in one go, improving DMA and cache efficiency; zero-copy batch packaging is achieved through memcpy; a random seed is generated by "unique ID + counter + DWT cyclic counting", and multiple layers of random delay are superimposed and the amplitude is limited to form an adaptive anti-collision start.
[0033] In this embodiment, the three-dimensional force data is compressed by about 33% (from 48 bits to 32 bits). In a scenario with 64 three-dimensional force vectors in a 16x16 matrix, the number of communication frames is reduced from 6 frames to 4 frames, thus reducing bandwidth usage and buffering. The number of instructions parsed by the host computer is reduced and no complement operation is required. When multiple nodes are powered on at the same time, the initialization and transmission are staggered by random delay, which significantly reduces the probability of bus contention and frame loss and improves system stability.
[0034] Those skilled in the art will understand that the parameters mentioned in the above embodiments (such as 10-bit triaxial amplitude bit width, 2-bit sign bit, 64-byte data frame length, random delay interval, and 0-1023 three-dimensional force amplitude limit range) are merely exemplary selections and are not intended to limit the present invention. Without departing from the core concept of the present invention, those skilled in the art have reason to reasonably adjust and extend the above parameters according to the accuracy requirements, hardware resource limitations, or transmission efficiency requirements of actual application scenarios—for example, extending the amplitude bit width to 9-12 bits to adapt to different precisions; adaptively adjusting the high and low bit arrangement order of the XYZ triaxial amplitude bits and sign bits; extending the sign bit to the Z-axis or using a unified sign domain; adapting the data frame length to a fixed length supported by other buses (SPI / RS485 / Ethernet, etc.); adjusting the random delay interval to a wider or narrower range, or adapting the amplitude limit range to the actual measurement range of the sensor, etc.; anti-collision can be extended to transmission period jitter, backoff retransmission, or master node timing; such parameter adjustments should all fall within the protection scope of the present invention.
Claims
1. A three-dimensional force data management method, characterized in that, Includes the following steps: S100, obtain or calculate the X, Y, and Z components of a three-dimensional force vector; S200 quantizes the amplitudes of the X, Y, and Z axes separately; S300, extract the X-axis sign bit and Y-axis sign bit; separate and encode the X-axis sign bit and Y-axis sign bit from the X amplitude, Y amplitude, and Z amplitude; S400 writes multiple encoded data bits-aligned into a communication frame and sends it.
2. The three-dimensional force data management method according to claim 1, characterized in that, In step S200, the amplitude quantization range for the X, Y, and Z axes is 0-1023.
3. The three-dimensional force data management method according to claim 2, characterized in that, The separate encoding involves encoding the sign bit and amplitude of the X-axis and Y-axis separately, where the first sign bit indicates the sign of the X-axis, the second sign bit indicates the sign of the Y-axis, and the amplitude of the Z-axis is non-negative.
4. The three-dimensional force data management method according to claim 3, characterized in that, In step S300, the amplitude of the three axes and the sign bits of the X and Y axes are encoded into 32-bit data, with the bit width allocated as follows: 10 bits for X amplitude, 10 bits for Y amplitude, 10 bits for Z amplitude, and 2 bits for sign bit.
5. The three-dimensional force data management method according to claim 4, characterized in that, Step S300 uses bit field structure writing or bit mask and shift writing, while the decoding step uses bit mask and shift reading to avoid two's complement operations.
6. The three-dimensional force data management method according to claim 5, characterized in that, Step S400 includes: using a continuously stored three-dimensional force vector array as a source buffer, and using a memory copy instruction to directly move the array to at least one fixed-length data frame buffer to achieve zero-copy batch packaging.
7. The three-dimensional force data management method according to claim 6, characterized in that, The fixed-length data frame is a 64-byte data frame, and in the 64 three-dimensional force vector scenes formed by the 16x16 matrix, it is packaged into 4 64-byte data frames.
8. The three-dimensional force data management method according to claim 7, characterized in that, The identification field of the communication frame includes a device identifier and a packet sequence number to support parallel communication of multiple devices on the same bus and packet reassembly at the receiving end.
9. The three-dimensional force data management method according to any one of claims 1-8, characterized in that, The method further includes: S500, multi-node adaptive anti-collision startup steps: After the device is powered on, it reads the chip's unique identifier, generates a random seed in combination with the hardware counter, generates a random startup delay and waits, and then initializes the communication peripherals and starts sending.
10. The three-dimensional force data management method according to claim 9, characterized in that, The random start delay is formed by superimposing at least two levels of random delay, and the superimposed delay is limited so that it falls within a preset minimum and maximum delay range.
11. A three-dimensional force data management system, characterized in that, include: Data acquisition module, encoding module, packaging and sending module, and anti-collision startup module; The encoding module is used to perform the 32-bit compact encoding as described in any one of claims 1-5, the packing and sending module is used to perform the zero-copy batch packing and sending as described in any one of claims 6-8, and the anti-collision startup module is used to perform the random delay staggered startup as described in any one of claims 9-10.
12. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method of any one of claims 1-10.