A method for processing industrial tightening data and related device

CN122993725APending Publication Date: 2026-10-27WUHAN NORCO POWER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611451263.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-18
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0005]本申请的目的是提供一种工业拧紧数据的处理方法及相关装置,以解决在工业拧紧工具中的嵌入式端内存与传输带宽受限的场景下,高采样率产生的采样数据量远超内存可容纳的上限,使得现有方案降低采样频率或缩短记录时长,使扭矩爬升、贴合、保持等关键工艺阶段的瞬态特征丢失;同时,无法优先保护对质量判定最为关键的尾部阶段数据,容易导致还原曲线中采样点的时间轴错位、关键工艺特征偏移,进而影响拧紧质量判定的准确性较低的问题

Benefits of technology

本申请实施例提供了一种工业拧紧数据的处理方法及相关装置,应用于工业拧紧工具,在工业拧紧工具的微控制器端,首先获取拧紧过程中的第一拧紧数据序列;第一拧紧数据序列包括多个采样点采集的工业拧紧数据;在第一拧紧数据序列中采样点数量大于或等于预设的数据保留阈值时,将第一拧紧数据序列之后采样得到的工业拧紧数据作为第二拧紧数据序列,并将第二拧紧数据序列写入缓存区;然后,对第一拧紧数据序列中除预设保留采样点之外的其它采样点对应的工业拧紧数据进行压缩处理,得到第一压缩数据;根据所述第一压缩数据,以及第二拧紧数据序列生成目标拧紧数据序列;最后,将目标拧紧数据序列进行打包封装,得到拧紧数据包,并向上位机发送拧紧数据。在工业拧紧工具的上位机端,通过接收由微控制器发送的拧紧数据包;对拧紧数据包进行解析,得到第一解析数据、第二解析数据和采样位置映射信息;其中,第一解析数据对应由微控制器进行压缩处理后的拧紧数据序列,第二解析数据对应由微控制器缓存的未压缩拧紧数据序列,采样位置映射信息表征所述第一解析数据中各采样点对应的采样时序位置;根据采样位置映射信息确定第一解析数据中采样点对应的第一时序位置,以及,根据第二解析数据中采样点对应的采样顺序确定第二时序位置;根据第一时序位置、第二时序位置对第一解析数据和第二解析数据进行时序融合,得到第三拧紧数据序列;确定第三拧紧数据序列中相邻采样点之间的时序关系;以及,确定第三拧紧数据序列中的缺采样位置信息;根据时序关系对缺采样位置信息进行插值补偿,得到工业拧紧工具的拧紧过程曲线。如此,在采样点数量达到数据保留阈值后,将后续的第二拧紧数据序列完整保留在缓存区而未被压缩,仅对前期数据中的非保留采样点进行压缩,使得拧紧过程后续阶段对质量判定关键的数据获得保护;同时,第一拧紧数据序列中保留的预设保留采样点,使接收端重建曲线时能够准确对位被压缩部分的采样点,从而有利于在嵌入式内存和传输带宽受限条件下保持还原曲线的时序精度与波形保真度,提升拧紧质量判定的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122993725A_ABST
    Figure CN122993725A_ABST
Patent Text Reader

Abstract

The application provides a processing method of industrial tightening data and a related device, and belongs to the field of data processing. The method comprises the following steps: acquiring a first tightening data sequence in a tightening process; when the number of sampling points in the first tightening data sequence is greater than or equal to a preset data retention threshold, regarding the industrial tightening data obtained by sampling after the first tightening data sequence as a second tightening data sequence, and writing the second tightening data sequence into a cache area; performing compression processing on the industrial tightening data corresponding to the other sampling points except the preset retained sampling points in the first tightening data sequence to obtain first compressed data; generating a target tightening data sequence according to the first compressed data and the second tightening data sequence; packaging the target tightening data sequence to obtain a tightening data packet, and sending the tightening data packet to an upper computer. In this way, the accuracy of the tightening quality determination of a tightening tool can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method and related apparatus for processing industrial tightening data. Background Technology

[0002] In existing industrial tightening process data recording solutions, most methods collect torque and angle data during the tightening process at a fixed sampling frequency on an embedded device, cache all sampled data in the embedded device's memory, and upload all sampled data to a host computer after tightening is completed for tightening quality analysis and data traceability. This data recording solution requires the embedded device to have sufficient memory resources to hold all sampled data, as well as sufficient transmission bandwidth to transmit all sampled data.

[0003] However, in scenarios where embedded memory and transmission bandwidth are limited, the amount of sampled data generated by high sampling rates far exceeds the upper limit of memory capacity. This forces existing solutions to reduce the sampling frequency or shorten the recording time, resulting in the loss of transient characteristics in key process stages such as torque ramping, bonding, and holding. At the same time, if a uniform compression strategy is used for all sampled data, it is impossible to prioritize the protection of the tail stage data, which is most critical for quality judgment. Furthermore, when the compressed data is transmitted to the receiving end for curve reconstruction, the original timing position of the discarded sampling points cannot be determined, which can easily lead to time axis misalignment of sampling points and offset of key process features in the restored curve, resulting in distortion of the restored curve and affecting the accuracy of tightening quality judgment.

[0004] Therefore, how to process industrial tightening data to improve the accuracy of tightening tools in judging tightening quality is an urgent problem to be solved. Summary of the Invention

[0005] The purpose of this application is to provide a method and related apparatus for processing industrial tightening data, in order to solve the problem that in scenarios where the embedded memory and transmission bandwidth of industrial tightening tools are limited, the amount of sampled data generated by the high sampling rate far exceeds the upper limit of memory capacity. This causes existing solutions to reduce the sampling frequency or shorten the recording time, resulting in the loss of transient characteristics of key process stages such as torque ramp-up, fit, and holding. At the same time, it is impossible to prioritize the protection of the tail stage data that is most critical to quality judgment, which can easily lead to time axis misalignment of sampling points in the restoration curve and offset of key process characteristics, thereby affecting the accuracy of tightening quality judgment.

[0006] To address the above issues, the following solutions are provided: In a first aspect, this application provides a method for processing industrial tightening data, applied to a microcontroller in an industrial tightening tool, the method comprising: Acquire a first tightening data sequence during the tightening process; the first tightening data sequence includes industrial tightening data collected from multiple sampling points; When the number of sampling points in the first tightening data sequence is greater than or equal to the preset data retention threshold, the industrial tightening data sampled after the first tightening data sequence is used as the second tightening data sequence, and the second tightening data sequence is written into the buffer area. The industrial tightening data corresponding to the other sampling points in the first tightening data sequence, excluding the preset reserved sampling points, are compressed to obtain the first compressed data. A target tightening data sequence is generated based on the first compression data and the second tightening data sequence; The target tightening data sequence is packaged and encapsulated to obtain a tightening data packet, which is then sent to the host computer.

[0007] Secondly, this application provides another method for processing industrial tightening data, applied to a host computer in an industrial tightening tool, wherein the host computer is communicatively connected to a microcontroller, and the method includes: Receive the tightening data packet sent by the microcontroller; The tightening data packet is parsed to obtain first parsed data, second parsed data, and sampling position mapping information; the first parsed data corresponds to the tightening data sequence after being compressed by the microcontroller, the second parsed data corresponds to the uncompressed tightening data sequence cached by the microcontroller, and the sampling position mapping information represents the sampling timing position corresponding to each sampling point in the first parsed data; The first temporal position corresponding to the sampling point in the first parsed data is determined according to the sampling position mapping information, and the second temporal position is determined according to the sampling order corresponding to the sampling point in the second parsed data. Based on the first time sequence position and the second time sequence position, the first parsed data and the second parsed data are fused in time sequence to obtain the third tightening data sequence; Determine the temporal relationship between adjacent sampling points in the third tightening data sequence; and determine the missing sampling location information in the third tightening data sequence; Based on the time sequence relationship, interpolation compensation is performed on the missing sampling location information to obtain the tightening process curve of the industrial tightening tool.

[0008] Thirdly, this application provides an industrial tightening data processing device, applied to a microcontroller in an industrial tightening tool, the device comprising: The sampling module is used to acquire a first tightening data sequence during the tightening process; the first tightening data sequence includes industrial tightening data collected from multiple sampling points; when the number of sampling points in the first tightening data sequence is greater than or equal to a preset data retention threshold, the industrial tightening data sampled after the first tightening data sequence is used as a second tightening data sequence, and the second tightening data sequence is written into the buffer area. The compression module is used to compress the industrial tightening data corresponding to other sampling points in the first tightening data sequence, excluding the preset reserved sampling points, to obtain the first compressed data. A generation module is used to generate a target tightening data sequence based on the first compression data and the second tightening data sequence; The sending module is used to package and encapsulate the target tightening data sequence to obtain a tightening data packet, and send the tightening data packet to the host computer.

[0009] Fourthly, this application provides another industrial tightening data processing device, applied to a host computer in an industrial tightening tool, wherein the host computer is communicatively connected to a microcontroller, and the device includes: A receiving module is used to receive tightening data packets sent by the microcontroller; The parsing module is used to parse the tightening data packet to obtain first parsed data, second parsed data, and sampling position mapping information; the first parsed data corresponds to the tightening data sequence after being compressed by the microcontroller, the second parsed data corresponds to the uncompressed tightening data sequence cached by the microcontroller, and the sampling position mapping information represents the sampling timing position corresponding to each sampling point in the first parsed data; The control module is configured to: determine a first temporal position corresponding to a sampling point in the first parsed data based on the sampling position mapping information; determine a second temporal position based on the sampling order corresponding to a sampling point in the second parsed data; perform temporal fusion on the first parsed data and the second parsed data based on the first temporal position and the second temporal position to obtain a third tightening data sequence; determine the temporal relationship between adjacent sampling points in the third tightening data sequence; and determine missing sampling position information in the third tightening data sequence. The output module is used to interpolate and compensate for the missing sampling position information according to the time sequence relationship to obtain the tightening process curve of the industrial tightening tool.

[0010] Fifthly, this application provides an industrial tightening tool, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for performing steps in any of the methods of the first aspect of the embodiments of this application.

[0011] In a sixth aspect, this application provides a computer-readable storage medium storing a computer program for electronic data interchange, wherein the computer program causes a computer to perform some or all of the steps described in any of the methods of the first aspect of the embodiments of this application.

[0012] In a seventh aspect, this application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in any of the methods of the first aspect of the embodiments of this application.

[0013] By implementing the embodiments of this application, the following beneficial effects are achieved: This application provides a method and related apparatus for processing industrial tightening data, applied to industrial tightening tools. At the microcontroller end of the industrial tightening tool, a first tightening data sequence is first acquired during the tightening process. The first tightening data sequence includes industrial tightening data collected from multiple sampling points. When the number of sampling points in the first tightening data sequence is greater than or equal to a preset data retention threshold, the industrial tightening data sampled after the first tightening data sequence is used as a second tightening data sequence, and the second tightening data sequence is written into a buffer. Then, the industrial tightening data corresponding to other sampling points in the first tightening data sequence, excluding the preset retained sampling points, is compressed to obtain first compressed data. A target tightening data sequence is generated based on the first compressed data and the second tightening data sequence. Finally, the target tightening data sequence is packaged and encapsulated to obtain a tightening data packet, and the tightening data is sent to a host computer. On the host computer of the industrial tightening tool, tightening data packets sent by the microcontroller are received; the tightening data packets are parsed to obtain first parsed data, second parsed data, and sampling position mapping information; wherein, the first parsed data corresponds to the tightening data sequence after compression by the microcontroller, the second parsed data corresponds to the uncompressed tightening data sequence cached by the microcontroller, and the sampling position mapping information represents the sampling timing position corresponding to each sampling point in the first parsed data; the first timing position corresponding to the sampling point in the first parsed data is determined according to the sampling position mapping information, and the second timing position is determined according to the sampling order corresponding to the sampling point in the second parsed data; the first parsed data and the second parsed data are time-series fused according to the first timing position and the second timing position to obtain a third tightening data sequence; the timing relationship between adjacent sampling points in the third tightening data sequence is determined; and the missing sampling position information in the third tightening data sequence is determined; the missing sampling position information is interpolated and compensated according to the timing relationship to obtain the tightening process curve of the industrial tightening tool. Thus, once the number of sampling points reaches the data retention threshold, the subsequent second tightening data sequence is completely retained in the buffer without being compressed. Only the non-retained sampling points in the previous data are compressed, protecting the data crucial for quality judgment in the later stages of the tightening process. At the same time, the preset retained sampling points in the first tightening data sequence enable the receiver to accurately align the compressed sampling points when reconstructing the curve. This helps maintain the timing accuracy and waveform fidelity of the restored curve under conditions of limited embedded memory and transmission bandwidth, thereby improving the accuracy of tightening quality judgment. Attached Figure Description

[0014] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0015] Figure 1 This is an architecture diagram of an adaptive compression and restoration system for industrial tightening process data provided in an embodiment of this application; Figure 2 This is a flowchart illustrating the data processing procedure of an industrial tightening tool provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an industrial tightening tool provided in an embodiment of this application; Figure 4 This is a flowchart illustrating a method for processing industrial tightening data according to an embodiment of this application; Figure 5 This is a schematic diagram of a microprocessor sampling process provided in an embodiment of this application; Figure 6 This is a flowchart illustrating a downsampling compression algorithm provided in an embodiment of this application; Figure 7 This is a schematic diagram of a processing flow for sending tightening data to a host computer, provided in an embodiment of this application; Figure 8 This is a flowchart illustrating another method for processing industrial tightening data provided in an embodiment of this application; Figure 9 This is a schematic diagram of a data restoration process provided in an embodiment of this application; Figure 10 This is a schematic flowchart of a host computer constructing a tightening process curve, provided in an embodiment of this application. Figure 11 This is a functional module block diagram of an industrial tightening data processing device provided in an embodiment of this application; Figure 12 This is a functional module block diagram of another industrial tightening data processing device provided in the embodiments of this application. Detailed Implementation

[0016] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0017] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0018] It should be understood that the term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this document indicates that the preceding and following related objects are in an "or" relationship. In the embodiments of this application, "multiple" refers to two or more.

[0019] In the embodiments of this application, "at least one item" or its similar expression refers to any combination of these items, including any combination of a single item or a plurality of items. "One or more" means one or more, while "multiple" means two or more. For example, "at least one item" of a, b, or c can represent the following seven cases: a, b, c; a and b; a and c; b and c; a, b, and c. Each of a, b, and c can be an element or a set containing one or more elements.

[0020] In this application embodiment, "connection" refers to various connection methods such as direct connection or indirect connection to realize communication between devices. This application embodiment does not limit this in any way.

[0021] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0022] Please see Figure 1 , Figure 1 This is an architecture diagram of an adaptive compression and restoration system for industrial tightening process data provided in an embodiment of this application. The adaptive compression and restoration system 100 for industrial tightening process data includes a microcontroller 110 and a host computer 120.

[0023] The microcontroller 110 is used to acquire, buffer, compress, and transmit sampled data during the industrial tightening process, thereby reducing the amount of industrial tightening data under limited storage resources. The processed tightening data is then sent to the host computer 120 for restoration. In some embodiments, the microcontroller 110 can be installed inside the industrial tightening tool to acquire industrial tightening data in real time. The microcontroller 110 includes an acquisition unit 111 and an interrupt unit 112. The interrupt unit 112 is used to control the buffer switching of the acquired data in response to changes in the buffer state during the industrial tightening data acquisition process, ensuring the continuity of the data acquisition process.

[0024] In one possible embodiment, when the number of sampling points in the sampling buffer reaches a preset buffer capacity, the interrupt unit 112 can trigger a buffer switching operation, switching the sampling buffer currently storing sampling data to a processing buffer, and simultaneously switching another buffer to a new sampling buffer to continue receiving subsequently acquired industrial tightening data. The data in the processing buffer can be output to the microcontroller 110 for compression processing, thereby preventing the sampling process from being paused or the sampling data from being lost due to time-consuming data processing.

[0025] The host computer 120 receives tightening data sent by the microcontroller 110, and parses, restores, and reconstructs the tightening data to obtain the tightening process curve corresponding to the industrial tightening tool. In some embodiments, the host computer 120 can be communicatively connected to the microcontroller 110 to receive tightening data packets sent by the microcontroller 110, and perform recovery processing on the industrial tightening process data based on the compressed data, uncompressed data, and sampling position mapping information in the data packets. The host computer 120 includes a data unpacking unit 121, a symmetry restoration unit 122, an interpolation completion unit 123, and a curve output unit 124. The data unpacking unit 121 is used to receive the tightening data packet sent by the microcontroller 110 and parse the tightening data packet; the symmetry restoration unit 122 is used to perform time-series fusion based on the sampling position information and sampling order corresponding to the parsed data to obtain a complete tightening data sequence; the interpolation completion unit 123 is used to determine the missing sampling position in the tightening data sequence and perform interpolation compensation on the missing sampling position according to the time-series relationship between adjacent sampling points to restore the missing sampling data; the curve output unit 124 is used to generate the tightening process curve corresponding to the industrial tightening tool based on the interpolated tightening data and output the tightening process curve.

[0026] For further information, please refer to [link / reference]. Figure 2 , Figure 2This is a flowchart illustrating the data processing of an industrial tightening tool according to an embodiment of this application. As can be seen, the data processing of this industrial tightening tool includes two processing flows: an embedded end (microprocessor) and a host computer end. The embedded end (microprocessor) is used to collect, cache, and adaptively compress high-frequency sampling data during the industrial tightening process in real time. The host computer end is used to receive, parse, restore, and reconstruct the tightening curve from the data output by the embedded end, thereby reducing data storage and transmission pressure while ensuring the integrity of the tightening process data.

[0027] Specifically, in the embedded part (microprocessor), firstly, the analog-to-digital converter (ADC) operates at a sampling rate of 1kHz, triggering an interrupt at the end of each sampling cycle to acquire sampling data during the industrial tightening process in real time. Because parameters such as torque and angle change rapidly during industrial tightening, acquiring tightening process data at a higher sampling frequency preserves the transient characteristics of the tightening process. Next, the interrupt service routine is triggered every 1ms, writing the currently acquired sampling data into the buffer area corresponding to the double-buffered Ping-Pong mechanism. The double-buffered Ping-Pong mechanism includes a sampling buffer and a processing buffer. At any given time, one buffer continuously receives data acquired by the ADC, while the other processes the already acquired data. By alternately switching between the two buffers, the data acquisition and processing processes can be executed in parallel, avoiding the blocking of sampling interrupts due to the time-consuming data compression processing. Then, when the buffer reaches a preset capacity, a task is triggered when the buffer is full, and the corresponding data processing task is submitted to the asynchronous work queue (i.e., task submission when full). The asynchronous work queue receives data processing tasks triggered by interrupt service routines, enabling subsequent data compression operations to be performed in a non-real-time sampling environment, thus avoiding the impact of complex calculations on the real-time sampling process. Furthermore, the microprocessor performs downsampling compression on the cached data using asynchronous compression. This downsampling engine employs a 2:1 extraction plus tail retention compression strategy, downsampling historical data according to preset extraction rules while fully preserving data from critical stages in the tightening process. This reduces the amount of data that needs to be stored and transmitted while maintaining the data resolution of critical process stages. Subsequently, the processed data is stored in a master sequence with a capacity of M points and formed into data packets using Protobuf encapsulation and Q15 double-value packaging. The master sequence with a capacity of M points stores the compressed tightening data sequence; Protobuf encapsulation encapsulates the compressed tightening data according to a preset data format; and Q15 double-value packaging improves data transmission efficiency, enabling the processed data to be sent to the host computer via the communication link.

[0028] On the host computer, Protobuf packets are first received via serial / WiFi RPC, and receive and unpack them to obtain compressed and uncompressed data output from the embedded terminal, along with corresponding sampling position mapping information. Then, the host computer performs symmetrical downsampling restoration processing. Based on the data compression rules and sampling position mapping relationship executed by the embedded terminal, the downsampled data is restored to its corresponding sampling time position. Further, the host computer compensates for missing sampling positions after downsampling using linear interpolation. Next, the host computer performs a critical process injection operation, re-adding pre-reserved high-resolution data of key stages to the restored data sequence, ensuring that the final restored data includes both overall trend information and detailed information on key process stages. Finally, the restored industrial tightening data is converted into a corresponding tightening process curve through the output of the restored curve, used to display and analyze the industrial tightening process.

[0029] As can be seen, this embodiment achieves real-time acquisition and low-resource compression processing of high-frequency industrial tightening data by employing a double-buffered Ping-Pong mechanism, asynchronous work queues, and downsampling compression strategies on the embedded side. Simultaneously, accurate recovery of the compressed data is achieved through symmetrical downsampling restoration, linear interpolation, and key process injection on the host computer side. Through the aforementioned architecture of the embedded and host computers, adaptive compression and high-fidelity restoration of industrial tightening process data can be achieved without increasing the hardware storage resources of the embedded side. This allows industrial tightening tools to meet the requirements of high-frequency sampling, real-time processing, and data integrity, thereby improving the monitoring and quality analysis capabilities of the industrial tightening process.

[0030] The following is combined with Figure 3 The industrial tightening tools in the embodiments of this application will be described. Figure 3 This is a structural schematic diagram of an industrial tightening tool provided in an embodiment of this application, as shown below. Figure 3 As shown, the industrial tightening tool 300 includes a processor 310, a memory 320, a communication interface 330, and one or more programs 321. The processor 310 is communicatively connected to the memory 320 and the communication interface 330 via an internal communication bus.

[0031] The one or more programs 321 are stored in the memory 320 and configured to be executed by the processor 310. The one or more programs 321 include instructions for performing any step in the above method embodiments.

[0032] The processor 310 can be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, cells, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc. The communication unit can be a communication interface, transceiver, transceiver circuitry, etc., and the storage unit can be a memory.

[0033] The memory 320 can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory.

[0034] It is understood that the industrial tightening tool 300 may include more or fewer structural components than those shown in the above block diagram, such as a power module, physical buttons, a Wi-Fi module, a speaker, a Bluetooth module, a sensor, a display module, etc., without limitation. It is also understood that the industrial tightening tool 300 may be equipped with... Figure 1 The architecture of an adaptive compression and restoration system for industrial tightening process data is described above.

[0035] After understanding the software and hardware architecture of this application, the following will be combined with... Figure 4 This application describes a method for processing industrial tightening data according to an embodiment of the present application. Figure 4 This is a flowchart illustrating a method for processing industrial tightening data according to an embodiment of this application. The method is applied to a controller in an industrial tightening tool and specifically includes the following steps: Step S401: Obtain the first tightening data sequence during the tightening process; the first tightening data sequence includes industrial tightening data collected from multiple sampling points.

[0036] The first tightening data sequence represents historical sampling data of the industrial tightening tool during the current tightening process. This industrial tightening data may include torque data, angle data, and other data related to the tightening state. The industrial tightening tool may include devices such as cordless electric screwdrivers or corded electric screwdrivers. In some embodiments, the industrial tightening tool has a built-in microcontroller used to control the operation of the tightening actuator and to collect and process sensor sampling data during the tightening process. The microprocessor may be an ARM Cortex-M7.

[0037] Specifically, during the tightening operation, the microcontroller can continuously sample the tightening process according to a preset sampling period to obtain industrial tightening data corresponding to multiple sampling points. The industrial tightening data corresponding to each sampling point is then arranged in chronological order to form the first tightening data sequence. For example, the microcontroller can synchronously sample the torque sensor and angle sensor in the tightening tool based on a preset sampling frequency to obtain the torque and angle values ​​corresponding to each sampling moment, and establish the first tightening data sequence according to the sampling time sequence position of each sampling point. Furthermore, the first tightening data sequence can be stored in the microcontroller's data storage area for subsequent compression processing based on the data storage capacity and the duration of the tightening process.

[0038] Step S402: When the number of sampling points in the first tightening data sequence is greater than or equal to a preset data retention threshold, the industrial tightening data sampled after the first tightening data sequence is used as the second tightening data sequence, and the second tightening data sequence is written into the buffer area.

[0039] The data retention threshold limits the maximum amount of tightening data sequences that can be directly saved in the microcontroller. It can be pre-configured based on the hardware storage resources of the industrial tightening tool, the data accuracy requirements of the tightening process, and data transmission needs. In some embodiments, the data retention threshold is set to 1000. The second tightening data sequence is used to store real-time industrial tightening data sampled after the first tightening data sequence reaches the data retention threshold, to avoid loss of subsequent sampled data due to the first tightening data sequence reaching its storage capacity limit.

[0040] Specifically, when the microcontroller continuously collects industrial tightening data during the tightening process, it can count the number of sampling points in the current first tightening data sequence in real time and compare the number of sampling points with a preset data retention threshold. When it detects that the number of sampling points in the first tightening data sequence is less than the data retention threshold, the collected industrial tightening data can continue to be written into the first tightening data sequence according to the sampling time sequence. When it detects that the number of sampling points in the first tightening data sequence is greater than or equal to the data retention threshold, it indicates that the first tightening data sequence has reached the current data storage capacity limit. At this time, the subsequently sampled industrial tightening data is separated from the first tightening data sequence and used as a new second tightening data sequence. Further, the second tightening data sequence can be written into a buffer area set in the microcontroller to temporarily store subsequent sampled data. In some embodiments, the buffer area can include multiple buffer regions, such as a sampling buffer area and a processing buffer area. The microcontroller can write the subsequently collected industrial tightening data into the sampling buffer area sequentially according to the sampling time sequence. When the number of sampling points in the sampling buffer reaches the preset buffer capacity, the sampling buffer and the processing buffer can be switched, so that one buffer area is used to continue receiving subsequent sampling data, and the other buffer area is used to perform data processing operations, thereby realizing the parallel execution of the sampling process and the data processing process.

[0041] It should be noted that by storing the first and second tightening data sequences in segments, the data acquisition of the current tightening process can be avoided when compressing historical sampled data. Specifically, the first tightening data sequence corresponds to the data segment that has already been sampled during the tightening process and can be used as the data object for subsequent compression processing; while the second tightening data sequence corresponds to the data segment that is still in the sampling state, and its sampling integrity needs to be guaranteed first. Therefore, after the first tightening data sequence reaches the data retention threshold, no new sampling points are directly added to the first tightening data sequence. Instead, subsequent sampling data is written to the buffer to decouple historical data processing from real-time data acquisition.

[0042] As can be seen, by using the subsequently sampled industrial tightening data as the second tightening data sequence and caching it after the first tightening data sequence reaches the preset data retention threshold, the microcontroller can continuously acquire high-frequency industrial tightening data under limited storage resources. On the one hand, by temporarily storing real-time sampled data in the buffer, sampling interruption or data loss caused by data compression processing is avoided; on the other hand, by separating historical data from real-time data, a data foundation is provided for subsequent adaptive compression processing of the first tightening data sequence and time-series fusion of the compressed data with the second tightening data sequence, thereby achieving continuous acquisition and efficient processing of industrial tightening data.

[0043] For easier understanding, please refer to Figure 5 , Figure 5This is a schematic diagram of a microprocessor sampling process provided in an embodiment of this application. First, step S501 is executed: tightening starts, and the sequence and buffer are cleared. Specifically, when the industrial tightening tool starts the tightening operation, the microprocessor responds to the tightening start command, initializes the main sequence used to store industrial tightening data and the buffer area, clears historical sampling data, and releases the buffer space, enabling subsequent sampling processes to be executed based on an empty data storage environment. Next, step S502 is executed: the ADC ISR is triggered every 1ms. Specifically, the ADC in the microprocessor works according to a preset sampling period and triggers an interrupt service routine (ISR) once after each sampling period to obtain the industrial tightening data corresponding to the current sampling period. The ADC ISR is triggered every 1ms to ensure that the industrial tightening process data can be continuously acquired according to the preset sampling frequency. Subsequently, step S503 is executed: the step "npt≤M?" is executed. Specifically, the microprocessor obtains the number of sampling points npt in the current main sequence and determines whether the current number of sampling points is less than or equal to the preset capacity M. Here, M represents the maximum number of sampling points that the main sequence can store. When the judgment result is "yes", it means that the current number of sampling points has not reached the preset storage capacity, so continue to execute step S505, execute "add to main queue", that is, directly add the current sampled data to the main queue; when the judgment result is "no", it means that the current main sequence has reached the preset capacity, and further cache processing is required. When the judgment result is "no", execute step S504, "add to active buffer". Specifically, the microprocessor writes the industrial tightening data collected by the ADC into the active buffer that is currently in operation. The active buffer is used to temporarily store subsequent sampling data after exceeding the main sequence capacity, so that the microprocessor can continue to perform real-time sampling operations and avoid sampling interruption due to waiting for data compression processing. Next, execute step S506, execute the "buffer ≥ S?" step. Specifically, the microprocessor detects the number of sampling points in the active buffer in real time and determines whether the current cached data volume has reached the preset cache threshold S. Here, S is used to represent the cache capacity threshold for triggering cache switching and compression task processing. If the judgment result is negative, it means that the current buffer capacity has not yet reached the processing condition. Therefore, continue waiting for the next ADC interrupt trigger and execute step S508, "ISR Return". If the judgment result is positive, it means that the sampled data in the current buffer has met the batch processing condition. Then, execute step S507, "Ping-Pong switch, submit compression task to work queue". Finally, execute step S508, "ISR Return".Specifically, after completing the data processing for the current interrupt cycle, the microprocessor exits the current interrupt service routine and waits for the next ADC sampling cycle to end before triggering the ADC ISR again. Then, it waits for the next interrupt and returns to step S502 to continue executing the industrial tightening data acquisition process.

[0044] As can be seen, this embodiment decouples the real-time sampling process from the data compression process through the data processing method at the microprocessor level. When the main sequence capacity has not reached the preset capacity, the sampled data is directly added to the main sequence for storage; after the main sequence reaches the capacity limit, subsequent sampled data is temporarily stored through an active buffer, and Ping-Pong switching and compression tasks are triggered when the buffer reaches the threshold, thereby avoiding data loss caused by data processing delays during high-frequency sampling and improving the real-time performance and stability of industrial tightening data acquisition.

[0045] In an optional embodiment, the buffer includes a sampling buffer and a processing buffer. Writing the second tightening data sequence into the buffer includes: sequentially writing the sampling points in the second tightening data sequence into the sampling buffer according to the sampling time sequence; when the number of second sampling points in the sampling buffer reaches a preset buffer capacity, switching the sampling buffer to the processing buffer, and writing the industrial tightening data corresponding to the sampling points in the second tightening data sequence other than the second sampling point into the sampling buffer; the second sampling point is the sampling point currently stored in the sampling buffer in the second tightening data sequence; outputting the industrial tightening data corresponding to the second sampling point in the processing buffer to process the second tightening through the microcontroller; and switching the processing buffer to the sampling buffer to continue receiving subsequent sampling points in the second tightening data sequence.

[0046] The system comprises two buffers: a sampling buffer for receiving real-time industrial tightening data during the tightening process and a processing buffer for temporarily storing unprocessed industrial tightening data. These are two independent data storage areas that can switch roles based on the current data acquisition and processing states, forming a dual-buffering mechanism. In some embodiments, the dual-buffering mechanism can employ a Ping-Pong caching method. Simultaneously, one buffer acts as a sampling buffer to receive the second tightening data sequence continuously acquired by the sampling module, while the other acts as a processing buffer to read, output, or compress the already buffered data, thus achieving asynchronous execution between the data acquisition and processing processes. By employing a Ping-Pong mechanism with two alternating sampling buffers and an asynchronous work queue scheduling method, the compression calculation process is decoupled from the sampling interrupt service routine, ensuring the real-time performance of the high-frequency sampling process.

[0047] Specifically, firstly, the microprocessor continuously acquires industrial tightening data at a preset sampling frequency (e.g., 1kHz), and writes the acquired second tightening data sequence sequentially into the sampling buffer currently in the sampling state, according to the sampling time order. The second tightening data sequence can include industrial tightening data acquired after the first tightening data sequence reaches a preset data retention threshold, such as torque data and angle data corresponding to subsequent stages of the tightening process. By prioritizing the writing of subsequently acquired data into the sampling buffer, new sampling data can be continuously received, avoiding sampling interruptions due to waiting for historical data processing. Next, when the number of second sampling points currently stored in the sampling buffer reaches a preset buffer capacity, it is determined that the current sampling buffer has reached the data processing trigger condition, and the functional states of the two buffers are switched. Specifically, the sampling buffer currently storing the second sampling points is switched to the processing buffer, so that the second sampling points in this buffer are output as data to be processed; simultaneously, another idle buffer is switched to a new sampling buffer, and subsequent sampling points in the second tightening data sequence, excluding the second sampling points already stored in the processing buffer, are written into the new sampling buffer. Then, the industrial tightening data corresponding to the second sampling point in the processing buffer is output, and the output data is processed according to a preset data processing flow. This processing may include appending the buffered data to the first tightening data sequence, and performing downsampling compression when the first tightening data sequence exceeds the maximum number of retention points. For example, a work queue thread can acquire buffered data in a low-priority task and merge the buffered data to the end of the main sequence; when the length of the merged sequence exceeds the maximum number of retention points, equal-interval downsampling compression is performed on the historical data, while retaining data from the critical tail stage to reduce data storage pressure. Finally, after the second sampling point in the processing buffer is output, the processing buffer is switched back to a sampling buffer, allowing it to continue receiving subsequent sampling points in the second tightening data sequence. Simultaneously, the original sampling buffer continues to function as a processing buffer after its role change, achieving cyclic switching between the two buffers. Through this method, the microcontroller can continuously complete high-frequency industrial tightening data acquisition under limited storage resources, and reduce resource contention between real-time sampling and data compression processing by alternating buffer operations.

[0048] As can be seen, by setting up sampling and processing buffers and utilizing a dual-buffer switching mechanism, real-time sampling and data compression tasks are executed in different buffer areas, avoiding the problem of sampling process pauses or data loss due to compression processing time. Simultaneously, by combining buffer switching with asynchronous processing, continuous acquisition of high-frequency industrial tightening data can be supported under limited memory conditions. This provides a complete data foundation for subsequent historical data compression, data encapsulation, and upper-computer reconstruction, improving the real-time performance, stability, and data fidelity of industrial tightening process data processing.

[0049] Step S403: Compress the industrial tightening data corresponding to the other sampling points in the first tightening data sequence, excluding the preset reserved sampling points, to obtain the first compressed data.

[0050] The preset retained sampling points represent the key sampling points that need to be prioritized and retained in the first tightening data sequence. The preset retained sampling points can be pre-set according to the data characteristics of the industrial tightening process, the tightening process stage, or the data compression requirements. The first compressed data represents the data set obtained after compressing the first tightening data sequence. The first compressed data can include the industrial tightening data corresponding to the selected and retained target sampling points and the industrial tightening data corresponding to the preset retained sampling points, and retain the sampling position information corresponding to each sampling point to facilitate subsequent recovery and fusion processing of the compressed data according to the sampling time sequence.

[0051] Specifically, a corresponding data compression ratio is determined based on the number of sampling points in the current first tightening data sequence, a preset data retention threshold, and a preset number of retained sampling points. A sampling extraction rule for non-retained sampling points is then generated based on the data compression ratio (e.g., 2:1). The sampling points in the first tightening data sequence may include preset retained sampling points and first sampling points, where the first sampling points are all other sampling points in the first tightening data sequence besides the preset retained sampling points. Further, a target sampling point is determined from the first sampling points according to the sampling extraction rule, and the industrial tightening data corresponding to the target sampling point is retained. For example, the sampling extraction rule may include a sampling interval parameter, a sampling position parameter, and a sampling extraction ratio parameter. The starting extraction position corresponding to the first sampling point is determined based on the sampling position parameter, and the first sampling point is extracted at intervals according to the sampling interval parameter to obtain a candidate sampling point set. Subsequently, the target sampling point is further selected from the candidate sampling point set according to the sampling extraction ratio parameter.

[0052] In one optional implementation, compression can be achieved using an equal-interval downsampling method. Specifically, when the number of sampling points in the first tightened data sequence exceeds the maximum data retention limit, the number of sampling points that need to be reduced can be determined, and an interval extraction operation can be performed on the historical sampling data in the first tightened data sequence. For example, continuous sampling points can be filtered according to a preset extraction ratio, retaining a portion of representative sampling points, downsampling and compressing historical data segments that exceed the storage threshold, while maintaining full resolution for the tail data closest to the current moment, thereby balancing data volume and data fidelity within limited storage space.

[0053] Furthermore, first compressed data is generated based on the industrial tightening data corresponding to the target sampling points and the industrial tightening data corresponding to the preset retained sampling points. Specifically, the target sampling points and the preset retained sampling points can be sorted according to the sampling sequence number corresponding to each sampling point to form a compressed sampling sequence. A correlation is established between the sampling sequence and the original sampling position information of each sampling point, so that the host computer, after receiving the first compressed data, can determine the temporal position of each sampling point in the original tightening process based on the correlation. Thus, by compressing the sampling points other than the preset retained sampling points in the first tightening data sequence, the storage space occupied by historical tightening data is reduced while retaining key data features affecting the tightening quality judgment. This provides a foundation for subsequently generating a complete target tightening data sequence and for the host computer to recover the tightening process curve.

[0054] In an optional embodiment, the step of compressing the industrial tightening data corresponding to other sampling points in the first tightening data sequence, excluding preset reserved sampling points, to obtain first compressed data includes: determining a data compression ratio corresponding to the first tightening data sequence based on the number of sampling points in the first tightening data sequence and the number of reserved sampling points; determining a sampling extraction rule corresponding to a first sampling point in the first tightening data sequence based on the data compression ratio; the sampling extraction rule includes a sampling interval parameter, a sampling position parameter, and a sampling extraction ratio parameter; the first sampling point is a sampling point in the first tightening data sequence excluding the reserved sampling points; determining a target sampling point from the first sampling points according to the sampling extraction rule; and generating the first compressed data based on the industrial tightening data corresponding to the target sampling point and the industrial tightening data corresponding to the reserved sampling points.

[0055] The retained sampling points can be pre-configured sampling points that do not require compression processing. These retained sampling points correspond to key stages of the tightening process, such as data from the tail end near the current sampling moment. Since industrial tightening processes typically involve multiple stages, the torque ramp-up, contact, and holding processes in subsequent stages are highly valuable for judging tightening quality. Therefore, sampling points corresponding to these stages can be used as retained sampling points to maintain the integrity of the data for that stage. In some embodiments, the number of retained sampling points is 200. The first sampling points are other historical sampling points in the first tightening data sequence besides the retained sampling points. The sampling extraction rule is used to determine which sampling points to retain from the first sampling points. The sampling interval parameter represents the sampling distance between adjacent target sampling points, the sampling position parameter represents the starting sampling position when sampling extraction begins, and the sampling extraction ratio parameter represents the proportion of target sampling points extracted from the first sampling points.

[0056] Specifically, firstly, the number of sampling points to be retained in the current first tightening data sequence is determined. Based on the relationship between the current number of sampling points and the number of retained sampling points, the data compression ratio corresponding to the first tightening data sequence is determined to determine the amount of data to be reduced from the first sampling points. The data compression ratio can be dynamically determined based on the ratio between the current data volume and the target retained data volume, ensuring that the compressed data volume meets the preset storage capacity requirements. Next, based on the determined data compression ratio, sampling extraction rules corresponding to the first sampling points are generated. Specifically, the sampling extraction ratio parameter is determined according to the required amount of data to be compressed, and further, the sampling interval parameter and sampling position parameter are determined. The sampling interval parameter controls the extraction interval between the first sampling points, ensuring that the retained data points are evenly distributed in the original data sequence; the sampling position parameter determines the starting position of the extraction operation, ensuring that the sampling extraction process begins at the preset position; and the sampling extraction ratio parameter controls the final target number of retained sampling points. In this way, the compression rules can be dynamically adjusted according to the changes in data volume during different tightening processes, without needing to use a fixed compression ratio for uniform processing of all tightening data.

[0057] Then, the starting extraction position corresponding to the first sampling point is determined according to the sampling position parameter, and the first sampling point is extracted at intervals according to the sampling interval parameter to obtain a candidate sampling point set. Further, the candidate sampling point set is filtered according to the sampling extraction ratio parameter to obtain the final target sampling point to be retained. The target sampling point represents the historical sampling data retained after compression processing. By performing regular extraction on the first sampling point, the overall trend of the original tightening curve can be maintained while reducing the amount of data. Finally, the industrial tightening data corresponding to the target sampling point and the industrial tightening data corresponding to the retained sampling point are combined according to the original sampling time sequence to form the first compressed data. The data corresponding to the historical stage of the target sampling point is used to retain the overall trend of the tightening process; the data corresponding to the key stage of the retained sampling point is used to ensure the integrity of the key process. Thus, the first compressed data can retain important features affecting the judgment of tightening quality while reducing the data storage volume.

[0058] As can be seen, by adaptively determining the data compression ratio based on the data volume of the first tightening data sequence and the number of retained sampling points, and further generating corresponding sampling extraction rules based on the compression ratio, dynamic compression processing for different data scales is achieved. Compared with the existing technology that uses a uniform compression method for all tightening data, this embodiment can appropriately compress historical stage data while completely retaining key stage data in the tightening process, thus balancing data compression efficiency and the fidelity of key process features under limited embedded storage resources. In addition, by adopting a rule-based sampling method based on sampling interval, sampling position, and extraction ratio, the computational complexity of the compression process can be reduced, enabling the compression process to be executed in real time on the microcontroller of the industrial tightening tool, thereby improving the real-time performance and reliability of industrial tightening data processing.

[0059] In an optional embodiment, determining the target sampling point from the first sampling points according to the sampling extraction rule includes: determining the sampling timing position corresponding to the first sampling point; determining the starting extraction position corresponding to the first sampling point according to the sampling position parameter; and, according to the sampling interval parameter and the sampling timing position, performing interval extraction on the first sampling point from the starting extraction position according to a preset sampling interval to obtain a candidate sampling point set; and sampling the candidate sampling point set according to the sampling extraction ratio parameter to obtain the target sampling point.

[0060] Among them, the sampling timing position represents the temporal order of the first sampling point in the first tightening data sequence, which can be represented by the sampling sequence number, sampling timestamp, or sampling index; the starting extraction position represents the initial sampling point position corresponding to the data extraction operation; the sampling interval parameter represents the number of sampling points between two adjacent extracted sampling points; the candidate sampling point set is the set of sampling points initially selected from the first sampling points according to the preset sampling interval; the sampling extraction ratio parameter is used to further control the number of sampling points finally retained from the candidate sampling point set so that the compressed data volume meets the preset storage requirements.

[0061] Specifically, since the first sampling point is any sampling point in the first tightening data sequence other than the retained sampling points, it typically corresponds to historical stage data during the tightening process. To ensure that the compressed data retains the temporal characteristics of the original tightening process, the sampling timing position corresponding to each first sampling point is first determined based on the arrangement order of the first sampling points in the first tightening data sequence, thereby establishing the temporal correlation between each first sampling point. The sampling timing position can be used to subsequently determine the data extraction order and ensure that the extracted target sampling points are still arranged according to the original sampling process. Next, the microcontroller determines the starting extraction position corresponding to the first sampling point based on the pre-determined sampling position parameters. Specifically, the sampling position parameters can be determined based on the data compression ratio, the number of first sampling points, and the preset extraction strategy, specifying from which position in the first sampling points to begin the sampling extraction operation. For example, extraction can start from the first sampling point in the first sampling points, or, depending on compression requirements, some sampling points can be skipped before starting extraction from a specified position. By setting the starting extraction position, the sampling extraction process can have a definite execution starting point, avoiding uneven distribution of compressed data due to random sampling. Then, starting from the determined initial sampling position, the microcontroller sequentially selects the corresponding first sampling points according to the preset sampling interval parameter. For example, when the sampling interval parameter is set to the preset interval value, the microcontroller skips some first sampling points at fixed intervals and uses the first sampling points that meet the interval conditions as candidate sampling points. By adopting an equal-interval sampling method, the candidate sampling points can be evenly distributed on the original tightening process time axis, avoiding excessive retention of local data or excessive data loss. Finally, the candidate sampling point set is filtered according to the sampling extraction ratio parameter to obtain the target sampling points. Specifically, since the number of candidate sampling points obtained according to the sampling interval parameter may still be greater than the amount of data required for the target compression data, the microcontroller further determines the number of target sampling points to be retained from the candidate sampling point set according to the sampling extraction ratio parameter, and performs a secondary filtering of the candidate sampling point set according to the preset filtering rules. For example, it can perform uniform filtering according to the sampling sequence number to obtain target sampling points that meet the compression ratio requirements. Thus, the obtained target sampling points can retain the main changing trend in the first tightening data sequence while reducing the amount of data.

[0062] As can be seen, by combining the sampling time sequence position, the starting extraction position, the sampling interval parameter, and the sampling extraction ratio parameter, multi-level filtering is performed on the first sampling point, achieving regularized downsampling processing for industrial tightening data. Compared to compression methods that simply delete a fixed proportion of data, this embodiment can uniformly extract data based on the original sampling time sequence, ensuring that the compressed data still maintains its temporal correlation with the original tightening process. Furthermore, by further utilizing the sampling extraction ratio parameter for secondary filtering, the final amount of data retained can be flexibly adjusted. While meeting storage capacity limitations, this maximizes the preservation of the changing trends during the tightening process, providing a reliable data foundation for subsequent data restoration on the host computer and tightening curve reconstruction, thus improving the accuracy and reliability of the industrial tightening data compression process.

[0063] In an optional embodiment, generating the first compressed data based on the industrial tightening data corresponding to the target sampling point and the industrial tightening data corresponding to the retained sampling point includes: sorting the target sampling point and the retained sampling point according to the sampling sequence number corresponding to the target sampling point and the sampling sequence number corresponding to the retained sampling point to obtain a sampling sequence; generating a compressed data sequence based on the industrial tightening data corresponding to each sampling point in the sampling sequence; determining the sampling information corresponding to the sampling points in the compressed data sequence and establishing an association between the compressed data sequence and the sampling information; and generating the first compressed data based on the compressed data sequence and the association.

[0064] Among them, the sampling sequence number represents the order in which each sampling point is collected in the first tightening data sequence, and can be used to determine the temporal relationship between different sampling points; the sampling sequence is a data set formed by rearranging the target sampling points and retained sampling points according to the original sampling time sequence; the compressed data sequence is a data set composed of the industrial tightening data corresponding to each sampling point in the sampling sequence, representing the industrial tightening process data after compression processing; the sampling information is used to record the original sampling position corresponding to each sampling point in the compressed data sequence, including the sampling sequence number, sampling time sequence position, or other information that can represent the sampling position; the correlation relationship is used to establish the mapping relationship between the sampling points in the compressed data sequence and their corresponding original sampling positions.

[0065] Specifically, firstly, the sampling sequence numbers corresponding to the target sampling points and the retained sampling points are determined. The target sampling points are historical stage sampling data retained after downsampling in the first tightening data sequence, while the retained sampling points are key stage sampling data that do not require compression. Since the target and retained sampling points originate from different regions in the first tightening data sequence, to ensure that the compressed data still conforms to the time variation pattern of the original tightening process, the target and retained sampling points are uniformly sorted according to their corresponding sampling sequence numbers, so that different types of sampling points are rearranged according to the original acquisition order, resulting in a sampling sequence. Next, according to the arrangement order in the sampling sequence, the industrial tightening data corresponding to each sampling point is read sequentially and combined to form a compressed data sequence. By uniformly combining the data corresponding to the target sampling points and the data corresponding to the retained sampling points, the compressed data can simultaneously contain overall trend information of the tightening process and information on key process stages. Then, based on the sampling sequence number corresponding to each sampling point, sampling position mapping information corresponding to each data item in the compressed data sequence is generated. For example, for target sampling points obtained through interval sampling, their actual sampling positions in the original first tightening data sequence are recorded; for retained sampling points, their corresponding original sampling positions are also recorded. By establishing the above mapping relationship, each sampled data in the compressed data sequence can be mapped to a specific sampling time in the original tightening process. Finally, the compressed data sequence and the corresponding sampling information are encapsulated to form first compressed data containing data content and position mapping information. The first compressed data includes not only the compressed industrial tightening data but also association information describing the original positional relationships of each sampling point. This allows the host computer to receive the first compressed data, determine the timing position of each sampling point based on the association relationship, and further complete subsequent data fusion and tightening curve reconstruction processing. In this way, while reducing the data storage and transmission pressure on the microcontroller, the recoverability and data utilization value of the compressed industrial tightening data are improved.

[0066] For easier understanding, please refer to Figure 6 , Figure 6This is a flowchart illustrating a downsampling compression algorithm provided in an embodiment of this application. First, step S601, "Tasks are retrieved from the work queue," is executed. Specifically, when the buffer in the microprocessor reaches a preset buffer capacity S, the microprocessor submits the corresponding data compression task to the work queue, and the asynchronous work queue retrieves the data compression tasks to be processed according to the task execution order. Next, step S602, "Buffer data is appended to the end of the main sequence," is executed. Specifically, after the work queue retrieves the compression task, it appends the industrial tightening data stored in the current buffer to the end of the main sequence. The main sequence stores the sampling data corresponding to the current tightening process. When new buffer data is added to the main sequence, the length of the main sequence changes as the sampling data increases, so as to determine whether downsampling compression processing is needed later. Then, step S603, "Sequence length > M?", is executed, i.e., determining whether "the sequence length is greater than M?". Specifically, the microprocessor detects the data length of the current main sequence and determines whether the current sequence length has reached the preset capacity M. M represents the number of sampling points that the target data sequence needs to retain after compression processing. If the judgment result is negative, step S606 is executed, "Sequence restored to M, compression complete," indicating that the number of sampling points in the current main sequence has not yet reached the preset capacity, and downsampling compression is not required. The system continues to wait for subsequent cached data to be added to the main sequence. If the judgment result is positive, it indicates that the number of sampling points in the current main sequence has exceeded the preset capacity, and further data compression is required. Further, if the judgment result is positive, step S604 is executed, "Calculate R=LM." Specifically, the microprocessor calculates the amount of data R to be compressed based on the current main sequence length L and the target sequence capacity M. Here, L represents the total number of sampling points in the current main sequence, M represents the number of sampling points to be retained in the compressed target sequence, and R represents the number of data points to be reduced through downsampling. Calculating R determines the required compression level for the current data sequence, providing a basis for determining the downsampling ratio. Then, step S605 is executed, "The first 2R points are extracted at a 2:1 ratio, retaining even-numbered indices; the last T points are retained at full resolution." Specifically, the microprocessor employs different compression strategies for data at different positions in the main sequence based on the calculated data volume R. For the first 2R sampling points of the main sequence, a 2:1 extraction ratio is used, meaning that a portion of the sampling points are selected from consecutive sampling points according to a preset extraction rule, and sampling points corresponding to even-numbered indices are retained, thereby reducing the amount of data at the beginning. For the last T sampling points of the main sequence, a full-resolution retention method is used, and this part of the data is not downsampled. Among them, the last T points correspond to the subsequent stage data in the industrial tightening process. This stage usually contains key change information before and after tightening is completed, so retaining the entire data avoids the loss of key process features. Finally, step S606 is executed, "Sequence restored to M, compression completed".Specifically, after downsampling the front data and retaining the rear data, the microprocessor regenerates the compressed data sequence based on the downsampling results, restoring the length of the compressed sequence to the preset capacity M. The compressed data sequence can then be used for data encapsulation and sent to the host computer for data restoration and tightening curve recovery processing.

[0067] As can be seen, by calculating the amount of data R to be compressed based on the current industrial tightening data sequence length and the target capacity M, and by employing a segmented downsampling strategy to differentiate the data at different locations, adaptive compression of industrial tightening data is achieved. Compared to using a fixed-ratio compression method for all sampled data, this embodiment reduces the amount of data while preserving the data at full resolution for the key tail stages, avoiding the loss of key tightening process features due to compression, and improving the ability of the compressed data to represent the original tightening process.

[0068] Step S404: Generate a target tightening data sequence based on the first compression data and the second tightening data sequence.

[0069] The target tightening data sequence represents the complete tightening process data obtained by recombining the data after data compression. The first compressed data corresponds to the historical sampled data that has been filtered and retained in the first tightening data sequence.

[0070] Specifically, firstly, the sampling position information corresponding to the first compressed data and the sampling start position corresponding to the second tightening data sequence are determined. The sampling position information indicates the sampling timing position of each sampling point in the first compressed data within the original first tightening data sequence, and the sampling start position indicates the corresponding timing position of the first sampling point in the second tightening data sequence throughout the tightening process. Further, the timing connection relationship between the first compressed data and the second tightening data sequence is determined based on the sampling position information and the sampling start position. Since the sampling points in the first compressed data originate from the first tightening data sequence, and the sampling points in the second tightening data sequence originate from the continuous sampling process following the first tightening data sequence, the sequential relationship between the two data sequences can be determined based on the sampling sequence number or sampling timestamp corresponding to each sampling point, and the first compressed data and the second tightening data sequence can be sorted according to the sampling timing. In some embodiments, the microcontroller can add a corresponding original sampling sequence number to each target sampling point in the first compressed data, and simultaneously record continuous sampling sequence numbers for each sampling point in the second tightening data sequence, thereby establishing a unified sampling timing identifier. Subsequently, the sampling points in the first compressed data and the sampling points in the second tightening data sequence are merged and sorted according to the sampling time sequence identifier to obtain a combined tightening data sequence. This combined tightening data sequence is then integrated with the corresponding sampling position information to generate the target tightening data sequence. Furthermore, the target tightening data sequence can serve as the data basis for subsequent data encapsulation and transmission. The microcontroller can package the target tightening data sequence according to a preset data communication protocol, encapsulating the compressed historical sampling data, real-time sampling data, and corresponding sampling position mapping information into the same tightening data packet, and sending it to the host computer. The host computer can then further reconstruct the complete tightening process curve based on the sampling position mapping information.

[0071] As can be seen, by fusing data based on the sampling timing relationship between the first compressed data and the second tightening data sequence, a continuous combination of historical compressed data and real-time uncompressed data can be achieved, avoiding the problem of discontinuous data in the tightening process caused by data compression. Furthermore, this method only compresses non-critical sampling points in the historical data while preserving the current sampling data intact. This reduces the storage pressure and communication load on the microcontroller while ensuring data accuracy during critical stages of the industrial tightening process.

[0072] In an optional embodiment, generating a target tightening data sequence based on the first compressed data and the second tightening data sequence includes: determining sampling position information corresponding to the first compressed data; the sampling position information being the sampling timing position of the plurality of sampling points in the first tightening data sequence; determining the sampling start position corresponding to the second tightening data sequence; the sampling start position being the sampling timing position corresponding to the first sampling point in the second tightening data sequence; determining the timing connection relationship between the first compressed data and the second tightening data sequence based on the sampling position information and the sampling start position; temporally sorting the first compressed data and the second tightening data sequence according to the timing connection relationship to obtain a combined tightening data sequence; and integrating the combined tightening data sequence and the sampling position information to obtain the target tightening data sequence.

[0073] The first compressed data is the data obtained after compressing the first tightening data sequence. It includes industrial tightening data corresponding to the target sampling points after screening and retention, industrial tightening data corresponding to the retained sampling points, and sampling position information characterizing the original positional relationship of each sampling point. The sampling position information indicates the sampling time sequence position of each sampling point in the first compressed data in the original first tightening data sequence. The time sequence connection relationship indicates the data sequence relationship and continuity relationship between the first compressed data and the second tightening data sequence.

[0074] Specifically, firstly, the sampling position information corresponding to the first compressed data is determined. Since some sampling points in the first compressed data have undergone downsampling, the number of sampling points in the first compressed data is less than the number of sampling points in the original first tightening data sequence. To ensure accurate connection between the compressed data and subsequently acquired data, the sampling position information corresponding to each sampling point in the first compressed data is obtained based on the sampling mapping relationship established during the compression process. Next, the microcontroller determines the sampling start position corresponding to the second tightening data sequence. Specifically, since the second tightening data sequence is data acquired after the first tightening data sequence has been acquired, the sampling timing position corresponding to the first sampling point in the second tightening data sequence can serve as a time reference point for connecting the first compressed data and the second tightening data sequence. By determining this sampling start position, the microcontroller can clarify the relative position of the second tightening data sequence within the entire tightening process data and provide a basis for the sorting of the subsequent two data sequences. Then, the microcontroller compares the sampling timing position corresponding to the last valid sampling point in the first compressed data with the sampling start position corresponding to the first sampling point in the second tightening data sequence to determine the order of the two data sequences. For example, when the sampling start position of the second tightening data sequence is after the last sampling point of the first compressed data, the second tightening data sequence is determined to be the subsequent data of the first compressed data and connected in an ascending time direction. Then, the microcontroller rearranges the sampling points in the first compressed data and the sampling points in the second tightening data sequence according to the sampling timing position corresponding to each sampling point, so that the combined data sequence satisfies the time sequence relationship of the original tightening process. The first compressed data represents the data of the preceding stage in the tightening process, and the second tightening data sequence represents the high-precision sampling data of the subsequent stage. By combining the two, a data sequence covering the complete tightening process can be formed. Finally, the combined tightening data sequence and the corresponding sampling position information are encapsulated, so that the target tightening data sequence not only contains data content describing the tightening state but also includes mapping information representing the data's time position. The target tightening data sequence can be further packaged and sent to the host computer, so that the host computer can complete data parsing, timing recovery, and tightening curve reconstruction based on the sampling position information.

[0075] As can be seen, this embodiment establishes a temporal connection between compressed historical data and real-time acquired data by utilizing the sampling position information in the first compressed data and the sampling start position of the second tightening data sequence, thus achieving continuous combination of data from different sampling stages. Compared to directly splicing compressed and uncompressed data, this avoids the problems of lost sampling positions and disordered data temporal relationships caused by data compression, ensuring that the combined target tightening data sequence maintains temporal continuity consistent with the actual tightening process. Simultaneously, by combining compressed data with subsequent high-resolution data, the data storage and transmission pressure is reduced while preserving the data accuracy of key stages, improving the integrity and recoverability of industrial tightening process data.

[0076] Step S405: Pack and encapsulate the target tightening data sequence to obtain a tightening data packet, and send the tightening data packet to the host computer.

[0077] The tightening data packet represents the target tightening data sequence and the corresponding data description information. This allows the host computer to parse the compressed data, real-time sampled data, and sampling location information contained within the tightening data packet after receiving it, and to reconstruct the complete industrial tightening process data based on the parsing results. The data description information may include data type identifiers, data length information, sample quantity information, and sampling location mapping information, which assist the host computer in accurately identifying and processing the target tightening data sequence.

[0078] Specifically, the microcontroller can combine the first compressed data, the second tightening data sequence, and the corresponding sampling position mapping information according to a preset data packet format, and add a data identifier in the data header area to indicate the data packet type, data length, and verification information, forming a complete tightening data packet. In some embodiments, the tightening data packet may include a data header, a data body, and a verification area. The data header records basic information about the current data packet, such as the data packet identifier, data version, and data length; the data body stores the target tightening data sequence, which includes compressed historical sampling data and uncompressed real-time sampling data; the verification area stores data verification information so that the host computer can verify the data integrity after receiving the data packet. Further, the microcontroller can send the tightening data packet to the host computer through the communication module in the industrial tightening tool. The communication module can use wireless or wired communication methods depending on the actual application scenario of the industrial tightening tool, such as Bluetooth, wireless LAN, or serial communication, to achieve data interaction between the microcontroller and the host computer.

[0079] For easier understanding, please refer to Figure 7 , Figure 7This is a schematic diagram of a processing flow for sending tightening data to a host computer, provided by an embodiment of this application. As can be seen, firstly, step S701 is executed to obtain a tightening end signal. Next, step S702 is executed to merge the active buffer and add the remaining data to the main sequence. Specifically, during the tightening process, due to the use of a double-buffered Ping-Pong mechanism for data acquisition and processing, the active buffer may still contain unprocessed remaining sampled data when the tightening end signal is received. The microcontroller reads the remaining industrial tightening data from the active buffer and appends it to the end of the main sequence, ensuring that all sampled data generated during the current tightening process is included in a unified data processing scope. The main sequence stores the buffered and organized industrial tightening data, providing a complete data foundation for subsequent final compression processing. Then, step S703 is executed to perform a final downsampling compression. Specifically, after merging the remaining data, the microcontroller determines whether the amount of data in the current main sequence exceeds the target capacity and performs a final compression process according to a preset downsampling compression rule. The downsampling compression process determines the corresponding data extraction ratio based on the current data length and the target amount of data to retain. Downsampling is performed on non-critical stage data while retaining critical stage data during tightening, thus reducing the final amount of data sent. After the final downsampling compression, a target tightening data sequence for transmission to the host computer is obtained. Further, step S704, Protobuf encapsulation and Q15 dual-value packaging of torque and angle, is executed. Specifically, the microcontroller encapsulates the downsampling compressed target tightening data sequence according to a preset data format. Protobuf encapsulation is used for structured data encapsulation to reduce overhead during data transmission. Simultaneously, Q15 dual-value packaging is used to encode the torque and angle data during industrial tightening, combining and storing the two parameters according to a preset format to increase the proportion of effective data in a single data packet and further reduce communication transmission pressure. Finally, step S705, PRC transmission to the host computer, is executed. Specifically, the microcontroller sends the encapsulated tightening data packet to the host computer through a preset communication interface. The communication interface can include serial port, wireless communication interface, etc. After the host computer receives the tightening data packet, it can further perform data unpacking, symmetrical downsampling restoration, linear interpolation completion, and tightening curve output to restore the complete industrial tightening process curve.

[0080] It can be seen that by uniformly organizing the remaining data in the active buffer after tightening and performing a final downsampling compression process, all data generated during the entire tightening process can participate in compression and transmission, avoiding data loss issues caused by unprocessed cached data at the end of tightening. Simultaneously, by using Protobuf packetization and Q15 dual-value packaging of torque and angle data, the amount of data transmitted can be reduced while ensuring data validity, thus improving the efficiency of industrial tightening data transmission.

[0081] With the above Figure 4 If consistent, please see Figure 8 , Figure 8 This is a flowchart illustrating another method for processing industrial tightening data provided in this application embodiment. The method is applied to a host computer in an industrial tightening tool, the host computer being communicatively connected to a microcontroller. The method specifically includes the following steps: S801, Receive the tightening data packet sent by the microcontroller; S802. The tightening data packet is parsed to obtain first parsed data, second parsed data, and sampling position mapping information; the first parsed data corresponds to the tightening data sequence after being compressed by the microcontroller, the second parsed data corresponds to the uncompressed tightening data sequence cached by the microcontroller, and the sampling position mapping information represents the sampling timing position corresponding to each sampling point in the first parsed data; S803. Determine the first time sequence position corresponding to the sampling point in the first parsed data according to the sampling position mapping information, and determine the second time sequence position according to the sampling order corresponding to the sampling point in the second parsed data; S804. Perform time-series fusion of the first parsed data and the second parsed data according to the first time sequence position and the second time sequence position to obtain a third tightening data sequence; S805. Determine the temporal relationship between adjacent sampling points in the third tightening data sequence; and determine the missing sampling position information in the third tightening data sequence. S806. Based on the time sequence relationship, interpolate and compensate for the missing sampling position information to obtain the tightening process curve of the industrial tightening tool.

[0082] The first parsed data is a compressed tightening data sequence obtained after parsing the tightening data packet. The first parsed data corresponds to the data obtained after the microcontroller performs compression processing on the first tightening data sequence. The first parsed data includes industrial tightening data corresponding to the target sampling points that have been filtered and retained, industrial tightening data corresponding to the retained sampling points, and corresponding sampling position mapping information. The second parsed data is an uncompressed tightening data sequence cached by the microcontroller, corresponding to the industrial tightening data obtained after the first tightening data sequence, used to retain high-precision sampling data in the subsequent stages of the tightening process. The sampling position mapping information represents the sampling time sequence position of each sampling point in the first parsed data in the original tightening data sequence. The third tightening data sequence is a data sequence obtained after time-series fusion of the first parsed data and the second parsed data, representing the complete sampling data in the industrial tightening process. The missing sampling position information is used to indicate the missing sampling positions in the third tightening data sequence due to compressed sampling.

[0083] Specifically, firstly, the host computer receives a tightening data packet sent by the microcontroller in the industrial tightening tool. This tightening data packet is data obtained by the microcontroller after packaging and encapsulating a target tightening data sequence, which includes compressed first data and a second tightening data sequence. Next, the host computer parses the received tightening data packet to obtain first parsed data, second parsed data, and sampling position mapping information. Then, the host computer determines the first time-series position corresponding to each sampling point in the first parsed data based on the sampling position mapping information, and determines the second time-series position based on the sampling order of each sampling point in the second parsed data. Specifically, for the first parsed data, since it has undergone downsampling and compression, some original sampling points have been deleted. Therefore, the host computer needs to determine the original sampling position corresponding to the currently retained sampling point based on the sampling position mapping information to obtain the first time-series position. For the second parsed data, since it is continuously acquired uncompressed data, the host computer can determine the second time-series position based on the arrangement order of each sampling point in the second parsed data. By determining the first and second time-series positions respectively, a temporal correspondence between compressed and uncompressed data can be established. Further, based on the time-series positions corresponding to each sampling point, the sampling points in the first and second analytical data are uniformly sorted, arranging data from different sources according to the sampling order during the actual tightening process. For example, the first analytical data corresponds to the compressed data in the preceding stage of the tightening process, and the second analytical data corresponds to the complete sampling data in the subsequent stage. The host computer can connect the two parts of data into a continuous data sequence through time-series fusion, thereby avoiding data time discontinuities caused by compression processing. Then, the host computer determines the temporal relationship between adjacent sampling points in the third tightening data sequence and determines the missing sampling position information in the third tightening data sequence. Specifically, since some sampling points in the first analytical data have undergone downsampling processing, there may be one or more unretained original sampling positions between adjacent retained sampling points. Therefore, the host computer can determine whether there are missing sampling positions between adjacent sampling points based on the differences in the time-series positions corresponding to adjacent sampling points and determine the corresponding missing sampling position information. The missing sampling position information is used to indicate the positions where data compensation is required. Finally, based on the changing trends of industrial tightening data corresponding to existing sampling points on both sides of the missing sampling location, the data corresponding to the missing location is estimated, and the compensated sampling data is inserted into the third tightening data sequence, thereby recovering more complete tightening process data. Through the above processing, the host computer can recover a tightening process curve that approximates the original high-frequency sampling effect based on the limited transmitted data.

[0084] As can be seen, this embodiment achieves complete recovery of the industrial tightening process curve by combining sampling position mapping information on the host computer side, performing time-series fusion of compressed tightening data and uncompressed tightening data, and interpolating to compensate for missing sampling positions generated during the compression process.

[0085] For easier understanding, please refer to Figure 9 , Figure 9This is a schematic diagram of a data restoration process provided by an embodiment of this application. As can be seen, firstly, step S901 is executed to receive a Protobuf message. Specifically, the host computer receives a tightening data message encapsulated in Protobuf format sent by the microcontroller through a preset communication interface. The Protobuf message is a data packet obtained by the microcontroller after performing downsampling and compression processing, and then structurally encapsulating the target tightening data sequence. The Protobuf message may include compressed tightening data, sampling parameter information, and metadata information used to assist in data restoration, so that the host computer can perform subsequent parsing processing based on the message content. Next, step S902 is executed to display metadata, namely fs, npt, M, T, and full-scale torque. Specifically, the host computer parses the received Protobuf message to obtain the metadata carried within it. Where fs represents the sampling frequency of the industrial tightening data, npt represents the number of sampling points in the current tightening data sequence, M represents the capacity parameter of the compressed target data sequence, T represents the number of data points retained at full resolution at the end, and torque full scale represents the maximum measurement range corresponding to the torque data. Then, step S903 is executed, torque Q15 unpacking (32 bits split into 2 × 16 bits). Specifically, the host computer unpacks the torque data in the Protobuf message according to the preset data encapsulation format. Since the microcontroller uses Q15 dual-value packing to encode the torque and angle data in the industrial tightening process, the host computer needs to split the received 32-bit data into two 16-bit data according to the preset rules to obtain the corresponding torque data and angle data respectively. Further, the host computer performs a proportional conversion on the unpacked data according to the torque full scale parameter to restore the torque parameter corresponding to the actual physical quantity. Further, step S904 is executed, parsing the angle sequence and constructing the time sequence 1…npt (ms). Specifically, the host computer parses the unpacked angle data sequence and determines the sampling time position corresponding to each sampling point based on the sampling frequency fs and the number of sampling points npt, thereby constructing a corresponding time series. The time series represents the occurrence time of each sampling point during the industrial tightening process; for example, time markers corresponding to 1ms, 2ms, 3ms…npt(ms) are generated sequentially according to the sampling period. By constructing the time series, a correspondence between tightening data values ​​and sampling times can be established, providing a time reference for subsequent symmetrical downsampling reconstruction and compensation for missing sampling positions.

[0086] As can be seen, this embodiment parses the Protobuf messages sent by the microcontroller through a host computer, and uses the metadata, Q15 encoded data, and sampling parameters in the messages to complete the initial recovery of the compressed data, realizing the conversion of compressed data from binary transmission format to a data sequence with time correlation. Compared with the method of directly transmitting complete high-frequency sampled data, this embodiment can complete effective data recovery using compressed data packets. While reducing the amount of communication data, it ensures the accuracy of the data restoration process through metadata such as sampling frequency, number of sampling points, and number of retained points.

[0087] In an optional embodiment, the step of temporally fusing the first parsed data and the second parsed data according to the first temporal position and the second temporal position to obtain a third tightening data sequence includes: adding a temporal identifier to the sampling points in the first parsed data according to the first temporal position to obtain a first temporal identifier; adding a temporal identifier to each sampling point in the second parsed data according to the second temporal position to obtain a second temporal identifier; determining the sampling point temporal relationship between the sampling points in the first parsed data and the sampling points in the second parsed data according to the first temporal identifier and the second temporal identifier; merging and sorting the sampling points in the first parsed data and the sampling points in the second parsed data according to the sampling point temporal relationship to obtain a fused data sequence; determining whether the target temporal identifiers corresponding to adjacent sampling points in the fused data sequence are continuous; if the target temporal identifiers are not continuous, adjusting the arrangement order of the sampling points in the fused data sequence to obtain the third tightening data sequence; if the target temporal identifiers are continuous, using the fused data sequence as the third tightening data sequence.

[0088] Wherein, the first time sequence identifier is the identifier information generated based on the first time sequence position, representing the original sampling position of each sampling point in the first analytical data; the second time sequence identifier is the identifier information generated based on the second time sequence position, representing the sampling order of each sampling point in the second analytical data; the first time sequence is the first analytical data after adding the first time sequence identifier, used to describe the time relationship corresponding to the historical tightening data after compression processing; the second time sequence identifier is the second analytical data after adding the second time sequence identifier, used to describe the time relationship corresponding to the uncompressed tightening data; the sampling point time sequence relationship is used to represent the sequential relationship between the sampling points in the first analytical data and the sampling points in the second analytical data according to the actual tightening process.

[0089] Specifically, firstly, the host computer adds a corresponding timing identifier to each sampling point in the first parsed data according to the first timing position, thus obtaining the first timing identifier. Since the first parsed data is a compressed tightening data sequence, some original sampling points are extracted according to a preset sampling rule; therefore, adjacent sampling points in the first parsed data may not be sampled consecutively. To accurately determine the actual position of each sampling point during the original tightening process, the host computer adds a corresponding first timing identifier to each sampling point in the first parsed data based on the sampling position mapping information sent by the microcontroller, enabling the sampling points in the first parsed data to be associated with their corresponding sampling positions in the original first tightening data sequence. Next, the host computer determines the corresponding sampling timing position based on the arrangement order of each sampling point in the second parsed data and adds a second timing identifier to each sampling point. Then, the host computer compares the first timing identifiers corresponding to each sampling point in the first parsed data with the second timing identifiers corresponding to each sampling point in the second parsed data to determine the sequential relationship of each sampling point throughout the tightening process. For example, if the time signature corresponding to the last sampling point in the first parsed data is smaller than the time signature corresponding to the first sampling point in the second parsed data, then the sampling stage corresponding to the second parsed data is determined to be after the first parsed data. This method avoids temporal order confusion caused by different data sources. Further, the host computer sorts the sampling points according to the size of their corresponding time signatures, interleaving the sampling points in the first and second parsed data according to their actual sampling times, thus forming a fused data sequence including compressed historical data and subsequent complete data. Then, the host computer sequentially detects the time signature differences between adjacent sampling points in the fused data sequence to determine whether the current sampling point arrangement conforms to a preset time continuity relationship. When the time signatures between adjacent sampling points satisfy the continuity relationship, it indicates that the first and second parsed data have been fused in the correct time order; when there are abnormal jumps or disordered sequences between adjacent sampling points, it indicates that there is an error in the sampling point arrangement in the current fused data sequence. Finally, when a discontinuity in the target timing identifier is detected in the fused data sequence, the host computer adjusts the arrangement order of the sampling points in the fused data sequence according to the correspondence between the timing identifiers, restoring the correct time relationship between adjacent sampling points and obtaining the third tightening data sequence. When a continuous target timing identifier is detected in the fused data sequence, the fused data sequence is directly used as the third tightening data sequence. In this way, it can be ensured that the sampling points in the third tightening data sequence are arranged according to the sampling time of the actual industrial tightening process, providing an accurate data basis for subsequent determination of missing sampling positions and interpolation compensation.

[0090] For easier understanding, please refer to Figure 10 , Figure 10This is a flowchart illustrating the process of constructing a tightening process curve using a host computer, as provided in this application embodiment. First, step S1001 is executed, parsing the packet data (from the data packet). Specifically, the host computer receives the tightening data packet sent by the microcontroller and parses it according to a preset data encapsulation format to obtain the tightening data and corresponding auxiliary information contained within. Next, step S1002 is executed, performing symmetrical downsampling restoration using the same algorithm as the embedded end. Specifically, the host computer performs data restoration processing using the same downsampling rules as the embedded end, based on the compression parameters obtained from the data packet. Since the embedded end uses a preset downsampling strategy during data compression, such as extracting preceding data at a preset ratio and retaining the data at full resolution for the tail key stage, the host computer performs position mapping and sequence recovery on the compressed data points according to the same algorithm rules to determine the corresponding position of each retained sampling point in the original tightening data sequence. Then, step S1003 is executed, using linear interpolation to fill the gaps between sampling points. Specifically, after completing the symmetrical downsampling restoration, the host computer detects whether there are missing sampling positions between adjacent sampling points in the restored data sequence. When a sampling interval is detected between adjacent sampling points, the data value corresponding to the missing position is calculated using linear interpolation based on the torque data, angle data, and time interval relationship corresponding to the adjacent sampling points. The calculated compensation data is then inserted into the corresponding sampling position to form a continuous data sequence. Further, step S1004 is executed to read the step results: Pean_torque, final_torque, final_angle, and cumulative angle. Specifically, after completing the data restoration and interpolation compensation, the host computer reads and parses the restored tightening data to obtain the step result data of the tightening process. Among them, Pean_torque is used to represent the peak torque information during the tightening process, final_torque is used to represent the final torque result, final_angle is used to represent the final angle result, and cumulative angle is used to represent the cumulative value of angle change during the tightening process. Subsequently, step S1005 is executed to force-inject key points and write them overwritten according to the original timestamp. Specifically, to avoid data loss of key process nodes during downsampling and compression, the host computer re-injects key sampling points into the restored data sequence according to their original timestamps, based on pre-reserved key point information. These key points can include peak torque points during tightening, final tightening state points, and other process nodes requiring high-precision retention. Finally, step S1006 is executed to output the complete restored curve, which represents the relationship between time, torque, and angle. Specifically, the host computer converts the complete data sequence after downsampling restoration, interpolation compensation, and key point injection into a tightening process curve and outputs the corresponding relationship between time, torque, and angle.The complete restoration curve reflects the trends of torque and angle changes over time during industrial tightening, which is used for subsequent tightening quality analysis, process judgment, and production process traceability. This ensures that key process node data retains their original time positions, improving the consistency between the restoration curve and the actual tightening process.

[0091] It is evident that by implementing the aforementioned method for processing industrial tightening data, the problem of high sampling rate generating sampling data far exceeding the memory's capacity can be solved in scenarios where embedded memory and transmission bandwidth are limited in industrial tightening tools. This leads to existing solutions reducing sampling frequency or shortening recording time, resulting in the loss of transient characteristics in key process stages such as torque ramp-up, bonding, and holding. Furthermore, it fails to prioritize the protection of data from the tail stage, which is most critical for quality assessment, easily causing time axis misalignment of sampling points in the restoration curve and shifts in key process characteristics, thereby affecting the accuracy of tightening quality assessment.

[0092] The above primarily describes the solutions of the embodiments of this application from the perspective of the method execution process. It is understood that, in order to achieve the above functions, industrial tightening tools include corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments provided herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0093] This application embodiment can divide industrial tightening tools into functional units based on the above method example. For example, each function can be divided into separate functional units, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.

[0094] When dividing each function into modules according to its corresponding function. Figure 11 A functional module block diagram of an industrial tightening data processing device provided in this application embodiment, applied to a microcontroller in an industrial tightening tool, the industrial tightening data processing device 1100 includes: Sampling module 1110 is used to acquire a first tightening data sequence during the tightening process; the first tightening data sequence includes industrial tightening data collected from multiple sampling points; when the number of sampling points in the first tightening data sequence is greater than or equal to a preset data retention threshold, the industrial tightening data sampled after the first tightening data sequence is used as a second tightening data sequence, and the second tightening data sequence is written into the buffer area. Compression module 1120 is used to compress the industrial tightening data corresponding to other sampling points in the first tightening data sequence, excluding the preset reserved sampling points, to obtain the first compressed data. The generation module 1130 is used to generate a target tightening data sequence based on the first compression data and the second tightening data sequence; The sending module 1140 is used to package and encapsulate the target tightening data sequence to obtain a tightening data packet, and send the tightening data packet to the host computer.

[0095] In an optional embodiment, the compression module 1120, in compressing the industrial tightening data corresponding to the sampling points other than the preset reserved sampling points in the first tightening data sequence to obtain the first compressed data, is specifically used for: The data compression ratio corresponding to the first tightening data sequence is determined based on the number of sampling points in the first tightening data sequence and the number of retained sampling points; The sampling extraction rule corresponding to the first sampling point in the first tightening data sequence is determined according to the data compression ratio; the sampling extraction rule includes a sampling interval parameter, a sampling position parameter, and a sampling extraction ratio parameter; the first sampling point is the sampling point in the first tightening data sequence other than the reserved sampling point; The target sampling point is determined from the first sampling point according to the sampling extraction rule; The first compression data is generated based on the industrial tightening data corresponding to the target sampling point and the industrial tightening data corresponding to the retained sampling point.

[0096] In an optional embodiment, the compression module 1120, in determining the target sampling point from the first sampling point according to the sampling extraction rule, is specifically configured to: Determine the sampling timing position corresponding to the first sampling point; The starting sampling position corresponding to the first sampling point is determined according to the sampling position parameter; and the first sampling point is sampled at intervals from the starting sampling position according to the sampling interval parameter and the sampling timing position, so as to obtain a set of candidate sampling points. The candidate sampling point set is sampled according to the sampling extraction ratio parameter to obtain the target sampling point.

[0097] In an optional embodiment, the compression module 1120 generates the first compressed data based on the industrial tightening data corresponding to the target sampling point and the industrial tightening data corresponding to the retained sampling point, including: The target sampling points and the retained sampling points are sorted according to the sampling sequence number corresponding to the target sampling points and the sampling sequence number corresponding to the retained sampling points to obtain a sampling sequence; A compressed data sequence is generated based on the industrial tightening data corresponding to each sampling point in the sampling sequence; Determine the sampling information corresponding to the sampling points in the compressed data sequence, and establish the association between the compressed data sequence and the sampling information; The first compressed data is generated based on the compressed data sequence and the correlation.

[0098] In an optional embodiment, the buffer includes a sampling buffer and a processing buffer; the sampling module 1110, in writing the second tightening data sequence into the buffer, is specifically used for: The sampling points in the second tightening data sequence are written into the sampling buffer in sequence according to the sampling time order; When the number of second sampling points in the sampling buffer reaches the preset buffer capacity, the sampling buffer is switched to the processing buffer, and the industrial tightening data corresponding to the sampling points other than the second sampling point in the second tightening data sequence is written into the sampling buffer; the second sampling point is the sampling point currently stored in the sampling buffer in the second tightening data sequence; The industrial tightening data corresponding to the second sampling point in the processing buffer is output to process the second tightening by the microcontroller; and the processing buffer is switched to the sampling buffer to continue receiving subsequent sampling points in the second tightening data sequence.

[0099] In an optional embodiment, the generation module 1130, in generating the target tightening data sequence based on the first compression data and the second tightening data sequence, is specifically configured to: Determine the sampling position information corresponding to the first compressed data; the sampling position information is the sampling timing position of the plurality of sampling points in the first tightening data sequence; Determine the sampling start position corresponding to the second tightening data sequence; the sampling start position is the sampling timing position corresponding to the first sampling point in the second tightening data sequence. The temporal connection relationship between the first compression data and the second tightening data sequence is determined based on the sampling location information and the sampling start position. Based on the temporal connection relationship, the first compressed data and the second tightening data sequence are temporally sorted to obtain a combined tightening data sequence; The combined tightening data sequence and the sampling position information are integrated to obtain the target tightening data sequence.

[0100] With the above Figure 11 For embodiments consistent with those described above, please continue reading. Figure 12 , Figure 12 This is a functional module block diagram of another industrial tightening data processing device provided in this application embodiment, applied to a host computer in an industrial tightening tool. The host computer is communicatively connected to a microcontroller. The industrial tightening data processing device 1200 includes: Receiver module 1210 is used to receive tightening data packets sent by the microcontroller; The parsing module 1220 is used to parse the tightening data packet to obtain first parsed data, second parsed data, and sampling position mapping information; the first parsed data corresponds to the tightening data sequence after being compressed by the microcontroller, the second parsed data corresponds to the uncompressed tightening data sequence cached by the microcontroller, and the sampling position mapping information represents the sampling timing position corresponding to each sampling point in the first parsed data; Control module 1230 is configured to: determine a first temporal position corresponding to a sampling point in the first parsed data based on the sampling position mapping information; determine a second temporal position based on the sampling order corresponding to a sampling point in the second parsed data; perform temporal fusion on the first parsed data and the second parsed data based on the first temporal position and the second temporal position to obtain a third tightening data sequence; determine the temporal relationship between adjacent sampling points in the third tightening data sequence; and determine missing sampling position information in the third tightening data sequence. The output module 1240 is used to interpolate and compensate for the missing sampling position information according to the time sequence relationship to obtain the tightening process curve of the industrial tightening tool.

[0101] In an optional embodiment, the control module 1230, in the aspect of performing time-series fusion of the first parsed data and the second parsed data according to the first time-series position and the second time-series position to obtain the third tightening data sequence, is specifically used for: A time sequence identifier is added to the sampling points in the first parsed data according to the first time sequence position to obtain a first time sequence identifier; and a time sequence identifier is added to each sampling point in the second parsed data according to the second time sequence position to obtain a second time sequence identifier. The sampling point timing relationship between the sampling points in the first parsed data and the sampling points in the second parsed data is determined based on the first timing identifier and the second timing identifier; According to the temporal relationship of the sampling points, the sampling points in the first parsed data and the sampling points in the second parsed data are merged and sorted to obtain a fused data sequence; Determine whether the target time sequence identifiers corresponding to adjacent sampling points in the fused data sequence are continuous; If the target time sequence identifier is not continuous, the order of sampling points in the fused data sequence is adjusted to obtain the third tightening data sequence; If the target time sequence identifiers are continuous, then the fused data sequence is used as the third tightening data sequence.

[0102] As can be seen, the industrial tightening data processing device provided in the embodiment retains the subsequent second tightening data sequence completely in the buffer without compression after the number of sampling points reaches the data retention threshold. Only the non-retained sampling points in the previous data are compressed, thus protecting the data that is crucial for quality judgment in the later stages of the tightening process. At the same time, the preset retained sampling points in the first tightening data sequence enable the receiving end to accurately align the compressed sampling points when reconstructing the curve. This helps to maintain the timing accuracy and waveform fidelity of the restored curve under conditions of limited embedded memory and transmission bandwidth, thereby improving the accuracy of tightening quality judgment.

[0103] This application also provides a computer-readable storage medium storing a computer program for electronic data interchange that causes a computer to perform some or all of the steps of any of the methods described in the above method embodiments, wherein the computer-readable storage medium includes an industrial tightening tool.

[0104] This application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments.

[0105] It should be noted that, for the sake of simplicity, the above embodiments are all described as a series of actions. Those skilled in the art should understand that this application is not limited to the described order of actions, as some steps in the embodiments of this application can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions, steps, modules, or units involved are not necessarily essential to the embodiments of this application.

[0106] In the above embodiments, the descriptions of each embodiment in this application have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0107] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0108] The steps of the methods or algorithms described in the embodiments of this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in RAM, flash memory, ROM, EPROM, electrically erasable programmable read-only memory (EEPROM), registers, hard disk, portable hard disk, read-only optical disk (CD-ROM), or any other form of storage medium well known in the art. Those skilled in the art should recognize that, in one or more of the above examples, the functions described in the embodiments of this application can be implemented entirely or partially by software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented entirely or partially in the form of a computer program product. The modules / units included in the various devices and products described in the above embodiments can be software modules / units, hardware modules / units, or a combination of both.

[0109] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the embodiments of this application. It should be understood that the above descriptions are merely specific embodiments of the embodiments of this application and are not intended to limit the protection scope of the embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solutions of the embodiments of this application should be included within the protection scope of the embodiments of this application.

Claims

1. A method for processing industrial tightening data, characterized in that, A microcontroller used in industrial tightening tools, the method comprising: Acquire a first tightening data sequence during the tightening process; the first tightening data sequence includes industrial tightening data collected from multiple sampling points; When the number of sampling points in the first tightening data sequence is greater than or equal to the preset data retention threshold, the industrial tightening data sampled after the first tightening data sequence is used as the second tightening data sequence, and the second tightening data sequence is written into the buffer area. The industrial tightening data corresponding to the other sampling points in the first tightening data sequence, excluding the preset reserved sampling points, are compressed to obtain the first compressed data. A target tightening data sequence is generated based on the first compression data and the second tightening data sequence; The target tightening data sequence is packaged and encapsulated to obtain a tightening data packet, which is then sent to the host computer.

2. The method as described in claim 1, characterized in that, The first compressed data is obtained by compressing the industrial tightening data corresponding to the sampling points other than the preset reserved sampling points in the first tightening data sequence, including: The data compression ratio corresponding to the first tightening data sequence is determined based on the number of sampling points in the first tightening data sequence and the number of retained sampling points; The sampling extraction rule corresponding to the first sampling point in the first tightening data sequence is determined according to the data compression ratio; the sampling extraction rule includes a sampling interval parameter, a sampling position parameter, and a sampling extraction ratio parameter; the first sampling point is the sampling point in the first tightening data sequence other than the reserved sampling point; The target sampling point is determined from the first sampling point according to the sampling extraction rule; The first compression data is generated based on the industrial tightening data corresponding to the target sampling point and the industrial tightening data corresponding to the retained sampling point.

3. The method as described in claim 2, characterized in that, The step of determining the target sampling point from the first sampling point according to the sampling extraction rule includes: Determine the sampling timing position corresponding to the first sampling point; The starting sampling position corresponding to the first sampling point is determined according to the sampling position parameter; and the first sampling point is sampled at intervals from the starting sampling position according to the sampling interval parameter and the sampling timing position, so as to obtain a set of candidate sampling points. The candidate sampling point set is sampled according to the sampling extraction ratio parameter to obtain the target sampling point.

4. The method as described in claim 2, characterized in that, The step of generating the first compression data based on the industrial tightening data corresponding to the target sampling point and the industrial tightening data corresponding to the retained sampling point includes: The target sampling points and the retained sampling points are sorted according to the sampling sequence number corresponding to the target sampling points and the sampling sequence number corresponding to the retained sampling points to obtain a sampling sequence; A compressed data sequence is generated based on the industrial tightening data corresponding to each sampling point in the sampling sequence; Determine the sampling information corresponding to the sampling points in the compressed data sequence, and establish the association between the compressed data sequence and the sampling information; The first compressed data is generated based on the compressed data sequence and the correlation.

5. The method according to any one of claims 1-4, characterized in that, The buffer includes a sampling buffer and a processing buffer. Writing the second tightened data sequence into the buffer includes: The sampling points in the second tightening data sequence are written into the sampling buffer in sequence according to the sampling time order; When the number of second sampling points in the sampling buffer reaches the preset buffer capacity, the sampling buffer is switched to the processing buffer, and the industrial tightening data corresponding to the sampling points other than the second sampling point in the second tightening data sequence is written into the sampling buffer; the second sampling point is the sampling point currently stored in the sampling buffer in the second tightening data sequence; The industrial tightening data corresponding to the second sampling point in the processing buffer is output to process the second tightening by the microcontroller; and the processing buffer is switched to the sampling buffer to continue receiving subsequent sampling points in the second tightening data sequence.

6. The method according to any one of claims 1-4, characterized in that, The step of generating a target tightening data sequence based on the first compression data and the second tightening data sequence includes: Determine the sampling position information corresponding to the first compressed data; the sampling position information is the sampling timing position of the plurality of sampling points in the first tightening data sequence; Determine the sampling start position corresponding to the second tightening data sequence; the sampling start position is the sampling timing position corresponding to the first sampling point in the second tightening data sequence. The temporal connection relationship between the first compression data and the second tightening data sequence is determined based on the sampling location information and the sampling start position. Based on the temporal connection relationship, the first compressed data and the second tightening data sequence are temporally sorted to obtain a combined tightening data sequence; The combined tightening data sequence and the sampling position information are integrated to obtain the target tightening data sequence.

7. A method for processing industrial tightening data, characterized in that, A host computer used in industrial tightening tools, wherein the host computer is communicatively connected to a microcontroller, the method comprising: Receive the tightening data packet sent by the microcontroller; The tightening data packet is parsed to obtain first parsed data, second parsed data, and sampling position mapping information; the first parsed data corresponds to the tightening data sequence after being compressed by the microcontroller, the second parsed data corresponds to the uncompressed tightening data sequence cached by the microcontroller, and the sampling position mapping information represents the sampling timing position corresponding to each sampling point in the first parsed data; The first temporal position corresponding to the sampling point in the first parsed data is determined according to the sampling position mapping information, and the second temporal position is determined according to the sampling order corresponding to the sampling point in the second parsed data. Based on the first time sequence position and the second time sequence position, the first parsed data and the second parsed data are fused in time sequence to obtain the third tightening data sequence; Determine the temporal relationship between adjacent sampling points in the third tightening data sequence; and determine the missing sampling location information in the third tightening data sequence; Based on the time sequence relationship, interpolation compensation is performed on the missing sampling location information to obtain the tightening process curve of the industrial tightening tool.

8. The method as described in claim 7, characterized in that, The step of performing time-series fusion of the first parsed data and the second parsed data according to the first time-series position and the second time-series position to obtain the third tightening data sequence includes: A time sequence identifier is added to the sampling points in the first parsed data according to the first time sequence position to obtain a first time sequence identifier; and a time sequence identifier is added to each sampling point in the second parsed data according to the second time sequence position to obtain a second time sequence identifier. The sampling point timing relationship between the sampling points in the first parsed data and the sampling points in the second parsed data is determined based on the first timing identifier and the second timing identifier; According to the temporal relationship of the sampling points, the sampling points in the first parsed data and the sampling points in the second parsed data are merged and sorted to obtain a fused data sequence; Determine whether the target time sequence identifiers corresponding to adjacent sampling points in the fused data sequence are continuous; If the target time sequence identifier is not continuous, the order of sampling points in the fused data sequence is adjusted to obtain the third tightening data sequence; If the target time sequence identifiers are continuous, then the fused data sequence is used as the third tightening data sequence.

9. A processing device for industrial tightening data, characterized in that, A microcontroller used in industrial tightening tools, the device comprising: The sampling module is used to acquire a first tightening data sequence during the tightening process; the first tightening data sequence includes industrial tightening data collected from multiple sampling points; when the number of sampling points in the first tightening data sequence is greater than or equal to a preset data retention threshold, the industrial tightening data sampled after the first tightening data sequence is used as a second tightening data sequence, and the second tightening data sequence is written into the buffer area. The compression module is used to compress the industrial tightening data corresponding to other sampling points in the first tightening data sequence, excluding the preset reserved sampling points, to obtain the first compressed data. A generation module is used to generate a target tightening data sequence based on the first compression data and the second tightening data sequence; The sending module is used to package and encapsulate the target tightening data sequence to obtain a tightening data packet, and send the tightening data packet to the host computer.

10. A processing device for industrial tightening data, characterized in that, A host computer used in industrial tightening tools, the host computer being communicatively connected to a microcontroller, the device comprising: A receiving module is used to receive tightening data packets sent by the microcontroller; The parsing module is used to parse the tightening data packet to obtain first parsed data, second parsed data, and sampling position mapping information; the first parsed data corresponds to the tightening data sequence after being compressed by the microcontroller, the second parsed data corresponds to the uncompressed tightening data sequence cached by the microcontroller, and the sampling position mapping information represents the sampling timing position corresponding to each sampling point in the first parsed data; The control module is configured to: determine a first temporal position corresponding to a sampling point in the first parsed data based on the sampling position mapping information; determine a second temporal position based on the sampling order corresponding to a sampling point in the second parsed data; perform temporal fusion on the first parsed data and the second parsed data based on the first temporal position and the second temporal position to obtain a third tightening data sequence; determine the temporal relationship between adjacent sampling points in the third tightening data sequence; and determine missing sampling position information in the third tightening data sequence. The output module is used to interpolate and compensate for the missing sampling position information according to the time sequence relationship to obtain the tightening process curve of the industrial tightening tool.