Force sensor data acquisition segmented transmission system

By implementing a force sensor data segmentation transmission system that automatically switches the base segment duration, compresses the difference between adjacent sampling points, and pre-scans the repeating sequence, the system solves the problem of existing technologies being unable to adapt to different scenarios and frequency bands and being susceptible to interference, thus achieving efficient and reliable data transmission.

CN121462671BActive Publication Date: 2026-04-21BEIJING TIANGONG JUNLIAN SENSOR CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING TIANGONG JUNLIAN SENSOR CO LTD
Filing Date
2025-09-19
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing force sensor data segmentation transmission technology cannot adapt to the signal change characteristics under different scenarios. This results in excessively short segments in static scenarios, leading to redundant transmission overhead, while excessively long segments in dynamic scenarios are prone to losing key details of sudden changes. High and low frequency band determination is easily affected by electromagnetic interference, compression strategies lack specificity, and computational efficiency is low.

Method used

The basic segmentation module automatically switches the basic segment duration based on the maximum difference of the first N frames of data. The segmented compression module compresses the low-frequency data by the difference between adjacent sampling points and performs a repetitive sequence pre-scan on the high-frequency data and compresses it using the LZ77 algorithm. The segmented transmission module dynamically sets the synchronization frame interval based on the parameter change rate and error tolerance duration, and implements staggered transmission through a bus idle detection circuit.

Benefits of technology

This system improves the efficiency and reliability of force sensor data segmentation transmission, adapts to signal variation characteristics in different scenarios, filters out occasional interference, and compresses data in different frequency bands to ensure real-time transmission of high-frequency critical data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121462671B_ABST
    Figure CN121462671B_ABST
Patent Text Reader

Abstract

This invention discloses a segmented transmission system for force sensor data acquisition. In the field of force sensor data processing technology, the invention includes a basic segmentation module that automatically switches scenes based on preset basic segment durations and data characteristics, dividing the obtained basic segments into low-frequency and high-frequency segments; a segmented compression module that compresses low-frequency data using the difference between adjacent sampling points, and performs a repetitive sequence pre-scan on high-frequency data before compression using the LZ77 algorithm; a segmented transmission module that dynamically sets the synchronization frame interval between low-frequency and high-frequency segments based on parameter change rate and error tolerance time, and achieves staggered transmission through a bus idle detection circuit; and a classification decompression module that decompresses the received data. If it is high-frequency data, it performs moving average filtering based on its data fluctuation; if it is low-frequency data, the filtering process is skipped to obtain the original data. This invention improves the reliability of segmented data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of force sensor data processing technology, specifically a force sensor data acquisition segmentation and transmission system. Background Technology

[0002] In industrial production, mechanical automation and other scenarios, force sensors need to collect and transmit force signal data in real time. The rationality of data segmentation transmission, compression efficiency and transmission reliability directly affect the accuracy of subsequent system decisions.

[0003] Existing force sensor data segmentation transmission technology has the following drawbacks: First, the segmentation duration is mostly fixed, which cannot adapt to the changing characteristics of force signals in different scenarios. In static scenarios, excessively short segments will generate a large amount of redundant transmission overhead, while in dynamic scenarios, excessively long segments are prone to losing key details of force signal mutations. Second, the determination of high and low frequency bands relies on a single indicator, which is easily affected by accidental electromagnetic interference or signal fluctuations. Third, the compression and transmission strategies lack specificity. The low frequency band does not optimize the processing of stable differences and repetitive data, and the high frequency band does not utilize the characteristics of short repetitive sequences, resulting in low computational efficiency.

[0004] Therefore, there is an urgent need for a force sensor data acquisition and segmented transmission system that integrates efficiency and reliability. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a force sensor data acquisition and segmented transmission system, which solves the efficiency and reliability problems of force sensors in data segmented transmission.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a force sensor data acquisition and segmented transmission system, comprising:

[0007] The basic segmentation module automatically switches the basic segment durations A, B, and C based on the maximum difference of the data in the first N frames, and divides the obtained basic segment into low-frequency and high-frequency segments, where A > B > C.

[0008] The segmented compression module compresses low-frequency data using the difference between adjacent sampling points, and performs a pre-scan of the repeating sequence on high-frequency data before compressing it using the LZ77 algorithm.

[0009] The segmented transmission module dynamically sets the synchronization frame interval between the low-frequency band and the high-frequency band based on the parameter change rate R and the error tolerance time T, and realizes staggered transmission through the bus idle detection circuit.

[0010] The classification and decompression module decompresses the received data. If it is high-frequency data, it performs a moving average filter based on the data fluctuation. If it is low-frequency data, it skips the filtering process and obtains the original data directly.

[0011] As a further aspect of the present invention, the specific steps for automatically switching the base segment durations A, B, and C based on the maximum difference of the previous N frames of data are as follows:

[0012] Set two difference thresholds , and ;

[0013] If the maximum difference of the first N frames ≤ If so, it is determined to be a static scene, and the A-level duration is enabled;

[0014] like <Maximum difference between the first N frames≤ If the time is right, it is determined to be a quasi-dynamic scene, and the B-level duration is enabled;

[0015] If the maximum difference of the first N frames is greater than If the time frame is not met, it is determined to be a dynamic scene, and the C-level duration is enabled.

[0016] As a further aspect of the present invention, the value of N is related to the force signal fluctuation period T and the sensor sampling interval. , satisfying N∈ .

[0017] As a further aspect of the present invention, a low-frequency band is determined only when the difference between three consecutive adjacent sampling points is less than K and the maximum fluctuation of all sampling points is less than or equal to L; otherwise, it is determined to be a high-frequency band. The maximum fluctuation of all sampling points refers to the maximum value of all sampling points minus the minimum value.

[0018] As a further aspect of the present invention, the specific steps for compressing low-frequency data using the difference between adjacent sampling points are as follows:

[0019] When the difference between adjacent sampling points is less than or equal to M, it is stored in 1 byte. When the difference between adjacent sampling points is greater than or equal to M, it is automatically switched to 2 bytes for storage. The value of M needs to be determined in combination with three dimensions: sensor range, maximum expected difference in low frequency band, and storage accuracy requirements.

[0020] Multiple consecutive records with the same difference are merged into one record by using a repetition count identifier. The format of the record is: difference | × number of repetitions.

[0021] As a further aspect of the present invention, the specific process for pre-scanning repeating sequences of high-frequency data is as follows:

[0022] Scan the current high-frequency data, filter out short repeating sequences that "appear ≥ 2 times and are ≥ 3 bytes in length", and create a sequence index table for the short repeating sequences;

[0023] When performing a sliding window search, first determine whether the current data matches the sequence in the index table. If it matches, the short repeating sequence is directly replaced by the index. If it does not match, a local byte-by-byte search is then performed. The upper limit of the matching length of the sliding window is set to 8 bytes.

[0024] As a further aspect of the present invention, according to the formula Calculate the synchronization frame interval in the low-frequency band, where, Indicates rounding down. Error tolerance time for low-frequency bands;

[0025] According to the formula Calculate the synchronization frame interval for the high-frequency band, where, For standard high-frequency change rate, This represents the actual high-frequency rate of change. Error tolerance time for high-frequency bands.

[0026] As a further aspect of the present invention, the receiving end calculates the verification deviation of each data segment. If two consecutive verification deviations are greater than S, it is determined that there is interference in the link, and the synchronization frame insertion interval is temporarily adjusted to 1. If three consecutive deviations are less than or equal to S, it is determined that the interference has disappeared, and the synchronization frame insertion interval is restored to the original value. or , where S is the deviation threshold.

[0027] As a further aspect of the present invention, the specific steps for achieving peak-shifting transmission through a bus idle detection circuit are as follows:

[0028] The integrated bus idle detection circuit senses the current status of the UART bus in real time: if no other device transmits a signal on the bus, the transmission process of the current force data compression segment is immediately started; if other device transmits a signal on the bus, the current transmission is paused.

[0029] Force data segments that cannot be sent temporarily are compressed and stored in a preset buffer. High-frequency and low-frequency force data are marked as first and second buffer priorities, respectively, with first-priority data being added to the buffer first.

[0030] Set a maximum allowed temporary storage time for the compressed segment of the first cache priority. If the data of the first cache priority stays in the cache for the maximum allowed temporary storage time, an emergency frame request is immediately triggered: the data of the second cache priority that is currently being transmitted is temporarily suspended through the bus interrupt signal at the hardware level, and the data of the first cache priority is sent first. After the transmission is completed, the data transmission of the interrupted second cache priority is resumed.

[0031] If the cache is full, immediately evict data marked as second cache priority or data with first cache priority that has timed out.

[0032] As a further aspect of the present invention, the specific operation of performing moving average filtering based on data fluctuation is as follows:

[0033] The mean value mv of the variation range of adjacent data is compared with the difference re of the extreme values ​​of the data within the segment.

[0034] If mv≤Mvth and re≤Reth, it is judged as having gentle fluctuations; otherwise, it is judged as having violent fluctuations. Here, Mvth is the mean threshold and Reth is the extreme value difference threshold.

[0035] If the fluctuation is determined to be gentle, then the moving average filter is enabled; if the fluctuation is determined to be severe, then the moving average filter is disabled.

[0036] The method for calculating the average change range of adjacent data is as follows: calculate the absolute value of the change range of every two adjacent data in the segment, then sum all the absolute values ​​of change range and divide by the logarithm of the adjacent data to obtain the average change range.

[0037] The method for calculating the extreme value difference of the data within the segment is as follows: find the maximum and minimum values ​​of the data within the segment, and subtract the minimum value from the maximum value to obtain the extreme value difference.

[0038] This invention provides a segmented data transmission system for force sensor acquisition, which has the following advantages compared with the prior art:

[0039] (1) This invention achieves automatic scene switching by presetting three basic segment durations and combining the maximum difference of the data in the first N frames, adapting to the signal change characteristics of static, quasi-dynamic, and dynamic scenes. At the same time, it uses a dual-condition determination of frequency band based on continuous adjacent differences and the maximum fluctuation within the frame to filter out accidental interference and ensure that the frequency band determination is consistent with the true characteristics of the signal.

[0040] (2) For low-frequency data, the present invention uses difference storage and repetition counting to reduce redundant storage of stable data; for high-frequency data, an index table is established by pre-scanning short repetition sequences, and the LZ77 algorithm is used to prioritize index matching to avoid the invalid operation of traditional byte-by-byte search, thereby achieving targeted compression of data in different frequency bands.

[0041] (3) The present invention dynamically sets the synchronization frame interval based on the parameter change rate and error tolerance time, and combines UART bus off-peak transmission and priority scheduling to ensure real-time transmission of high-frequency key data. Attached Figure Description

[0042] Figure 1 This is the system principle block diagram of the present invention;

[0043] Figure 2 A flowchart illustrating the steps of a low-frequency data compression method;

[0044] Figure 3 This is a flowchart illustrating the steps of a high-frequency data compression method. Detailed Implementation

[0045] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0046] Example 1

[0047] like Figure 1 This application provides a segmented transmission system for force sensor data acquisition, comprising:

[0048] The basic segmentation module presets three basic segment durations, A, B, and C, and automatically switches between them based on the maximum difference between the first N frames of data.

[0049] The rate of change of force signal varies fundamentally across different force sensor applications:

[0050] In static scenarios, such as weighing goods in a warehouse, the force signal remains stable for a long time with an extremely low rate of change. In dynamic scenarios, such as a robotic arm grasping a workpiece, the force signal fluctuates violently in a short period of time with an extremely high rate of change. Quasi-dynamic scenarios, such as material transport on an assembly line, fall somewhere in between.

[0051] Therefore, three basic durations are preset: A is suitable for static scenes, B is suitable for quasi-dynamic scenes, and C is suitable for dynamic scenes, and the duration relationship is A > B > C, thus avoiding the problem of "a single duration cannot take into account different scenes" from the root of the scene.

[0052] For example, if the force signal of a static scene is forcibly segmented using the C-level (short duration) segment, it will result in a number of segments far exceeding the necessary number within one minute, increasing the packet header overhead of the transmission link. If the force signal of a dynamic scene is segmented using the A-level (long duration) segment, it may result in multiple force mutations within a single segment, masking the key mutation details. By presetting multiple duration levels, a preliminary match can be made according to the scene type, laying the foundation for subsequent precise adjustments.

[0053] In practical applications, scenarios may undergo dynamic switching, such as a sudden acceleration of the production line causing the material transmission force signal to change from quasi-dynamic to dynamic. In such cases, relying solely on manual adjustment of the base segment duration would result in significant lag, leading to untimely signal adaptation. Therefore, the "maximum difference between the previous N frames of data" is used as the automatic switching trigger condition, specifically:

[0054] Set two difference thresholds , and ;

[0055] Maximum difference between current N frames ≤ If the time frame is not met, it is considered a static scene, and the A-level duration is enabled.

[0056] when <Maximum difference between the first N frames≤ If the time is right, it is determined to be a quasi-dynamic scene, and the B-level duration is enabled;

[0057] Maximum difference between current N frames > When this occurs, it is determined to be a dynamic scene, and the C-level duration is activated. This mechanism requires no manual intervention and can adjust the duration in real time according to signal changes.

[0058] The frequency of a force signal's fluctuation determines how fast the signal changes, and can be represented by the fluctuation period T, so T = 1 / fluctuation frequency;

[0059] The sensor sampling frequency determines the data density per unit time, and the usable sampling interval Indicate, then =1 / sampling frequency;

[0060] The value of N must be related to both factors: ensuring that the N sampling points can cover the signal. The system has N fluctuation cycles (sufficient to capture changing trends without causing response lag due to excessively long coverage periods), and the total duration of the N sampling points does not exceed the maximum allowable lag time of the system. Therefore, N∈ ;

[0061] The duration of the base segment directly determines the number of sampling points within the segment (the longer the duration, the more sampling points) and the amount of raw data (the more sampling points, the larger the data volume). The duration, sampling points, and data volume must be correlated: A-level duration corresponds to M sampling points and XKB of raw data, suitable for the "few segments, low overhead" requirement in static scenarios; B-level duration corresponds to P sampling points and YKB of raw data, suitable for the "medium segmentation frequency" requirement in quasi-dynamic scenarios; C-level duration corresponds to Q sampling points and ZKB of raw data, suitable for the "multiple segments, focusing on details" requirement in dynamic scenarios, where Z < Y < X, Q < P < M.

[0062] The predefined basic segments are categorized into two types: low-frequency segments and high-frequency segments. The specific operational steps are as follows:

[0063] Let K be the threshold for adjacent differences and L be the threshold for maximum fluctuation.

[0064] It is determined to be a low frequency band only when the difference between three consecutive adjacent sampling points is less than K and the maximum fluctuation of all sampling points is less than or equal to L. The maximum fluctuation of all sampling points in the whole frame is obtained by subtracting the minimum value from the maximum value of all sampling points.

[0065] If any adjacent difference is greater than or equal to K or the maximum intra-frame fluctuation is greater than L, it is determined to be a high-frequency band.

[0066] If the frequency is determined solely by the difference between a single adjacent sampling point, it is susceptible to accidental interference. For example, if the difference between a single adjacent sampling point in a frame accidentally exceeds the threshold, the overall stable low-frequency signal may be mistakenly identified as a high-frequency signal, leading to the selection of the wrong compression algorithm. Therefore, the two key conditions of "the difference between three consecutive frames" and "the maximum fluctuation within the frame" are combined to filter out accidental interference and ensure that the frequency determination is consistent with the true characteristics of the signal.

[0067] The segmented compression module is characterized by the long-term stability of the force signal in the low-frequency band, with minimal changes in the force value between adjacent sampling points. If the original data is stored directly, a large amount of redundancy will occur due to the high data repetition. Therefore, by storing the difference between adjacent sampling points, only the change in force value needs to be recorded, which can significantly reduce the number of bytes stored for a single data entry.

[0068] For example, the raw force data for a certain low-frequency band is "850N, 851N, 852N, 851N, 850N" (stable fluctuation). If the raw data is stored, each value corresponds to 2 bytes, and the total storage size is 10 bytes. However, if the difference is stored, with the first value of 850N as the base, the subsequent difference values ​​are "+1N, +1N, -1N, -1N", each value only requires 1 byte, reducing the total storage size to 6 bytes and reducing storage redundancy.

[0069] Although high-frequency force signals exhibit rapid fluctuations, they are not entirely irregular: in real-world scenarios, high-frequency fluctuations are often accompanied by "periodic short repetitive sequences," such as when a robotic arm repeatedly performs the same grasping action, the force change curves for each grasp will be highly similar.

[0070] For example, the original force data for a certain high-frequency band is {120N, 150N, 120N, 150N, 180N}. Among them, "120N, 150N" is a typical short repeating sequence. If the traditional LZ77 sliding window is used to search byte by byte, this regularity of "short repetition" will be ignored, resulting in a large number of invalid comparisons.

[0071] The segmented transmission module sets synchronization frame insertion intervals for compressed data in the low-frequency and high-frequency bands respectively. The specific operation is as follows:

[0072] Calculate the parameter change rate R and error tolerance time T for low-frequency and high-frequency bands;

[0073] The parameter change rate refers to the ratio of the maximum fluctuation in force value within a single compression data segment to the segment duration. The specific formula is as follows: Because low-frequency data is stable while high-frequency data fluctuates greatly, the R value in the high-frequency band is often greater than that in the low-frequency band.

[0074] Error tolerance time refers to the maximum duration that a transmission error can be allowed to last. If it is exceeded, it will affect the subsequent application of the data. Since low-frequency errors have little impact on subsequent operations, while high-frequency errors affect critical control, the tolerance time (T) for low-frequency errors is often greater than that for high-frequency errors.

[0075] Based on setting the synchronization frame intervals for high and low frequency bands using R and T respectively, the core logic of the two formulas is: the more unstable the data (larger R) and the lower the error tolerance (smaller T), the smaller K (shorter interval). The specific operation steps are as follows:

[0076] According to the formula Calculate the synchronization frame interval in the low-frequency band, where, This indicates rounding down. Since R is small in the low-frequency band, there is no need to consider the impact of R on the interval. It is only necessary to ensure that "the total duration of K segments of data is ≤ T_low" to avoid errors exceeding the tolerance range.

[0077] According to the formula Calculate the synchronization frame interval for the high-frequency band, where, For standard high-frequency change rate, This represents the actual high-frequency rate of change, in the high-frequency band. Possibly higher Therefore, it is necessary to go through Adjustment , The larger, The smaller the value, the faster the error can be located. At the same time, this introduces... avoid Too small;

[0078] Since sudden interference may occur during actual transmission, the K value needs to be dynamically corrected by real-time verification of the deviation. The steps are as follows:

[0079] The receiving end calculates the check deviation of each data segment, such as the percentage deviation between the CRC check value and the sending end.

[0080] If two consecutive verification deviations are greater than S, it is determined that there is interference in the link. The synchronization frame insertion interval is temporarily adjusted to 1, that is, 1 synchronization frame is inserted for each segment. Here, S is the deviation threshold, which needs to be set according to the sensor accuracy.

[0081] Continuously monitor the verification deviation. When three consecutive deviations are ≤S, the interference is determined to have disappeared, and the synchronization frame insertion interval is restored to normal. or ;

[0082] The staggered transmission of different compression segments is achieved through a bus idle detection circuit. The specific operation steps are as follows:

[0083] The integrated bus idle detection circuit senses the current status of the UART bus in real time: if no other device transmits a signal on the bus, the current data compression segment transmission process is immediately started; if other device transmits a signal on the bus, the current transmission is paused and the next operation is performed.

[0084] The essence of the UART bus is half-duplex communication, meaning that only one device can send data at a time. If multiple devices (such as force sensors, temperature sensors, and humidity sensors) share a UART bus, the traditional method often uses "fixed time slice transmission" or "direct blind transmission". The former has poor flexibility and cannot adapt to sudden data, while the latter is prone to data collisions due to multiple devices transmitting at the same time.

[0085] Force data segments that cannot be sent temporarily (including low-frequency or high-frequency data) are compressed and stored in a preset buffer. High-frequency and low-frequency force data are marked as first and second buffer priorities, respectively, and data with the first buffer priority is added to the buffer first.

[0086] Set a maximum allowed temporary storage time for the compressed segment of the first cache priority. If the data of the first cache priority stays in the cache for the maximum allowed temporary storage time, an emergency frame request is immediately triggered: the data of the second cache priority that is currently being transmitted is temporarily suspended through the bus interrupt signal at the hardware level, and the data of the first cache priority is sent first. After the transmission is completed, the data transmission of the interrupted second cache priority is resumed.

[0087] For example, if the robotic arm's grasping force data needs to reach the control system within 10ms, and the data has been in the buffer for 7ms (close to the threshold), while the bus is still occupied by "low-frequency device status reporting data," an emergency frame is triggered: the bus temporarily stops status reporting, prioritizes sending grasping force data, and resumes reporting status data after the transmission is complete. In this case, the total delay of the grasping force data is 9ms, which is still within the 10ms control cycle and can be used normally to determine whether the "grasping force is sufficient," without losing timeliness.

[0088] If the cache is full, immediately evict data marked as second cache priority or data that has expired as first cache priority. At this time, the expired data of first cache priority is no longer suitable to be placed in the cache and needs to be evicted.

[0089] The essential difference between high-frequency and low-frequency decompression data in the classification and decompression module lies in "data stability": low-frequency data is stable over a long period of time, with very little noise introduced during transmission. Even if there are slight fluctuations, they can be naturally reflected through its own stability without the need for additional filtering. If low-frequency data is forcibly filtered, it may smooth out "minor force changes" and cause the data to deviate from the actual scenario.

[0090] High-frequency data, due to its fast transmission rate and drastic fluctuations, is highly susceptible to electromagnetic interference from the bus and signal attenuation, resulting in irregular noise. If not filtered, this noise will be misjudged as real force fluctuations, causing the force control system to make incorrect adjustments.

[0091] The specific steps for filtering decompressed data are as follows:

[0092] After the receiving end obtains the decompressed data, it determines whether the data belongs to the high-frequency band or the low-frequency band based on the priority of the first and second buffers carried in the data segment. Only the high-frequency decompressed data is filtered, while the low-frequency decompressed data skips the filtering process.

[0093] For single-segment high-frequency decompression data, the mean value mv of the change amplitude between adjacent data and the extreme value difference re of the data within the segment are statistically analyzed.

[0094] The method for calculating the average change range of adjacent data is as follows: calculate the absolute value of the change range of every two adjacent data in the segment, then sum all the absolute values ​​of change range and divide by the logarithm of the adjacent data to obtain the average change range. This indicator reflects the overall stability of the data.

[0095] The method for calculating the extreme value difference of the data within the segment is as follows: find the maximum and minimum values ​​of the data within the segment, and subtract the minimum value from the maximum value to obtain the extreme value difference. This indicator reflects whether there are obvious instantaneous changes or peaks in the data.

[0096] Based on the characteristics of high-frequency data application scenarios, dual judgment conditions are set to distinguish data fluctuation states:

[0097] If mv≤Mvth and re≤Reth, it indicates that the overall data changes smoothly without frequent small fluctuations. At the same time, the data does not have obvious instantaneous changes or peaks, so it is judged as having gentle fluctuations. Otherwise, it is judged as having violent fluctuations. Mvth is the mean threshold and Reth is the extreme value difference threshold. Both need to be set according to the actual situation.

[0098] If the fluctuation is determined to be smooth, then the moving average filter is enabled. The average value of the data within the segment is calculated sequentially in a fixed window, and the average value is used to replace the original data within the window to achieve noise smoothing.

[0099] If the data is determined to be highly volatile, the moving average filter is turned off directly, and no smoothing is performed on the original data. This preserves the instantaneous change characteristics and peak information of the data within the segment, avoiding distortion of key data caused by filtering.

[0100] Example 2

[0101] This embodiment further discloses a low-frequency data compression method based on embodiment 1, such as... Figure 2 As shown, the specific content includes:

[0102] As described in Example 1, after obtaining the differences between adjacent sampling points of low-frequency data, it was found that although these differences are mainly small, larger differences may occur due to sudden slight interference, such as ground vibration causing brief fluctuations in weighing data. If the differences are stored in a fixed 1 byte, data overflow will occur when the difference exceeds the maximum representation range of 1 byte. If 2 bytes are used for storage, a large number of small differences will waste 1 byte of space. Therefore, a threshold M is set to achieve "1 byte as the main value and 2 bytes as the auxiliary value". The specific operation rules are as follows:

[0103] When the difference between adjacent sampling points is less than or equal to M, it is stored using 1 byte. When the difference between adjacent sampling points is greater than or equal to M, it is automatically switched to 2 bytes for storage to avoid data overflow.

[0104] The value of M needs to be determined by combining three dimensions: sensor range, maximum expected difference in low frequency band, and storage accuracy requirements. The core goal is to allow 1 byte of storage to cover the vast majority of low frequency differences without sacrificing accuracy.

[0105] For example, if it is a small-range high-precision sensor, such as a force sensor for medical rehabilitation equipment, with a range of 0~100N, a maximum expected difference of ≤±5N in the low-frequency band, and an accuracy requirement of 0.1N, then M can be 5;

[0106] In this scenario, the difference is extremely small. Taking M as 5 can cover most of the low-frequency differences. 1 byte of storage can meet the accuracy requirements while maximizing space saving.

[0107] If it is a medium-range conventional sensor, such as material weighing on a production line, with a range of 0~1000N, a maximum expected difference of ≤±12N in the low-frequency band, and an accuracy requirement of 1N, then M can be taken as 12.

[0108] The 1-byte coverage of 12N can match the difference fluctuations in this scenario, avoiding frequent switching of 2 bytes due to M being too small (increasing storage volume), or waste of space within 1 byte due to M being too large;

[0109] If it is a large-range industrial sensor, such as a truck weighing sensor, with a range of 0~5000N, a maximum expected difference of ≤±30N in the low-frequency band, and an accuracy requirement of 5N, then M can be taken as 30.

[0110] The difference fluctuation range is slightly large under a large range. M is 30, which can cover more than 95% of the low frequency difference. 2 bytes are only used for a very small number of interference differences exceeding 30N, balancing efficiency and integrity.

[0111] When low-frequency data is stable, it is easy for multiple consecutive frames to have the same difference. For example, during static weighing, the force value is completely stable, and the difference is +2N for 10 consecutive frames. If each frame of the same difference is stored separately, a large amount of duplicate data will be generated. At this time, a duplicate count can be used to identify the duplicates in the format: difference | × number of repetitions. This can merge multiple consecutive identical differences into one record, greatly reducing the number of storage entries.

[0112] The repeated counting design does not add extra computational complexity. It only needs to determine whether the current difference is the same as the previous frame before storage. If they are the same, the count is incremented; otherwise, the difference is stored directly, which is suitable for low-frequency processing needs of low-computing-power devices.

[0113] For example, if a low-frequency band contains 8 consecutive frames with the difference {+3N, +3N, +3N, +3N, +3N, +3N, +3N}, and M is set to 15, the original storage is 1 byte per frame, totaling 8 bytes. After adopting repetition counting, it is stored as "+3N|×8", requiring only 2 bytes: 1 byte to store the difference and 1 byte to store the count. The storage amount is reduced from 8 bytes to 2 bytes, improving the compression ratio by 75%.

[0114] Example 3

[0115] This embodiment further discloses a high-frequency data compression method based on embodiment 1, such as... Figure 3 As shown, it specifically includes the following:

[0116] As can be seen from the content described in Example 1, the core pain point of the traditional LZ77 is "byte-by-byte comparison within the sliding window". After fixing the size of the sliding window, for each new data, it is necessary to compare each byte with the bytes in the window in turn to find the duplicate segments. The amount of computation increases linearly with the length of the window, that is, the longer the window, the more comparisons are required.

[0117] Therefore, a pre-scan operation for repeat sequences is added to the traditional LZ77, and the specific process is as follows:

[0118] First, scan the current high-frequency data, filter out short repeating sequences that "appear ≥ 2 times and are ≥ 3 bytes in length", and build a sequence index table for the short repeating sequences. In the example above, index 01 corresponds to "120N, 150N". The index only occupies 1-2 bytes, which is much shorter than the sequence itself.

[0119] During subsequent sliding window searches, there is no need to compare byte by byte. Instead, it first determines whether the current data matches the sequence in the index table. If it matches, the short repeating sequence is directly replaced by the index, and multi-byte compression is completed in one match. If it does not match, a local byte-by-byte search is then performed.

[0120] The sliding window prioritizes matching the index table sequence, and the upper limit of the matching length is set to 8 bytes to adapt to the characteristics of high-frequency short sequences.

[0121] High-frequency repeating sequences are mostly short sequences, typically 2-4 data points long, corresponding to 4-8 bytes. Long repeating sequences of 16 bytes (i.e., more than 8 data points) are extremely rare. If the upper limit of matching length of 16 bytes is retained, it will lead to two problems: ① If there are no repeating sequences in the part exceeding 8 bytes within the window, 8 invalid bytes need to be compared, increasing the amount of computation; ② Long windows require more memory, which is not friendly to low-computing-power devices.

[0122] Taking a high-frequency data band {120N(A), 150N(B), 130N(C), 120N(D), 150N(E), 140N(F)}} as an example, let's examine the operation of the 16-byte window step by step according to the data processing order:

[0123] Initially, the history buffer is empty. First, A (120N, 2 bytes), B (150N, 2 bytes), and C (130N, 2 bytes) are processed. At this time, the history buffer stores "A, B, C" (6 bytes in total, not filling the 16-byte window). The lookahead data to be processed is "D (120N), E (150N), F (140N)".

[0124] The traditional LZ77 algorithm aims to "find the longest matching segment in the history buffer that begins with the lookahead data (D)," and the matching length cannot exceed the window length. In this case, the following comparison operation is performed:

[0125] Starting with the first data A in the historical buffer, we attempt to match "D (120N)" and find that A=D. Then we continue to compare the subsequent data. The next data after A in the historical buffer is B (150N), and the next data after D is E (150N). A+B and D+E are a perfect match (4 bytes in total).

[0126] Because the window length is 16 bytes, even if a 4-byte match (A+B) has been found, the algorithm will still try to "match a longer segment", that is, continue to look at the next data C (130N) in the historical buffer A+B and see if it matches the next data F (140N) in the lookahead data D+E. The result shows that C≠F, the longer match fails, and the matching segment is finally determined to be A+B (4 bytes).

[0127] When attempting to match longer segments, the "C (130N, 2 bytes)" and "F (140N, 2 bytes)" comparisons are the extra 4 bytes compared. This part of the comparison is completely invalid because high-frequency repeating sequences are inherently "short sequences" and it is impossible for longer repeating segments containing C or F to appear. However, the 16-byte window's allowed range for long matches forces the algorithm to complete this comparison step in order to confirm that there are no longer matches.

[0128] If the window length is reduced to 8 bytes, a maximum of 4 data items can be matched. However, the high-frequency repeating sequence is A+B (2 data items, 4 bytes), which is much smaller than the window limit. When processing the lookahead data D, after finding a match between A+B and D+E, the algorithm will determine whether "the current matching length has reached the longest match allowed by the window". Since the window is 8 bytes, but the lookahead data only has F afterward, it cannot form a longer matching segment. Therefore, it will not try to compare C and F again, and directly determine the matching segment as A+B, thus avoiding invalid calculations.

[0129] Some of the data in the above formulas are numerical calculations with dimensions removed, and the contents not described in detail in this specification are all prior art known to those skilled in the art.

[0130] The above embodiments are only used to illustrate the technical methods of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of the present invention without departing from the spirit and scope of the technical methods of the present invention.

Claims

1. A force sensor data acquisition and segmented transmission system, characterized in that, include: The basic segmentation module automatically switches the duration of the basic segment A, B, and C based on the maximum difference of the data in the first N frames, and divides the resulting basic segment into a low-frequency segment and a high-frequency segment. The specific rules for dividing the basic segment into low-frequency and high-frequency segments are as follows: it is determined to be a low-frequency segment only when the difference between three consecutive adjacent sampling points is less than K and the maximum fluctuation of all sampling points is less than or equal to L; otherwise, it is determined to be a high-frequency segment. The maximum fluctuation of all sampling points refers to the maximum value minus the minimum value of all sampling points, where K is the adjacent difference threshold, L is the maximum fluctuation threshold, and A > B > C. The segmented compression module compresses low-frequency data using the difference between adjacent sampling points, and performs a pre-scan of the repeating sequence on high-frequency data before compressing it using the LZ77 algorithm. The segmented transmission module dynamically sets the synchronization frame interval between the low-frequency band and the high-frequency band based on the parameter change rate R and the error tolerance time T, and realizes staggered transmission through the bus idle detection circuit. The classification and decompression module decompresses the received data. If it is high-frequency data, it performs a moving average filter based on the data fluctuation. If it is low-frequency data, it skips the filtering process and obtains the original data directly.

2. The force sensor data acquisition and segmented transmission system according to claim 1, characterized in that, The specific steps for automatically switching the base segment durations A, B, and C based on the maximum difference of the data from the previous N frames are as follows: Set two difference thresholds ; If the maximum difference of the first N frames ≤ If so, it is determined to be a static scene, and the A-level duration is enabled; like <Maximum difference between the first N frames≤ If the time is right, it is determined to be a quasi-dynamic scene, and the B-level duration is enabled; If the maximum difference of the first N frames is greater than If the time frame is not met, it is determined to be a dynamic scene, and the C-level duration is enabled.

3. The force sensor data acquisition and segmented transmission system according to claim 2, characterized in that, The value of N is related to the force signal fluctuation period T and the sensor sampling interval. , satisfying N∈ .

4. The force sensor data acquisition and segmented transmission system according to claim 1, characterized in that, The specific steps for compressing low-frequency data using the difference between adjacent sampling points are as follows: When the difference between adjacent sampling points is less than or equal to M, it is stored in 1 byte. When the difference between adjacent sampling points is greater than or equal to M, it is automatically switched to 2 bytes for storage. The value of M needs to be determined in combination with three dimensions: sensor range, maximum expected difference in low frequency band, and storage accuracy requirements. Multiple consecutive records with the same difference are merged into one record by using a repetition count identifier. The format of the record is: difference | × number of repetitions.

5. The force sensor data acquisition and segmented transmission system according to claim 1, characterized in that, The specific process for performing repetitive sequence pre-scanning on high-frequency data is as follows: Scan the current high-frequency data, filter out short repeating sequences that "appear ≥ 2 times and are ≥ 3 bytes in length", and create a sequence index table for the short repeating sequences; When performing a sliding window search, first determine whether the current data matches the sequence in the index table. If it matches, the short repeating sequence is directly replaced by the index. If it does not match, a local byte-by-byte search is then performed. The upper limit of the matching length of the sliding window is set to 8 bytes.

6. The force sensor data acquisition and segmented transmission system according to claim 1, characterized in that, According to the formula Calculate the synchronization frame interval in the low-frequency band, where, Indicates rounding down. Error tolerance time for low-frequency bands; According to the formula Calculate the synchronization frame interval for the high-frequency band, where, For standard high-frequency change rate, This represents the actual high-frequency rate of change. Error tolerance time for high-frequency bands.

7. The force sensor data acquisition and segmented transmission system according to claim 1, characterized in that, The receiving end calculates the check deviation for each data segment. If two consecutive check deviations are greater than S, it is determined that there is interference in the link, and the synchronization frame insertion interval is temporarily adjusted to 1. If three consecutive deviations are less than or equal to S, it is determined that the interference has disappeared, and the synchronization frame insertion interval is restored to normal. , where S is the deviation threshold.

8. The force sensor data acquisition and segmented transmission system according to claim 1, characterized in that, The specific steps for implementing peak-shifting transmission through a bus idle detection circuit are as follows: The UART bus status is monitored in real time through an integrated bus idle detection circuit: if no other device transmits a signal on the bus, the transmission process of the current force data compression segment is immediately started. If a transmission signal from another device is detected on the bus, the current transmission is paused. Force data segments that cannot be sent temporarily are compressed and stored in a preset buffer. High-frequency and low-frequency force data are marked as first and second buffer priorities, respectively, with first-priority data being added to the buffer first. Set a maximum allowed temporary storage time for the compressed segment of the first cache priority. If the data of the first cache priority stays in the cache for the maximum allowed temporary storage time, an emergency frame request is immediately triggered: the data of the second cache priority that is currently being transmitted is temporarily suspended through the bus interrupt signal at the hardware level, and the data of the first cache priority is sent first. After the transmission is completed, the data transmission of the interrupted second cache priority is resumed. If the cache is full, immediately evict data marked as second cache priority or data with first cache priority that has timed out.

9. The force sensor data acquisition and segmented transmission system according to claim 1, characterized in that, For high-frequency data, the specific operation of moving average filtering based on data fluctuation is as follows: The mean value mv of the variation range of adjacent data is compared with the difference re of the extreme values ​​of the data within the segment. If mv≤Mvth and re≤Reth, it is judged as having gentle fluctuations; otherwise, it is judged as having violent fluctuations. Here, Mvth is the mean threshold and Reth is the extreme value difference threshold. If the fluctuation is determined to be gentle, then the moving average filter is enabled; if the fluctuation is determined to be severe, then the moving average filter is disabled. The method for calculating the average change range of adjacent data is as follows: calculate the absolute value of the change range of every two adjacent data in the segment, then sum all the absolute values ​​of change range and divide by the logarithm of the adjacent data to obtain the average change range. The method for calculating the extreme value difference of the data within the segment is as follows: find the maximum and minimum values ​​of the data within the segment, and subtract the minimum value from the maximum value to obtain the extreme value difference.

Citation Information

Patent Citations

  • Power system load fluctuation section data compression method based on compressed sensing

    CN119834811A

  • Time sequence database data compression method, system and device and storage medium

    CN120377929A