Robot teaching data asynchronous recording method and system based on double-process shared memory, medium and device

CN122802703APending Publication Date: 2026-09-22SUPER ROBOT RESEARCH INSTITUTE (HUANGPU)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610735670.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-26
Publication Date
2026-09-22

AI Technical Summary

Technical Problem

[0003](1)控制循环被阻:若将录制逻辑与控制逻辑置于同一进程,磁盘I/O的瞬时阻塞(尤其是高频写入或大文件存储时)会直接导致控制节拍中断,引发机械臂抖动甚至安全事故

Benefits of technology

[0034](1)本发明通过录制进程与控制进程分离为独立进程,控制进程创建共享内存区并将关节数据样本写入环形缓冲区、录制进程映射访问共享内存区并在握持掩码满足开始条件时触发录制启动,以预设的固定帧率对关节数据样本进行采样并与相机帧配对形成观测-动作数据对,录制期间将观测-动作数据对写入私有内存缓存而不进行磁盘写入,当握持掩码满足结束条件时触发录制停止并延时存储。上述步骤将录制I/O与控制循环物理隔离,录制期间的磁盘写入和视频编码操作均推迟至录制停止后执行,消除了录制过程对控制实时性的干扰,保证了控制节拍的稳定运行。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122802703A_ABST
    Figure CN122802703A_ABST
Patent Text Reader

Abstract

This invention discloses a method, system, medium, and device for asynchronous recording of robot teaching data based on dual-process shared memory. The method includes the following steps: a control process creates a shared memory area, which includes a circular buffer and a grip state shared area; a recording process maps and accesses the shared memory area; the control process writes joint data samples into the circular buffer and updates the grip mask, triggering recording start when the grip mask meets the start condition; the latest joint data sample is read from the circular buffer and paired with the camera frame with the smallest time difference to form an observation-action data pair, which is then written to the recording process's private memory cache; recording stops when the end condition is met, otherwise, sampling continues; after recording stops, non-image sampled data is written to a structured numerical file, and the image frame sequence is encoded into a video file and a metadata index file is generated. This invention can eliminate the interference of the recording process on the real-time control and achieve high-quality multimodal teaching data acquisition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of robot data acquisition technology, specifically, it relates to a method, system, medium and device for asynchronous recording of robot teaching data based on dual-process shared memory. Background Technology

[0002] During data acquisition in robot teleoperation, it is necessary to simultaneously record the robot's joint states, end-effector pose, control commands, and data from multiple high-resolution vision sensors. Existing teaching recording solutions typically have the following drawbacks:

[0003] (1) Control loop blocked: If the recording logic and control logic are placed in the same process, the instantaneous blocking of disk I / O (especially when writing at high frequency or storing large files) will directly cause the control cycle to be interrupted, causing the robotic arm to shake or even cause a safety accident.

[0004] (2) Intense competition for resources: Real-time video encoding and robot inverse kinematics calculation compete for CPU / GPU resources, which makes it impossible to guarantee the control priority at the hardware level.

[0005] (3) Low data storage efficiency: Traditional solutions often embed the original image bytes into structured tables or frequently generate a large number of small image files, resulting in an abnormally large database file size and extremely slow index reading in the later stages.

[0006] (4) Unstable sampling timing: Due to camera drive or network fluctuations, frame drops often occur during the recording process, resulting in inconsistent time steps in the training dataset, which increases the difficulty of model training alignment. Summary of the Invention

[0007] The purpose of this invention is to overcome the shortcomings and deficiencies of the existing technology and provide an asynchronous recording method for robot teaching data based on dual-process shared memory. By process-level decoupling and memory-level buffering, the interference of the recording process on the real-time control is eliminated, and high-quality, high-performance multimodal teaching data acquisition is achieved.

[0008] The second objective of this invention is to provide an asynchronous recording system for robot teaching data based on dual-process shared memory.

[0009] A third objective of this invention is to provide a storage medium.

[0010] A fourth objective of this invention is to provide a computing device.

[0011] The objective of this invention is achieved through the following technical solution: an asynchronous recording method for robot teaching data based on dual-process shared memory, comprising the following steps:

[0012] S1. The control process creates a shared memory area, which includes a circular buffer and a holding state shared area; the recording process maps and accesses the shared memory area.

[0013] S2. The control process writes joint data samples into the circular buffer at a control beat and updates the grip mask in the grip state sharing area; when the grip mask meets the start condition, recording is triggered to start.

[0014] S3. Read joint data samples from the circular buffer at a preset fixed frame rate. Select the latest joint data sample with a timestamp no later than the sampling time at each sampling time and pair it with the camera frame with the smallest time difference to form an observation-action data pair. Write the observation-action data pair into the private memory cache of the recording process without writing to the disk.

[0015] S4. Recording stops when the holding mask meets the termination condition; otherwise, return to S3.

[0016] S5. After recording stops, write the non-image sampling data in the private memory cache into a structured numerical file, encode the image frame sequence into a video file, and generate a metadata index file to record the mapping relationship between each data.

[0017] Preferably, in step S2, the start condition is met when the result of the bitwise AND operation between the holding mask and the enabled hand mask changes from 0 to 1; in step S4, the end condition is met when the result of the bitwise AND operation changes from 1 to 0.

[0018] Preferably, in step S2, the control process uses a sequence lock mechanism when writing the joint data sample into the circular buffer: before writing, the slot number of the corresponding slot is set to an odd number, and after writing, it is set to an even number; the recording process only reads slots with even slot numbers.

[0019] Preferably, in step S3, the sampling time for the fixed frame rate is determined by the following formula:

[0020] , ,

[0021] in, Let k be the sampling time of the k-th frame. This is the start time of recording. T is the preset frame rate. r The sampling period.

[0022] Preferably, in step S3, the joint data sample includes joint command samples and joint measurement samples; the recording process selects motion data from the joint command samples and selects state observation data from the joint measurement samples.

[0023] Preferably, in step S5, the metadata index file generates a mapping record for each camera channel based on the current teaching set and frame number. The mapping record includes frame number, sampling timestamp, structured numerical file path and row index, camera channel identifier, video file path and video frame number.

[0024] Preferably, the control process and the recording process run on different central processing unit cores.

[0025] A robot teaching data asynchronous recording system based on dual-process shared memory includes:

[0026] An initialization module is used to control the process to create a shared memory area, which includes a circular buffer and a holding state shared area; the recording process maps access to the shared memory area;

[0027] The data writing and triggering module is used by the control process to write joint data samples into the circular buffer according to the control beat, and update the grip mask in the grip state sharing area; when the grip mask meets the start condition, the recording is triggered to start.

[0028] The sampling alignment and caching module is used to read joint data samples from the circular buffer at a preset fixed frame rate, select the latest joint data sample with a timestamp no later than the sampling time at each sampling time, and pair it with the camera frame with the smallest time difference to form an observation-action data pair. The observation-action data pair is written into the private memory cache of the recording process without disk writing.

[0029] The judgment and loop module is used to trigger recording to stop when the holding mask meets the termination condition, otherwise return to continue sampling;

[0030] The delayed storage module is used to write non-image sampling data from the private memory cache into a structured numerical file after recording stops, encode the image frame sequence into a video file, and generate a metadata index file to record the mapping relationship between the data.

[0031] A storage medium storing a program, which, when executed by a processor, implements the above-described method for asynchronous recording of robot teaching data based on dual-process shared memory.

[0032] A computing device includes a processor and a memory for storing processor-executable programs. When the processor executes the program stored in the memory, it implements the above-described method for asynchronous recording of robot teaching data based on dual-process shared memory.

[0033] The present invention has the following advantages and effects compared with the prior art:

[0034] (1) This invention separates the recording process and the control process into independent processes. The control process creates a shared memory area and writes joint data samples into a circular buffer. The recording process maps and accesses the shared memory area and triggers recording when the holding mask meets the start condition. The joint data samples are sampled at a preset fixed frame rate and paired with camera frames to form observation-action data pairs. During recording, the observation-action data pairs are written to a private memory cache without disk writing. When the holding mask meets the end condition, recording is stopped and stored with a delay. The above steps physically isolate the recording I / O from the control loop. Disk writing and video encoding operations during recording are postponed until recording stops, eliminating the interference of the recording process on the real-time performance of the control and ensuring the stable operation of the control cycle.

[0035] (2) The present invention samples joint data samples at a preset fixed frame rate, selects the latest joint data sample with a timestamp no later than the sampling time at each sampling time, and pairs it with the camera frame with the smallest time difference to form an observation-action data pair. When a frame is missing, the valid sample from the previous time is reused for compensation, so that the action data, state data and visual data are precisely aligned in time, thus solving the problem of inconsistent time sequence of multi-source data acquisition.

[0036] (3) This invention writes the observation-action data pairs into a private memory cache during recording, without disk writing or real-time encoding. After the holding mask meets the end condition and triggers the recording to stop, the non-image sampling data is written into a structured numerical file and the image frame sequence is encoded into a video file. The time-consuming video encoding and disk storage operations are postponed until after the recording ends, thus avoiding the encroachment of encoding and disk writing on system resources during recording and ensuring the stability of high-resolution acquisition by multiple cameras.

[0037] (4) This invention writes non-image sampling data into a structured numerical file, encodes image frame sequences into video files, and generates a metadata index file to record the mapping relationship between each data, thereby realizing the separate storage of numerical data and video data, reducing storage volume and improving data loading efficiency. Attached Figure Description

[0038] Figure 1 This is a schematic diagram of the dual-process structure for control and recording in Embodiment 1 of the present invention.

[0039] Figure 2 This is a flowchart illustrating the asynchronous recording method for robot teaching data based on dual-process shared memory in Embodiment 1 of the present invention. Detailed Implementation

[0040] The present invention will be further described in detail below with reference to the embodiments and accompanying drawings, but the embodiments of the present invention are not limited thereto.

[0041] Example 1

[0042] like Figure 1 The diagram shows the dual-process structure of control and recording according to the present invention. The system consists of a control process and a recording process, which run in independent process address spaces.

[0043] The control process receives remote operation commands issued by the operator via the handle, calculates and generates joint commands through the control algorithm, and sends them to the robot for execution. At the same time, it writes joint command samples and joint measurement samples into the circular buffer of the shared memory area according to the control rhythm, and writes the grip state into the grip state shared area.

[0044] The recording process reads joint data samples from the circular buffer in the shared memory area, acquires image frames through camera acquisition, pairs the joint data samples with camera frames through time-aligned sampling to form observation-action data pairs, writes them into a private memory cache for memory caching, and after recording stops, writes the non-image sampled data in the cache into a structured numerical file through delayed storage, encodes the image frame sequence into a video file, and generates a metadata index file.

[0045] The control process is bound to a designated CPU core and given a higher scheduling priority, while the recording process runs asynchronously on the remaining cores. The two processes exchange data through a shared memory area. The control process does not perform any disk I / O operations, and the recording process's storage operations do not block the real-time operation of the control process.

[0046] like Figure 2 As shown, the asynchronous recording method for robot teaching data based on dual-process shared memory of the present invention includes five steps, which are described in detail below.

[0047] Step 1: Initialize the dual-process architecture

[0048] The control process creates a shared memory area, and the recording process maps access to the shared memory area, thus completing the construction of the dual-process architecture.

[0049] (1) Control process creates shared memory area

[0050] When the control process starts, it creates a shared memory region according to the shared memory naming prefix. The shared memory region includes at least one circular buffer and a holding state shared region.

[0051] Each circular buffer uses a header plus fixed slot layout. The header fields include protocol identifier, version number, capacity, write index, and write sequence number; the slot fields include slot sequence number, sample sequence number, monotonic timestamp, metadata bits, and seven-dimensional joint quantities (six-axis joints plus grippers). The write index w_idx in the header records the current write position, and the write sequence number records the cumulative write count, used by the recording process to determine if new data has arrived. A gripping state shared area publishes a gripping mask, defined bitwise: bit 0 represents the right hand, bit 1 represents the left hand. The control process also creates a command circular buffer and a measurement circular buffer for each activated robotic arm. The command circular buffer stores joint command samples, i.e., the target joint angles calculated and issued to the robot by the control process; the measurement circular buffer stores joint measurement samples, i.e., the actual joint angles read from the robot's hardware encoder. Both record expected and actual values ​​respectively, providing a complete action-state correspondence for subsequent imitation learning.

[0052] During initialization, both the header and slot are cleared to zero, and the gripping mask is set to zero to ensure that the system starts in a defined initial state without any residual data interference.

[0053] (2) Recording process mapping shared memory area

[0054] After the recording process starts, it connects to the created shared memory segments, including the gripping status segment, the instruction ring buffers for each enabled robotic arm, and the measurement ring buffer, accessing them in read-only mode. The recording process maps the shared memory area to its own virtual address space through the shared memory interface provided by the operating system. The recording process initializes the camera device, and the camera acquisition thread appends a timestamp using a monotonic clock source consistent with the control process when capturing each frame. The control process also uses the same monotonic clock source when writing joint data samples, thereby establishing a unified time reference for control data, measurement data, and image data.

[0055] Traditional solutions place recording and control logic in the same process. When recording performs disk I / O operations, the momentary blockage directly interrupts the control loop, causing the control cycle to break. This approach separates the control and recording processes into independent address spaces, using shared memory as the sole data exchange medium. The control process is only responsible for writing data to shared memory without performing any I / O operations, while the recording process independently consumes data and performs storage. This achieves complete decoupling of control and recording at the architectural level.

[0056] Step 2: Write joint data and wait for recording to start.

[0057] The control process continuously writes joint data and updates the grip mask to control the beat, while the recording process monitors the grip mask and triggers recording start when the start condition is met.

[0058] (1) Control process writes joint data sample

[0059] The control process operates at a high-frequency control cycle. In each cycle, the control process writes the currently calculated joint command samples into the command circular buffer, writes the joint measurement samples read by the robot hardware into the measurement circular buffer, and appends the current monotonic timestamp.

[0060] The write process employs a sequence lock mechanism for lock-free synchronization. Specifically, before writing, the slot number is set to an odd number, indicating that writing is in progress in that slot. After data writing is complete, the slot number is changed to an even number, indicating that the data in that slot is fully readable. During recording, the process only reads slots with even-numbered slots to avoid reading intermediate data being written by the control process. The write index is updated by wrapping around the ring buffer using w_idx = (w_idx + 1) mod N. When the ring buffer is full, new samples automatically overwrite the oldest samples. Here, w_idx represents the current index position, w_idx + 1 indicates that after writing a sample, the index moves forward one position, mod N is the modulo operation, and N is the total number of slots in the ring buffer.

[0061] (2) Control process updates holding mask

[0062] After processing each frame of input device data, the control process reads the activation status of the left and right handle grip buttons and synthesizes a grip mask, which is then written to the grip status shared area. When the connection is interrupted, the process is reset, or the system stops, the grip mask is cleared to prevent the recording device from accidentally triggering recording under abnormal conditions.

[0063] (3) Determine and trigger recording start

[0064] like Figure 2 As shown in the judgment process, the recording process monitors the grip mask in the grip state shared area. The enabled hand mask is a preset constant used to specify the robotic arm participating in the recording, for example, bit 0 represents the right arm and bit 1 represents the left arm. This grip mask is read and a bitwise AND operation is performed with the enabled hand mask. The recording activation state is determined based on the result of the bitwise AND: when the result changes from 0 to 1, it is determined as a start event, triggering the recording start, recording the current time as the recording start time t0, initializing the frame sequence number k=0, and proceeding to step three; when the result does not change from 0 to 1, it returns to continue monitoring.

[0065] Step 3: Sample alignment and memory caching

[0066] Once recording starts, the recording process performs the following three operations frame by frame at a preset fixed frame rate.

[0067] (1) Read the latest sample from shared memory

[0068] The recording process follows the frame rate preset in the dataset. During execution, the sampling time of the current frame satisfies the formula:

[0069] ,

[0070] Among them, sampling period , t k Let t be the sampling time of the k-th frame, and t0 be the recording start time. At each sampling time t... k The timestamp selected from the instruction circular buffer is no later than t. k The latest instruction sample is used as action data; timestamps no later than t are selected from the measurement circular buffer. k The latest measurement samples are used as state observation data. Active sampling at a fixed frame rate ensures that the intervals of each sampling period are uniform and consistent.

[0071] (2) Camera acquisition and time alignment

[0072] Select from the camera acquisition queue and t k The camera frame with the smallest time difference is used as the visual observation data. Motion data, state observation data, and visual observation data are synchronized at a unified timestamp t. k The data is then paired to form observation-action data pairs for that moment. If a data source has no new samples at the current moment or the time difference exceeds the allowable threshold, valid samples from the previous moment are reused for compensation to ensure that the tensor shape remains constant for each frame.

[0073] (3) Write to memory cache

[0074] The observation-action data pairs are written to the recording process's private memory cache. This private memory cache is independent of the shared memory circular buffer: the shared memory is used to control the process to publish the latest small data in a non-blocking manner, while the private memory is used to accumulate the complete sample sequence of the current teaching segment. No disk writes, real-time video encoding operations, or image embedding into structured tables are performed during recording. After each frame is buffered, the frame number is incremented by k = k + 1, and then proceed to step four.

[0075] Step 4: Determine if recording is complete

[0076] After each frame is buffered, determine whether the recording end condition is met.

[0077] like Figure 2 As shown in the judgment process, the recording process reads the holding mask and performs a bitwise AND operation with the enabled holding mask. When the result of the bitwise AND changes from 1 to 0, it is determined as an end event, triggering the recording to stop; or when a manual stop recording command is received, it is also determined as the recording to end. If no end condition is detected, it returns to step three to continue sampling alignment and buffering for the next frame. If an end condition is detected, it exits the loop and proceeds to step five.

[0078] Step 5: Delay encoding and separate storage data

[0079] After recording stops, the recording process is saved in the background in the following order:

[0080] (1) Write to structured numerical file

[0081] First, the non-image sampled data, aligned by sampling time in the private memory cache, is written to a structured numerical file in chronological order. The non-image sampled data includes structured numerical information such as joint angles, end-effector poses, and timestamps. The structured numerical file contains only numerical columns and no image data.

[0082] (2) Encoded video files

[0083] The corresponding multi-camera image frames are then encoded into video files according to each camera channel. The video frame numbers are incremented according to the encoding order of that channel.

[0084] (3) Generate metadata index file

[0085] Finally, a metadata index file is generated. Using the current teaching set as a unit, each frame is traversed in ascending order of frame number, and a mapping record is generated for each camera channel. The mapping record includes the set number, frame number, sampling timestamp, structured numerical file path, structured numerical file line index, camera channel identifier, video file path, and video frame number, establishing a mapping relationship between sampling numbers and video frame numbers. Through this separate storage model of numerical and video data, a traceable association is formed between structured numerical rows, sampling times, and camera video frames.

[0086] Throughout steps one through five, the control process runs independently on its bound CPU core, unaffected by the recording process's data saving operations. Disk writes and video encoding by the recording process are performed in the background after recording stops, and do not participate in real-time processing during recording.

[0087] Through the coordinated execution of the five steps described above, the control process publishes joint data in a stable, non-blocking manner, while the recording process sequentially completes system initialization, write triggering and start-up judgment, sample alignment and memory caching, end judgment, delayed encoding, and separate storage. Any disk writes and video encoding operations during recording do not affect the real-time performance of the control, achieving complete decoupling between control and recording.

[0088] Example 2

[0089] This embodiment provides an asynchronous recording system for robot teaching data based on dual-process shared memory, including:

[0090] An initialization module is used to control the process to create a shared memory area, which includes a circular buffer and a holding state shared area; the recording process maps access to the shared memory area;

[0091] The data writing and triggering module is used by the control process to write joint data samples into the circular buffer according to the control beat, and update the grip mask in the grip state sharing area; when the grip mask meets the start condition, the recording is triggered to start.

[0092] The sampling alignment and caching module is used to read joint data samples from the circular buffer at a preset fixed frame rate, select the latest joint data sample with a timestamp no later than the sampling time at each sampling time, and pair it with the camera frame with the smallest time difference to form an observation-action data pair. The observation-action data pair is written into the private memory cache of the recording process without disk writing.

[0093] The judgment and loop module is used to trigger recording to stop when the holding mask meets the termination condition, otherwise return to continue sampling;

[0094] The delayed storage module is used to write non-image sampling data from the private memory cache into a structured numerical file after recording stops, encode the image frame sequence into a video file, and generate a metadata index file to record the mapping relationship between the data.

[0095] Example 3

[0096] A storage medium storing a program, which, when executed by a processor, implements the asynchronous recording method for robot teaching data based on dual-process shared memory as described in Embodiment 1, as follows:

[0097] S1. The control process creates a shared memory area, which includes a circular buffer and a holding state shared area; the recording process maps and accesses the shared memory area.

[0098] S2. The control process writes joint data samples into the circular buffer at a control beat and updates the grip mask in the grip state sharing area; when the grip mask meets the start condition, recording is triggered to start.

[0099] S3. Read joint data samples from the circular buffer at a preset fixed frame rate. Select the latest joint data sample with a timestamp no later than the sampling time at each sampling time and pair it with the camera frame with the smallest time difference to form an observation-action data pair. Write the observation-action data pair into the private memory cache of the recording process without writing to the disk.

[0100] S4. Recording stops when the holding mask meets the termination condition; otherwise, return to S3.

[0101] S5. After recording stops, write the non-image sampling data in the private memory cache into a structured numerical file, encode the image frame sequence into a video file, and generate a metadata index file to record the mapping relationship between each data.

[0102] The specific processing steps described above are as in Example 1 and will not be repeated here.

[0103] In this embodiment, the storage medium may be a disk, optical disk, computer memory, read-only memory, random access memory, USB flash drive, portable hard drive, or other media.

[0104] Example 4

[0105] A computing device includes a processor and a memory for storing processor-executable programs. When the processor executes the program stored in the memory, it implements the asynchronous recording method for robot teaching data based on dual-process shared memory described in Embodiment 1, as follows:

[0106] S1. The control process creates a shared memory area, which includes a circular buffer and a holding state shared area; the recording process maps and accesses the shared memory area.

[0107] S2. The control process writes joint data samples into the circular buffer at a control beat and updates the grip mask in the grip state sharing area; when the grip mask meets the start condition, recording is triggered to start.

[0108] S3. Read joint data samples from the circular buffer at a preset fixed frame rate. Select the latest joint data sample with a timestamp no later than the sampling time at each sampling time and pair it with the camera frame with the smallest time difference to form an observation-action data pair. Write the observation-action data pair into the private memory cache of the recording process without writing to the disk.

[0109] S4. Recording stops when the holding mask meets the termination condition; otherwise, return to S3.

[0110] S5. After recording stops, write the non-image sampling data in the private memory cache into a structured numerical file, encode the image frame sequence into a video file, and generate a metadata index file to record the mapping relationship between each data.

[0111] The specific processing steps described above are as in Example 1 and will not be repeated here.

[0112] In this embodiment, the computing device can be a desktop computer, a laptop computer, a PDA handheld terminal, a tablet computer, or other terminal devices.

[0113] The above embodiments are preferred embodiments of the present invention and are not intended to limit the present invention. Any changes or other equivalent substitutions made without departing from the technical solution of the present invention are included within the protection scope of the present invention.

Claims

1. A method for asynchronous recording of robot teaching data based on dual-process shared memory, characterized in that, Including the following steps: S1. The control process creates a shared memory area, which includes a circular buffer and a holding state shared area; the recording process maps and accesses the shared memory area. S2. The control process writes joint data samples into the annular buffer at a control beat and updates the grip mask in the grip state sharing area. When the holding mask meets the start condition, recording is triggered to start; S3. Read joint data samples from the circular buffer at a preset fixed frame rate. Select the latest joint data sample with a timestamp no later than the sampling time at each sampling time and pair it with the camera frame with the smallest time difference to form an observation-action data pair. Write the observation-action data pair into the private memory cache of the recording process without writing to the disk. S4. Recording stops when the holding mask meets the termination condition; otherwise, return to S3. S5. After recording stops, write the non-image sampling data in the private memory cache into a structured numerical file, encode the image frame sequence into a video file, and generate a metadata index file to record the mapping relationship between each data.

2. The asynchronous recording method for robot teaching data based on dual-process shared memory according to claim 1, characterized in that, In step S2, the start condition is met when the result of the bitwise AND operation between the holding mask and the enabled hand mask changes from 0 to 1; in step S4, the end condition is met when the result of the bitwise AND operation changes from 1 to 0.

3. The asynchronous recording method for robot teaching data based on dual-process shared memory according to claim 1, characterized in that, In step S2, when the control process writes the joint data sample into the circular buffer, it adopts a sequence lock mechanism: before writing, the slot number of the corresponding slot is set to an odd number, and after writing, it is set to an even number; the recording process only reads the slots with even slot numbers.

4. The asynchronous recording method for robot teaching data based on dual-process shared memory according to claim 1, characterized in that, In step S3, the sampling time at the fixed frame rate is determined by the following formula: , , in, Let k be the sampling time of the k-th frame. This is the start time of recording. T is the preset frame rate. r The sampling period.

5. The asynchronous recording method for robot teaching data based on dual-process shared memory according to claim 1, characterized in that, In step S3, the joint data sample includes joint command samples and joint measurement samples; the recording process selects motion data from the joint command samples and selects state observation data from the joint measurement samples.

6. The asynchronous recording method for robot teaching data based on dual-process shared memory according to claim 1, characterized in that, In step S5, the metadata index file generates a mapping record for each camera channel based on the current teaching set and frame number. The mapping record includes frame number, sampling timestamp, structured numerical file path and row index, camera channel identifier, video file path and video frame number.

7. The asynchronous recording method for robot teaching data based on dual-process shared memory according to claim 1, characterized in that, The control process and the recording process run on different CPU cores.

8. A robot teaching data asynchronous recording system based on dual-process shared memory, characterized in that, include: An initialization module is used to control the process to create a shared memory area, which includes a circular buffer and a holding state shared area. The recording process maps to access the shared memory area; The data writing and triggering module is used by the control process to write joint data samples into the annular buffer according to the control beat, and update the grip mask in the grip state sharing area; When the holding mask meets the start condition, recording is triggered to start; The sampling alignment and caching module is used to read joint data samples from the circular buffer at a preset fixed frame rate, select the latest joint data sample with a timestamp no later than the sampling time at each sampling time, and pair it with the camera frame with the smallest time difference to form an observation-action data pair. The observation-action data pair is written into the private memory cache of the recording process without disk writing. The judgment and loop module is used to trigger recording to stop when the holding mask meets the termination condition, otherwise return to continue sampling; The delayed storage module is used to write non-image sampling data from the private memory cache into a structured numerical file after recording stops, encode the image frame sequence into a video file, and generate a metadata index file to record the mapping relationship between the data.

9. A storage medium storing a program, characterized in that, When the program is executed by the processor, it implements the asynchronous recording method for robot teaching data based on dual-process shared memory as described in any one of claims 1-7.

10. A computing device, characterized in that, It includes a processor and a memory for storing processor-executable programs. When the processor executes the program stored in the memory, it implements the asynchronous recording method for robot teaching data based on dual-process shared memory as described in any one of claims 1-7.