A device-side compilation and secure execution method and system for device-independent diagrams.

By employing device-independent drawing representation and consistency verification technologies, the compatibility and status awareness issues of automated robotic arm drawing equipment have been resolved, enabling cross-device versatility and safe execution, thereby improving drawing accuracy and equipment safety.

CN123114480APending Publication Date: 2026-11-17SMART FASHION (HANGZHOU) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611549207.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-08
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing automated robotic arm drawing equipment suffers from poor equipment compatibility and an inability to detect changes in equipment status in real time, resulting in low drawing accuracy and high safety risks.

Method used

Using device-independent diagrams, the system acquires device status data and initial state version identifiers, performs integrity, structure, and resource boundary checks, builds compilation snapshots, calculates layout transformations, generates physical execution plans, and performs consistency checks before execution to ensure device status consistency.

Benefits of technology

It achieves cross-device compatibility of artwork, avoids pattern misalignment and mechanical collisions caused by changes in device status, and improves drawing accuracy and device safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123114480A_ABST
    Figure CN123114480A_ABST
Patent Text Reader

Abstract

This application proposes a device-side compilation and secure execution method and system for device-independent artwork, relating to the field of virtual reality processing software technology. The method includes: acquiring the device-independent artwork representation and drawing device information corresponding to the drawing task; performing integrity, structure, and resource boundary checks on the artwork; constructing a compilation snapshot by combining device state data and an initial state version identifier set after successful checks; solving the layout transformation from the artwork coordinate space to the drawing medium coordinate space based on the compilation snapshot; and converting the result into a physical execution plan. Motion pre-checks are performed on the physical execution plan using physical safety constraints; after successful pre-checks, plan binding information is generated, binding the artwork identity, layout, compilation snapshot, etc.; before execution, the current state version identifier set and current posture are re-acquired and a consistency check is performed; only after successful check is the execution instruction issued, and the physical execution plan is run until completion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of virtual reality processing software technology, and in particular to a device-side compilation and secure execution method and system for device-independent artwork. Background Technology

[0002] Currently, automated robotic arm drawing equipment generally adopts a working mode of pre-generating motion trajectories in the cloud or on a server. A remote device generates a unique drawing trajectory based on fixed mechanical structure parameters, drawing board position, and calibration parameters, and then sends it to the drawing equipment to perform the drawing task. This mode can realize the automated drawing of standardized graphics and is widely used in scenarios such as intelligent hand-drawing and industrial pattern replication. It is the mainstream automated drawing technology solution at present.

[0003] However, existing technologies have two major flaws that seriously affect drawing accuracy and equipment operation safety. First, existing trajectory generation methods are deeply bound to specific equipment mechanism configurations and hardware parameters, resulting in a lack of universality in the drawings. They cannot be adapted to drawing equipment of different models and calibration states, leading to poor equipment compatibility. Second, existing systems cannot perceive changes in the working conditions of the drawing equipment in real time. When the physical states of the equipment, such as the position of the drawing board, mechanical posture, and safety constraints, change, the equipment will still execute the motion plan generated in the old state. It cannot identify the mismatch between the plan and the current equipment state, which in turn leads to faults such as pattern misalignment and deformation, mechanical collisions, and drawing task interruptions. Summary of the Invention

[0004] In view of this, this application proposes a device-side compilation and secure execution method, apparatus, device, and storage medium for device-independent drawings.

[0005] In a first aspect, this application provides a device-side compilation and secure execution method for device-independent drawings, including: Obtain device-independent drawing representation and drawing device information associated with the drawing task. The drawing device information includes device status data and an initial state version identifier set. The device status data includes drawing medium status, physical security constraints, and initial attitude. Integrity verification, structural verification, and resource boundary verification are performed on the device-independent artwork representation. After the verification is passed, a compilation snapshot is constructed based on the device status data and the initial state version identifier set. Based on the compilation snapshot, the layout transformation of the device-independent artwork representation from the artwork coordinate space to the drawing medium coordinate space is calculated, and the device-independent artwork representation is converted into a physical execution plan according to the layout transformation. Based on the physical security constraints, motion pre-check is performed on the physical execution plan. After the motion pre-check passes, plan binding information is constructed. The plan binding information is used to bind the physical execution plan, the representation identifier of the device-independent artwork representation, the artwork content summary, the layout transformation, the compilation snapshot, the state version identifier set, and the initial pose to each other. Obtain the current state version identifier set and the current attitude, perform a consistency check based on the plan binding information, and only when the consistency check passes, issue an execution command to the drawing device to execute the physical execution plan until execution is completed.

[0006] In one embodiment, the drawing device information includes device capability information, and obtaining the device-independent drawing representation includes: Retrieve a list of artworks containing multiple artwork representation descriptors, each artwork representation descriptor including a precision parameter; Select several candidate artwork representation descriptors that match the equipment capability information from multiple artwork representation descriptors; Select the candidate artwork representation descriptor with the highest precision parameter to obtain the qualified artwork representation descriptor; Obtain qualified coded artwork data corresponding to the qualified artwork representation descriptor from the artwork generation side, and combine the qualified artwork representation descriptor and the qualified coded artwork data to construct a device-independent artwork representation.

[0007] In one embodiment, the qualified artwork representation descriptor includes a total data length declaration, a path unit length declaration, a path quantity declaration, a coordinate point quantity declaration, and a coordinate extreme value range declaration. The drawing device information also includes path state machine transition rules. The execution of integrity verification, structural verification, and resource boundary verification on the device-independent artwork representation includes: Integrity verification: Calculate the actual total byte length of the encoded artwork data and confirm that the actual total byte length is consistent with the declared total data length; Based on the path state machine transition rules, verify the timing logic of the path markers within the coded artwork data, confirm the validity of the order of the path start marker, coordinate point sequence, and path end marker, and complete the integrity verification of the device-independent artwork representation: The actual number of paths, actual number of coordinate points, and actual coordinate extreme value range within the statistical coding artwork data are verified to ensure that the actual number of paths, actual number of coordinate points, and actual coordinate extreme value range are consistent with the declared number of coordinate points, thus completing the boundary verification of the device-independent artwork representation resources.

[0008] In one embodiment, the device state data further includes the allowed orientation set, tool envelope, positioning error, calibration uncertainty, and no-entry zone. The device-independent artwork representation includes artwork aspect ratio and stroke topology. The step of calculating the layout transformation of the device-independent artwork representation from artwork coordinate space to drawing medium coordinate space based on a compilation snapshot includes: Select a direction transformation from the set of allowed directions, determine candidate pen placement areas after considering tool envelope, positioning error, calibration uncertainty, and no-entry zones, and calculate a uniform scaling ratio and translation amount within the candidate pen placement areas; select a feasible layout while maintaining the aspect ratio and stroke topology of the artwork to obtain the layout transformation.

[0009] In one embodiment, the device-independent artwork representation further includes stroke paths and lift-off paths between adjacent strokes. Converting the device-independent artwork representation into a physical execution plan based on layout transformation involves two processing passes: The first pass of the process involves a complete scan of the device-independent artwork representation, calculation of resource usage, determination of layout transformations, and calculation of the layout summary. The second processing repeats the first processing process, and converts the stroke path and the lifting path between adjacent strokes into physical coordinates and actuator states to generate the physical execution plan. After confirming that the representation identifiers, artwork content summaries, resource usage, and layout summaries obtained from the two processing passes are consistent, output the physical execution plan.

[0010] In one embodiment, the physical safety constraints include a permitted pen-writing area, a permitted pen-lifting space, and a safe range of joint movement. The motion pre-checking of the physical execution plan based on these physical safety constraints includes: The physical execution plan is analyzed to obtain the execution pen placement area, execution pen lifting passage space, and execution joint activity state corresponding to the current motion stage. After confirming that the execution pen placement area falls within the allowed pen placement area, the execution pen lifting passage space is within the allowed pen lifting passage space, and the execution joint activity state is within the safe joint activity state range, the motion pre-check of the physical execution plan is completed.

[0011] In one embodiment, the current state version identifier set includes several current state version identifiers, and the initial state version identifier set includes several initial state version identifiers. There is a one-to-one correspondence between the current state version identifiers and the initial state version identifiers. A consistency check is performed based on the plan binding information, including: Compare each current state version identifier with a number of initial state version identifiers one by one to ensure that each current state version identifier is the same as the corresponding initial state version identifier. The current pose is compared with the initial pose to ensure that the current pose is the same as the initial pose; The consistency check passes when both of the above conditions are met.

[0012] In one embodiment, before the consistency check, a one-time task authorization is obtained from the drawing device. After the one-time check is passed and before the execution instruction is issued to the drawing device, the one-time task authorization is atomically converted from an unconsumed state to a consumed state.

[0013] In one embodiment, during the execution of the physical execution plan, it is detected in real time whether all state version identifiers at the current moment are the same as the corresponding initial state version identifiers in the initial state version identifier set. If they are the same, the motion plan continues to be executed until it is completed, and the execution is output as successful. If not, the stop process is entered.

[0014] In a second aspect, a device-side compilation and secure execution system for device-independent artwork includes an artwork generation side and a drawing device, wherein the artwork generation side is used to generate a device-independent artwork representation, and the drawing device is used to execute the device-side compilation and secure execution method for device-independent artwork as described in the first aspect.

[0015] Thirdly, this application also provides an electronic device, including a processor and a memory; the memory stores a stored computer program, wherein the computer program, when executed by the processor, implements the device-side compilation and secure execution method for device-independent artwork as described in the first aspect.

[0016] Fourthly, this application also provides a computer storage medium storing a computer program thereon, wherein when the computer program is executed by a processor, it implements the device-side compilation and secure execution method for device-independent artwork as described in the first aspect.

[0017] The device-side compilation and secure execution method for device-independent drawings proposed in this application has the following advantages over related technologies: 1. By adopting device-independent drawing representation, the drawing only describes the stroke path and stroke topology, without binding to the machine coordinates, joint coordinates, and drive commands of a specific drawing device. The drawing device itself autonomously completes layout transformation and motion compilation based on its own mechanism configuration, media status, and other information, enabling the same drawing to be used on drawing devices with different configurations, thereby improving the technical effect of cross-device versatility of the drawing. By building a compilation snapshot that binds the device state version identifier and initial posture during the compilation stage, and binding the snapshot information after generating the physical execution plan, the current state version identifier and posture of the device are re-acquired before formal execution. The current state is compared with the state corresponding to the compilation snapshot, and inconsistencies in state are identified and execution is blocked. This avoids the use of outdated plans for drawing, thereby preventing faults such as pattern misalignment and deformation, mechanical collisions, and drawing task interruptions caused by changes in the physical state of the device.

[0018] 2. By filtering and matching artwork against device capabilities through an artwork list and selecting the highest-precision artwork representation, coupled with comprehensive artwork metadata verification rules, artwork exceeding device processing capabilities and those whose resource declarations do not match the actual content can be filtered during the artwork input stage. This further reduces drawing anomalies, parsing crashes, and task interruptions caused by improper artwork selection and metadata forgery, ensuring drawing output accuracy within the boundaries of device capabilities. Simultaneously, by constraining the selection rules for layout transformations, limiting transformations to only those within the allowed direction set, using uniform scaling, and maintaining the original stroke topology, problems such as pattern proportion distortion and misplaced lines caused by illegal layouts are avoided, further ensuring the consistency between the output graphics and the original artwork.

[0019] 3. Through a two-stage compilation self-check process and refined motion pre-check judgment conditions, it can identify planning errors caused by memory anomalies during the compilation process, realize layered safety verification of pen placement, pen lifting, and joint status, further reduce the probability of robotic arm jamming and mechanism collision. At the same time, it refines the comparison logic between status version identifier and posture, making the judgment basis for consistency verification clearer and more rigorous, reducing status misjudgment and omission, and strengthening the ability to intercept outdated plans.

[0020] 4. By using an atomic consumption mechanism with one-time task authorization, the repeated execution of tasks caused by network retransmission and device restart is avoided; and runtime protection is added to continuously monitor the status version identifier during the movement process. Once the working conditions change, the stop process is triggered immediately. In addition to the planning, compilation and verification, a safety defense line is added to the running phase, which comprehensively reduces the risk of drawing errors, mechanical damage and abnormal task shutdown, and improves the robustness of the whole solution in the industrial field. Attached Figure Description

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

[0022] Figure 1 This is a flowchart illustrating the device-side compilation and secure execution method for device-independent drawings in one embodiment of this application; Figure 2 This is a schematic diagram illustrating the composition of the artwork list in one embodiment of this application; Figure 3 This is a schematic diagram showing the relationship between multiple security spaces in one embodiment of this application; Figure 4 This is a schematic diagram of the planned binding information in one embodiment of this application. Detailed Implementation

[0023] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0024] In some embodiments, such as Figure 1 As shown, this application provides a device-side compilation and secure execution method for device-independent drawings, characterized by comprising S1-S5: S1 acquires device-independent drawing representation and drawing device information associated with the drawing task. The drawing device information includes device status data and an initial state version identifier set. The device status data includes drawing medium status, physical security constraints, and initial attitude. As is understandable, this step provides all the input data sources for the entire drawing and compilation process. Device-independent artwork represents the graphic semantics of the drawing, independent of any specific machine hardware; drawing device information carries the machine's hardware capabilities, status, and security rules. Without these two types of input, subsequent verification, compilation, and layout transformations cannot be performed.

[0025] In this step, the drawing device receives the drawing task trigger instruction, retrieves the corresponding device-independent drawing representation based on the drawing task's association identifier, and simultaneously reads the locally stored drawing device information to complete the reception and temporary storage of both types of input data before delivering the data to the subsequent drawing verification stage. If neither input can be obtained, the current drawing task is terminated directly, and the process does not proceed to the next step.

[0026] Device-independent artwork refers to artwork data that describes stroke paths and stroke topology in a coordinate space independent of the drawing device mechanism configuration, without carrying machine coordinates, joint coordinates, or drive commands. Drawing device information includes device-side inherent and real-time status information such as device capabilities, device status data, and path state machine transition rules. This step completes the acquisition of the graphic data and device-side parameters required for the task, providing an input basis for subsequent processing.

[0027] S2 performs integrity checks, structural checks, and resource boundary checks on device-independent artwork. After successful checks, a compilation snapshot is constructed based on the device state data and the initial state version identifier set. It's understood that verified external artwork data may contain truncated bytes, invalid path syntax, or forged resource parameters; direct parsing would cause device anomalies. Using continuously changing device states directly during the compilation phase would lead to inconsistencies before and after compilation. Constructing a compilation snapshot freezes the device state at the time of compilation, ensuring that the same set of device baseline conditions is used throughout the entire compilation process.

[0028] This step calls the verification module to sequentially perform integrity verification, structural verification, and resource boundary verification on the acquired device-independent artwork representation. After all three verifications pass, the device status data at the current moment and the initial state version identifier set are collected from each state owner. The device status data, including the drawing medium status, physical security constraints, and initial attitude, along with the initial state version identifier set, are encapsulated to generate a fixed compilation snapshot within this compilation cycle. If any verification fails, the drawing task is terminated directly, and no compilation snapshot is generated.

[0029] Among them, integrity verification is used to check whether the encoded artwork data is complete and without missing bytes; structure verification is used to check whether the syntax and timing of the internal path markers in the artwork are valid; resource boundary verification is used to check whether the actual number of resources in the artwork matches the declared resource parameters. Initial state version identifier set: a set of state version identifiers output by each state owner at the start of compilation; compilation snapshot represents the device state dataset frozen during the compilation phase, which does not change within a single compilation cycle; device state data includes drawing medium state, physical safety constraints, and initial attitude, used for constraint layout solving and motion compilation.

[0030] S3 calculates the layout transformation of the device-independent artwork representation from the artwork coordinate space to the drawing medium coordinate space based on the compilation snapshot, and converts the device-independent artwork representation into a physical execution plan according to the layout transformation; It is understandable that device-independent drawings reside in an abstract drawing coordinate space and cannot be directly executed by the drawing mechanism. It is necessary to rely on the device physical constraints frozen in the compilation snapshot to solve the layout transformation, complete the coordinate space mapping, and convert the abstract graphic into a motion plan recognizable by the mechanism, thus adapting the drawing to the local physical environment.

[0031] This step reads the completed compilation snapshot, uses the device constraint parameters saved in the snapshot to solve the layout transformation from the artwork coordinate space to the drawing medium coordinate space; uses the obtained layout transformation to perform coordinate mapping transformation on the stroke paths and pen lifting paths of the device-independent artwork representation, and generates a physical execution plan that can be used by the drawing execution mechanism; if a valid layout transformation cannot be solved, the drawing task is terminated and no physical execution plan is generated.

[0032] Among them, layout transformation is a set of transformation parameters that realize the mapping from the drawing coordinate space to the drawing medium coordinate space, including direction, scaling, and translation parameters; the physical execution plan is obtained by converting the stroke path and pen lifting path, and is a motion plan that can be executed by the drawing execution mechanism; this step completes the conversion from the abstract drawing to the motion plan adapted to the local medium, and is the core link of the equipment-side compilation.

[0033] S4 performs motion pre-check on the physical execution plan based on the physical security constraints. After the motion pre-check passes, plan binding information is constructed. The plan binding information is used to bind the physical execution plan, the representation identifier of the device-independent artwork representation, the artwork content summary, the layout transformation, the compilation snapshot, the state version identifier set, and the initial pose to each other. It is understandable that the physical execution plan generated after layout compilation needs to be pre-verified to ensure that all paths meet physical safety constraints, thus preventing collisions and boundary violations during movement. By binding the execution plan with all baseline information that generated the plan, the baseline can be checked during the subsequent execution admission phase to identify any abnormal changes to the device, artwork, and layout after compilation.

[0034] This step extracts the physical safety constraints from the compilation snapshot and performs a motion pre-check on the complete physical execution plan. After all items in the motion pre-check pass the test, plan binding information is generated. The physical execution plan body, artwork representation identifier, artwork content summary, layout transformation, compilation snapshot, state version identifier set, and initial pose are associated, bound, and saved. If the motion pre-check fails, plan binding information is not generated, and the drawing task is terminated.

[0035] Among these, motion pre-check refers to the safety and compliance checks conducted on the path and mechanism status before issuing execution instructions; the identifier is the unique identification number of the artwork; the artwork content digest is the digest obtained by hashing all the original bytes of the encoded artwork; and the plan binding information is a data set that associates and binds the physical execution plan with the artwork identification information, layout, compilation environment, and initial device status corresponding to its generation time. This step completes the motion safety pre-check and the binding and solidification of plan and compilation baseline information.

[0036] S5 obtains the current state version identifier set and the current attitude, performs a consistency check based on the plan binding information, and only when the consistency check passes, sends an execution instruction to the drawing device to execute the physical execution plan until execution is completed.

[0037] It is understandable that during the interval between compilation completion and the issuance of the first motion command, the hardware state and mechanical posture of the device may change, and the old physical execution plan will no longer be suitable for the actual physical environment. By re-collecting the real-time status and checking its consistency with the bound baseline, execution is only allowed if the status has not changed, thus avoiding the security risks caused by the execution of expired plans.

[0038] Before issuing the execution command, this step rereads the real-time current state version identifier set from each state owner and obtains the current attitude from the device sensors; a consistency check is performed with reference to the baseline data saved in the plan binding information; if all check items pass, the execution command is issued to the drawing execution mechanism to run the physical execution plan until all tasks are completed; if any consistency check item fails, the issuance of the execution command is prohibited and the drawing task ends directly.

[0039] Among them, the current state version identifier set refers to the set of state version identifiers read from each state owner in real time before the execution instruction is issued; the current attitude is the mechanism attitude read in real time during the execution admission phase; the consistency check is to compare and verify the device status and attitude read in real time before execution with the baseline information stored in the plan binding information item by item; this step realizes the execution admission check and controls whether the physical execution plan is allowed to start running.

[0040] This embodiment employs device-independent drawing representation, where the drawing only describes stroke paths and stroke topology, without binding to the machine coordinates, joint coordinates, and drive commands of a specific drawing device. The drawing device autonomously completes layout transformations and motion compilation based on its own mechanism configuration, media status, and other information, enabling the same drawing to be used on drawing devices with different configurations, thus improving the technical effect of cross-device versatility of the drawing. By constructing a compilation snapshot that binds the device state version identifier and initial posture during the compilation stage, and binding the snapshot information after generating the physical execution plan, the current state version identifier and posture of the device are re-acquired before formal execution. The current state is compared with the state corresponding to the compilation snapshot, and inconsistencies in state are identified and execution is blocked, avoiding the use of outdated plans for drawing. This achieves the technical effect of preventing faults such as pattern misalignment and deformation, mechanical collisions, and drawing task interruptions caused by changes in the physical state of the device.

[0041] In some embodiments, the drawing device information includes device capability information, and obtaining the device-independent drawing representation includes: Retrieve a list of artworks containing multiple artwork representation descriptors, each artwork representation descriptor including a precision parameter; Select several candidate artwork representation descriptors that match the equipment capability information from multiple artwork representation descriptors; Select the candidate artwork representation descriptor with the highest precision parameter to obtain the qualified artwork representation descriptor; like Figure 2 As shown, qualified coded artwork data corresponding to the qualified artwork representation descriptor is obtained from the artwork generation side, and the qualified artwork representation descriptor and the qualified coded artwork data are combined to construct a qualified device-independent artwork representation.

[0042] It's understandable that the artwork list contains multiple source artworks with different resolutions; artworks that don't match the device's capabilities will exceed storage, parsing, and processing limits, causing device malfunctions. Selecting the highest-resolution version from the candidate set that meets the device's capabilities maximizes the quality of the drawing output within the device's limits. Combining the metadata descriptor with the encoded artwork data forms a complete and verifiable artwork object, providing metadata support for subsequent verifications.

[0043] In this embodiment, the drawing device receives a list of artworks from the artwork generation side, traverses and parses each artwork representation descriptor in the list, and extracts the precision parameters carried by each descriptor; it reads the device capability information from the drawing device information, which includes the artwork formats supported by the device, the maximum available storage space, the maximum number of paths, and the maximum number of coordinate points; it compares the resource requirements and format corresponding to each artwork representation descriptor with the device capability information, eliminates descriptor entries that exceed the device's processing capabilities, and the remaining entries form a candidate artwork representation descriptor set; it traverses the candidate artwork representation descriptor set, compares the precision parameters of each entry in the set, and selects the entry with the highest precision parameter value as the qualified artwork representation descriptor; the drawing device initiates a data request to the artwork generation side, requesting to obtain the qualified encoded artwork data corresponding to the qualified artwork representation descriptor, and receives the binary encoded artwork body data; it assembles and binds the qualified artwork representation descriptor with the received qualified encoded artwork data to generate a complete qualified device-independent artwork representation, and sends it to the subsequent artwork verification process; if the candidate set is empty, the drawing task is directly rejected.

[0044] Among them, the equipment capability information is used to characterize the hardware and software processing capability parameters of the drawing equipment, such as the artwork format supported, storage space limit, maximum number of paths, and maximum number of coordinate points; the artwork list is output by the artwork generation side and contains a set of multiple artwork representation descriptors; the artwork representation descriptor is used to record metadata such as the identity, resource declaration, precision parameters, and length declaration of a single artwork; the precision parameters are used to characterize the level of detail of the corresponding artwork's geometric details; the candidate artwork representation descriptor represents the artwork metadata entries in the artwork list that meet the equipment capability constraints; the qualified coded artwork data represents the binary artwork body data issued by the artwork generation side; the qualified equipment-independent artwork representation is a complete artwork object formed by the combination of qualified artwork representation descriptors and qualified coded artwork data.

[0045] This embodiment filters and matches the device's capabilities by using a list of artworks and selects the artwork with the highest precision. Combined with complete artwork metadata verification rules, it can filter artworks that exceed the device's processing capabilities or whose resource declarations do not match the actual content during the artwork input stage. This further reduces problems such as drawing anomalies, parsing crashes, and task interruptions caused by improper artwork selection and metadata forgery, ensuring the accuracy of drawing output within the boundaries of device capabilities.

[0046] In some embodiments, the qualified artwork representation descriptor includes a total data length declaration, a path unit length declaration, a path quantity declaration, a coordinate point quantity declaration, and a coordinate extreme value range declaration. The drawing device information further includes path state machine transition rules. The execution of integrity verification, structure verification, and resource boundary verification on the device-independent artwork representation includes: Calculate the actual total byte length of the encoded artwork data, confirm that the actual total byte length is consistent with the declared total data length, and complete the integrity verification of the device-independent artwork representation; Based on the path state machine transition rules, verify the timing logic of the path markers within the coded drawing data, confirm the legality of the arrangement order of the path start marker, coordinate point sequence, and path end marker, and complete the structural verification of the device-independent drawing representation; : Statistically count the actual number of paths, actual number of coordinate points, and actual coordinate extreme value range within the coded artwork data; confirm that the actual number of paths is consistent with the declared number of paths, the actual number of coordinate points is consistent with the declared number of coordinate points, and the actual coordinate extreme value range is consistent with the declared coordinate extreme value range; and complete the boundary verification of the device-independent artwork representation resources.

[0047] It's understandable that byte truncation occurs during network transmission and storage; total length checks are used to identify incomplete bytes. Maliciously or incorrectly constructed artwork can disrupt the path marker order, causing parsing logic anomalies. Inconsistencies between the artwork descriptor's declared resources and the actual artwork resources constitute forged metadata, leading to memory overflows and parsing crashes. These three checks intercept illegal input early in the parsing process, preventing failures in subsequent compilation stages.

[0048] In the integrity verification step of this embodiment, the qualified encoded artwork data inside the qualified device-independent artwork representation is read, the byte statistics interface is called, and the actual total byte length of the encoded artwork data is calculated; the total data length declaration in the qualified artwork representation descriptor is read, and the calculated actual total byte length is compared with the total data length declaration; if the two are equal, the integrity verification passes; if the lengths are inconsistent, the verification fails directly.

[0049] In the structural legality verification step of this embodiment, the predefined path state machine transition rules in the drawing device information are read; the encoded drawing data is traversed in byte order to identify the path start mark, coordinate point sequence, and path end mark; the timing of the marks is strictly verified according to the state machine transition rules: the path start mark must appear first, followed by the coordinate point sequence, and finally the path end mark; if the order of the marks does not conform to the transition rules, the structural verification is deemed to have failed; if the timing of all path marks is compliant, the structural legality verification is passed.

[0050] In the resource boundary verification step of this embodiment, an independent counter is used to traverse and parse the coded artwork data, and the actual number of paths and the actual number of coordinate points are counted one by one. At the same time, the extreme value range of the actual coordinates is calculated by traversing all coordinates. The path number declaration, coordinate point number declaration, and coordinate extreme value range declaration in the qualified artwork representation descriptor are read. The three actual results obtained are compared with the corresponding declarations of the descriptor respectively. If all comparison results are consistent, the resource boundary verification is passed.

[0051] All three checks mentioned above—integrity verification, structural validity verification, and resource boundary verification—must pass before proceeding to the step of building a compilation snapshot; if any one check fails, the drawing task is terminated and subsequent compilation is not performed.

[0052] Among them, the total data length declaration represents the overall byte length of the encoded artwork data recorded by the artwork descriptor; the path unit length declaration represents the byte length corresponding to each path unit recorded by the descriptor; the path number declaration represents the total number of paths pre-declared by the descriptor; the coordinate point number declaration represents the total number of all coordinate points pre-declared by the descriptor; the coordinate extreme value range declaration represents the maximum and minimum values ​​of all coordinates recorded by the descriptor; the path state machine transition rules are the syntax rules that specify the legal arrangement order of path start markers, coordinate point sequences, and path end markers; the integrity check compares the actual byte length of the encoded artwork with the descriptor declaration length to identify byte truncation and packet loss; the structural legality check examines the path marker timing according to the state machine rules to identify illegal and out-of-order path codes; and the resource boundary check counts the actual resources inside the encoded artwork through an independent counter and compares them with the various resource declarations of the descriptor.

[0053] In some embodiments, the device state data further includes a set of allowed orientations, tool envelope, positioning error, calibration uncertainty, and no-entry zones. The device-independent artwork representation includes artwork aspect ratio and stroke topology. The calculation of the layout transformation of the device-independent artwork representation from artwork coordinate space to drawing medium coordinate space based on a compilation snapshot includes: Select a direction transformation from the set of allowed directions, determine candidate pen placement areas after considering tool envelope, positioning error, calibration uncertainty, and no-entry zones, and calculate a uniform scaling ratio and translation amount within the candidate pen placement areas; select a feasible layout while maintaining the aspect ratio and stroke topology of the artwork to obtain the layout transformation.

[0054] It is understandable that the artwork cannot be rotated at any angle and must be selected within the set of allowed directions to prevent it from exceeding the processing range of the mechanism; the calculation of the pen stroke area must take into account the physical volume of the tool, equipment error, and prohibited areas to avoid collisions and boundary violations during drawing; uniform scaling is used to maintain the aspect ratio and stroke topology of the original drawing to prevent the graphics from being stretched and deformed and the connection relationship of lines from being destroyed, and to ensure that the output graphics are consistent with the geometric semantics of the original artwork.

[0055] In this embodiment, the layout transformation is obtained by following these steps: Read the device status data in the compilation snapshot, and extract the allowed direction set, tool envelope parameters, positioning error parameters, calibration uncertainty parameters, and no-entry zone boundaries; read the device-independent artwork representation, and extract the original artwork aspect ratio and stroke topology; Select one of the allowed directions from the set of allowed directions as the direction transformation; the direction transformation represents the overall rotation angle of the artwork. By combining the physical space dimensions of the tool envelope, superimposing the positioning error margin and calibration uncertainty margin, and then subtracting the space occupied by the restricted area, the candidate pen-landing areas on the medium that can be safely used for drawing are calculated, and the boundary coordinates of the candidate pen-landing areas are output. Based on the boundary of the candidate pen-writing area and the original size of the artwork, the uniform scaling ratio is calculated: the scaling factor of the X-axis and the scaling factor of the Y-axis are taken to be the same value to ensure that the aspect ratio remains unchanged; then the translation amount is calculated so that the entire artwork after the orientation transformation and scaling falls completely into the interior of the candidate pen-writing area. Verify the solution results: Verify that the aspect ratio of the transformed artwork remains consistent with the original artwork, and that the topological connections between strokes remain unchanged; if the constraints are satisfied, the solution is determined to be a feasible layout; combine the selected direction transformation, uniform scaling ratio, and translation amount into layout transformation parameters. If no feasible layout exists in the candidate set, terminate the drawing task and do not generate a physical execution plan.

[0056] Among them, the allowed direction set represents the set of rotation directions that the artwork can adopt, which is pre-defined by the device; the tool envelope is the spatial range occupied by the physical entity of the drawing tool; the positioning error comes from the inherent positioning deviation parameter of the device; the calibration uncertainty describes the uncertain error range that still exists after the device is calibrated; the forbidden zone represents the spatial area on the drawing medium and mechanism where the pen is prohibited from being placed and the mechanism is prohibited from entering; the candidate pen placement area represents the medium area where the pen can safely place and draw after considering the constraints of the tool envelope, positioning error, calibration uncertainty, and forbidden zone; the artwork aspect ratio is the ratio of the width to the height of the device-independent artwork in the artwork coordinate space; the stroke topology is the connection and adjacency relationship between strokes within the artwork; the uniform scaling ratio represents the use of the same scaling factor for the X and Y axes to avoid graphic stretching distortion; the feasible layout needs to meet all safety constraints while retaining the original artwork aspect ratio and stroke topology; the layout transformation consists of direction transformation, uniform scaling ratio, and translation amount, realizing the mapping of artwork coordinates to medium coordinates.

[0057] This embodiment restricts the selection of layout transformations to only allow transformations within the set of permitted directions, adopts uniform scaling and maintains the topology of the original strokes, avoids the problems of pattern proportion distortion and incorrect line placement caused by illegal layouts, and further ensures the consistency between the output graphic and the original artwork.

[0058] In some embodiments, the device-independent artwork representation further includes stroke paths and pen lift paths between adjacent strokes. Converting the device-independent artwork representation into a physical execution plan based on layout transformation involves two processing passes: The first pass of the process involves a complete scan of the device-independent artwork representation, calculation of resource usage, determination of layout transformations, and calculation of the layout summary. The second processing repeats the first processing process, and converts the stroke path and the lifting path between adjacent strokes into physical coordinates and actuator states to generate the physical execution plan. After confirming that the representation identifiers, artwork content summaries, resource usage, and layout summaries obtained from the two processing passes are consistent, output the physical execution plan.

[0059] It is understandable that after the artwork is stored in memory, memory bit flips may occur during the compilation scan, causing changes to the artwork data in memory. A single scan cannot identify the data anomalies that occur in memory during the compilation process. By performing two independent scans, resources are counted, the layout is solved, and fingerprints are calculated. If the two fingerprints are completely consistent, it proves that there are no anomalies in the artwork and layout calculation results in memory during the compilation process, ensuring the reliability of the output physical execution plan. If any item is inconsistent, no executable physical execution plan will be output.

[0060] In this embodiment, the processing is performed as follows: First pass: Fully traverse and read the same device-independent artwork representation residing in memory; during traversal, count the number of paths and coordinate points to obtain resource usage; use the compiler snapshot parameters to independently solve for the layout transformation; encode the representation identifier, artwork content summary, layout input conditions, and layout transformation results in a fixed field order, and perform a hash operation to obtain the layout summary; save the representation identifier, artwork content summary, resource usage, and layout summary of this scan as the first set of baseline fingerprints; the first pass only completes the scan statistics and layout solution, and does not generate a complete executable physical execution plan; The second processing step involves: again fully traversing and reading the same device-independent artwork representation in memory, repeatedly performing resource usage statistics, independently resolving the layout transformation, recalculating the layout summary, and extracting the representation identifier and artwork content summary corresponding to this scan; after completing the above self-check calculations, performing coordinate transformation on all stroke paths within the artwork and the pen lifting paths between adjacent strokes, converting the abstract artwork coordinates into physical coordinates, synchronously generating the execution mechanism state corresponding to each path segment, and assembling to generate a physical execution plan; thus obtaining the second set of comparison fingerprints; The first set of baseline fingerprints is compared with the second set of fingerprints item by item: the comparison items include the representation identifier, the artwork content summary, the resource usage, and the layout summary; if all four items match, the physical execution plan is output for subsequent motion pre-detection; if any item does not match, the physical execution plan is discarded, no physical execution plan that can enter the execution state is output, and the drawing task is terminated.

[0061] The process includes: stroke path (representing the trajectory of a pen in the artwork as it contacts the medium); lift-off path (representing the movement trajectory of a pen lifting off the medium between adjacent strokes); two passes (a self-check process during compilation to perform two independent and complete scans of the same device-independent artwork representation in memory); resource usage (including the number of paths and coordinate points obtained from scanning the artwork); layout summary (a hash value obtained by hashing the artwork identity information, layout input conditions, and layout transformation results according to fixed encoding rules); representation identifier (a unique identifier for the artwork); and artwork content summary (a hash of all original bytes of the encoded artwork). The first pass completes the artwork scanning, resource statistics, layout solving, and layout summary calculation, but does not generate a complete physical execution plan. The second pass rescans the artwork, repeats resource statistics and layout solving, and then performs coordinate transformation to generate a physical execution plan. The four fingerprints from both passes are compared, and the plan is only output if all four match, used to identify memory bit flips and data tampering during the compilation process.

[0062] In some embodiments, such as Figure 3 As shown, the physical safety constraints include the allowed pen-writing area, the allowed pen-lifting space, and the safe range of joint movement. The motion pre-checking of the physical execution plan based on these physical safety constraints includes: The physical execution plan is analyzed to obtain the execution pen placement area, execution pen lifting passage space, and execution joint activity state corresponding to the current motion stage. After confirming that the execution pen placement area falls within the allowed pen placement area, the execution pen lifting passage space is within the allowed pen lifting passage space, and the execution joint activity state is within the safe joint activity state range, the motion pre-check of the physical execution plan is completed.

[0063] It's understandable that if only the start and end points of the path are checked, the middle sections might enter restricted areas or exceed joint limits, causing collisions and damaging the equipment. Motion pre-inspection verifies the pen-laying area, pen-lifting space, and joint movement status segment by segment along the path, intercepting unsafe paths before execution and preventing hardware safety incidents.

[0064] In this embodiment: Read the physical safety constraints in the compilation snapshot, and parse and extract the allowed pen-writing area, the allowed pen-lifting space, and the range of safe joint movement. The physical execution plan is analyzed segment by segment, dividing the plan into several motion stages; the drawing motion stage and the pen lifting and moving motion stage are distinguished. For each movement phase, analyze the entire path trajectory of that phase, calculate the execution pen-starting area and execution pen-lifting passage space corresponding to that movement phase, and solve the activity state of all execution joints corresponding to the entire path movement point by point; Perform three layers of safety checks: determine that the entire pen-writing area of ​​this stage is completely within the boundary of the allowed pen-writing area; determine that the entire pen-lifting passage space is completely within the allowed pen-lifting passage space; and determine that the activity state of each joint throughout the entire path is within the range of safe joint activity states.

[0065] If all three conditions are met simultaneously in all motion phases, the motion pre-check passes; if any condition is not met in any motion phase, the motion pre-check fails, the drawing task is terminated, and no plan binding information is generated.

[0066] Among them, the allowed pen-landing area is a physical safety constraint, representing the spatial range within which the pen can contact the drawing medium to draw; the allowed pen-lifting passage space represents the space within which the tool and actuator are allowed to move and pass when the pen is lifted; the joint safety activity range represents the set of states that constrain the angles and postures of each joint to avoid joint limits, singular configurations, and mechanism collisions; the motion phase is the segmented motion process within the physical execution plan, divided into the pen-landing drawing phase and the pen-lifting movement phase; the executed pen-landing area represents the medium space position corresponding to the planned pen-landing path; the executed pen-lifting passage space is the space traversed by the planned pen-lifting path; the executed joint activity state is the posture of each joint of the mechanism during the path operation; the motion pre-check checks each segment of the path before execution to ensure that all intermediate positions and joint postures fall within the safety constraints, not just the path endpoints.

[0067] In some embodiments, the current state version identifier set includes several current state version identifiers, the initial state version identifier set includes several initial state version identifiers, and there is a one-to-one correspondence between the several current state version identifiers and the several initial state version identifiers. A consistency check is performed based on the plan binding information, including: Each current state version identifier is compared with each initial state version identifier to ensure that each current state version identifier is the same as the corresponding initial state version identifier. The current pose is compared with the initial pose to ensure that the current pose is the same as the initial pose; The consistency check passes when both of the above conditions are met.

[0068] It is understandable that the device's configuration, calibration, media, tools, and other states may be modified after compilation but before the first motion command is submitted. If the device state changes, the original physical execution plan will no longer be suitable for the current physical environment. Only after verifying that the device state has not changed through version identification and attitude comparison will the plan be allowed to execute.

[0069] like Figure 4 As shown, the consistency check in this embodiment includes the following stages: During the admission phase, a status read request is sent to each individual status owner to collect the real-time current status version identifier and aggregate them to form a current status version identifier set; at the same time, the sensor data of the drawing execution mechanism is read to obtain the current attitude of the device. Read the plan binding information, extract the set of initial state version identifiers and the initial attitude stored internally; establish a one-to-one mapping relationship between the current state version identifier and the initial state version identifier according to the mapping relationship of the state owner; Traverse the mapping relationship and compare the current state version identifier of each item with the initial state version identifier corresponding to the owner of that state; if all state version identifier comparison results are equal, the version verification condition is met; if any pair of version identifiers are not equal, the version verification condition is not met. The current attitude read in real time is compared with the initial attitude saved in the plan binding information. If all attitude parameters are completely consistent, the attitude verification condition is met; if there is a deviation in attitude, the attitude verification condition is not met. Version verification and attitude verification conditions must be met simultaneously for the consistency verification to pass; if either condition is not met, the consistency verification fails and the execution command is prohibited from being issued.

[0070] The initial state version identifier set represents the set of state version identifiers output by each state owner at the time of compilation snapshot generation, and is stored in the plan binding information as a baseline. The current state version identifier set represents the set of state version identifiers read in real time from each state owner before the execution command is issued. Each device state owner corresponds to one initial version identifier and one current version identifier. The initial attitude is used for compilation snapshot recording and is the initial joint attitude of the drawing execution mechanism at the start of compilation. The current attitude is the mechanism attitude read in real time during the execution admission phase. The consistency check is used to confirm that the critical states of the device have not changed during the time period from compilation completion to preparation for execution.

[0071] Through a two-stage compilation self-check process and refined motion pre-check judgment conditions, it can identify planning errors caused by memory anomalies during the compilation process, realize layered safety verification of pen placement, pen lifting, and joint status, further reduce the probability of robotic arm jamming and mechanism collision. At the same time, it refines the comparison logic between status version identifier and posture, making the judgment basis for consistency verification clearer and more rigorous, reducing status misjudgment and omission, and strengthening the ability to intercept outdated plans.

[0072] In some embodiments, a one-time task authorization is obtained from the drawing device before the consistency check. After the one-time check is passed and before the execution instruction is issued to the drawing device, the one-time task authorization is atomically converted from an unconsumed state to a consumed state.

[0073] It is understandable that repeated retransmission of network packets or retrying due to abnormal device restarts could lead to the same drawing task being started and executed multiple times. One-time task authorization undergoes an atomic state switch; once the authorization is marked as consumed, it cannot be used again, thus preventing the same task from being executed repeatedly.

[0074] Before initiating the consistency verification process in this embodiment, the drawing device requests the one-time task authorization corresponding to this task from the local authorization management module based on the current drawing task identifier; verifies the authorization validity time and task association identifier to confirm that the authorization is legal and usable, and the authorization is in an unconsumed state at this time; if a legal and valid one-time task authorization cannot be obtained, the drawing task is terminated directly; when the consistency verification result is determined to be passed, before issuing the execution instruction to the drawing execution mechanism, the persistent anti-replay state module is called to perform an atomic state transition operation on the one-time task authorization: switching the authorization state from the unconsumed state to the consumed state; only when the atomic state transition operation is fully executed and returns success is it allowed to continue sending the execution instruction; if the atomic transition operation fails, the authorization state is not changed, and the issuance of the execution instruction is prohibited, and the task enters a failed state.

[0075] One-time task authorization refers to an authorization credential bound to a drawing task and that can only be consumed once. Unconsumed state: The authorization has not yet been used and can be used to start a drawing task; Consumed state: The authorization has been used up and cannot be used again; The state transition operation is indivisible, either the state change is completed completely or no change occurs at all, and there will be no intermediate state; This mechanism is used to resist the risk of task duplication caused by network retransmission and retries.

[0076] This embodiment uses an atomic consumption mechanism with one-time task authorization to avoid repeated task execution caused by network retransmission or device restart.

[0077] In some embodiments, during the execution of the physical execution plan, it is detected in real time whether all state version identifiers at the current moment are the same as the corresponding initial state version identifiers in the initial state version identifier set. If they are the same, the motion plan continues to be executed until it is completed, and the execution is output as successful. If not, the stop process is entered.

[0078] It is understandable that if the status of equipment configuration, calibration, media, tools, etc., is modified during the execution of a drawing task, the currently running physical execution plan will no longer be compatible with the changed physical conditions; continuing to run will result in the risk of going out of bounds and collisions; real-time monitoring of version identifiers will immediately initiate a stop process if inconsistencies are found, to ensure the safe operation of the equipment.

[0079] In this embodiment, throughout the entire motion execution cycle, the system continuously reads the real-time output current state version identifier from each state owner according to a preset detection cycle; reads the initial state version identifier set stored in the plan binding information; compares each real-time read current state version identifier with the corresponding initial state version identifier according to the one-to-one correspondence between state owners; if all current state version identifiers are equal to the corresponding initial state version identifiers, it is determined that the device state has not changed, and the physical execution plan continues to be executed; the reading and comparison are repeated cyclically until all motion paths are completed, and the execution success result is output; when any current state version identifier output by any state owner is inconsistent with the corresponding initial state version identifier, the stop process is immediately triggered: the actuator is controlled to lift the pen, all new motion commands are stopped, the actuator moves to the preset safe evacuation position, the current drawing task is terminated, and the task abnormal stop result is output.

[0080] Among them, real-time detection during execution involves periodically reading the status version identifiers output by each status owner during the process of the physical execution plan starting to run; the initial status version identifier set represents the baseline version identifier set recorded when the compilation snapshot is generated; when entering the stop process, the device is controlled to lift the pen and safely withdraw, terminating the drawing task and no longer continuing to execute the remaining motion path; this logic is used to handle the safety protection of changes in device status during task execution.

[0081] This embodiment adds runtime protection by continuously monitoring the status version identifier during the movement process. Once the working conditions change, the stop process is triggered immediately. In addition to the planned compilation and verification, it adds a safety defense line in the running phase, comprehensively reducing the risk of drawing errors, mechanical damage and abnormal task shutdown, and improving the robustness of the whole solution in the industrial field.

[0082] In Example 1 of this embodiment, the following steps are performed: Step 1: The device receives the artwork representation R1. The artwork representation R1 consists of a closed stroke formed by five points: (0,0), (1000,0), (1000,500), (0,500), and (0,0). The artwork bounding box is 1000 artwork units by 500 artwork units and carries the representation identifier R1, artwork content summary HA, actual data length, one path, and resource claims for the five points. The registration area of ​​the drawing medium is 180 mm by 120 mm, with a safe indentation of 5 mm on all four sides, allowing orientations of zero and ninety degrees. At the start of compilation, the configuration, kinematics, zeroing reference, and positional trust state version identifiers are 11, 22, 31, and 41, respectively. The device is in the initial pose P0 and the pen is in the raised state.

[0083] Step 2: The device calculates a digest for the original received bytes, and the resulting digest is consistent with HA; the data length, frame number, cyclic redundancy check value, path lifetime, and actual counts of one path and five points are all consistent with the declaration, and the coordinate accumulation and size calculation do not overflow. The device outputs a verified drawing representation V1, without outputting any part of the physical plan;

[0084] The device shrinks the media registration area inward by 5 mm on each of its four sides, resulting in a candidate pen placement area of ​​170 mm by 110 mm, with an abscissa ranging from 5 mm to 175 mm and an ordinate ranging from 5 mm to 115 mm. The device freezes the mechanism configuration, calibration, media registration, tool status, initial pose, and status version identifier used in this compilation, forming a compilation snapshot S1 and a compilation snapshot summary HS1.

[0085] Step 3: The uniform scale for the zero-degree direction is min(170 / 1000, 110 / 500) = 0.17 mm per artwork unit; the uniform scale for the 90-degree direction is min(170 / 500, 110 / 1000) = 0.11 mm per artwork unit. The device selects the zero-degree direction and scale 0.17, and obtains the transformation T(x, y) = (0.17x + 5, 0.17y + 17.5) according to the centering rule. The layout bounding box is set to 5 mm to 175 mm on the horizontal axis and 17.5 mm to 102.5 mm on the vertical axis. The device outputs the layout result L1 and the layout summary HL1.

[0086] Step 4: The device uses the calibration transformation and mechanism kinematics in compilation snapshot S1 to convert the above five drawing points into medium coordinates, machine Cartesian coordinates, and joint states; it then pre-checks the pen lifting path from the initial posture P0 to the starting point of the stroke, the four closed pen landing segments, and the pen lifting and parking paths after the stroke ends. Each continuous segment, inverse kinematics branch, joint limit, velocity, acceleration, and execution budget all pass the pre-check, forming two planning blocks, six physical segments, and six motion operations;

[0087] The device generates summaries HB1 and HB2 for two planning blocks respectively, and forms the planning block summary root HBR according to the planning block order. The device generates planning binding information PS1, which binds the task identifier, representation identifier R1, artwork content summary HA, layout summary HL1, compilation snapshot summary HS1, status version identifier set, planning block summary root HBR, initial pose P0, and final parking pose.

[0088] Step 5: Before submitting the first motion command, the device rereads the configuration, kinematics, zeroing reference, and position confidence status. The resulting status version identifiers remain 11, 22, 31, and 41, respectively. The current attitude remains P0, and the pen is in the raised state. The recalculated artwork summary, layout summary, compilation snapshot summary, and plan block summary roots are consistent with HA, HL1, HS1, and HBR, respectively. The execution resources and task validity time meet the requirements. The execution admission verification is successful.

[0089] The device outputs a fully pre-checked and plan-bound physical execution plan, summary tables for both plan blocks, the plan block summary root (HBR), and plan binding information (PS1), and puts the task into an executable state. When using a one-time task authorization, the device atomically consumes the authorization before the first motion command, and only allows the submission of the first motion command after successful consumption.

[0090] In Example 2 of this embodiment, the device has formed a layout result L1, two plan blocks, and plan binding information PS1 based on the artwork representation R1 and compilation snapshot S1 of Example 1; however, before the first motion command is submitted, the configuration owner completes a configuration update that affects the work area or motion restrictions, changing the current configuration status version identifier from 11 to 12, while the original artwork bytes, artwork content summary HA, media registration area, and two plan blocks remain unchanged.

[0091] At this point, the device recalculates the original artwork byte digest and verifies the artwork structure. The resulting artwork content digest is still HA, indicating that the identifier, path count, and point count are consistent. Therefore, the artwork verification layer passes, eliminating the possibility of inconsistent artwork input.

[0092] The device then recalculates the layout summary based on the same candidate pen stroke area, direction, scale, and translation amount. The result is still HL1, so the layout check layer passes and the inconsistency in the layout results is eliminated.

[0093] Finally, the device rereads the current state and generates a current build snapshot S2. Since the configuration state version identifier is 12, while the corresponding version identifier recorded in the plan binding information PS1 is 11, the current build snapshot summary HS2 is inconsistent with HS1. The device thus determines the first level of inconsistency as the device state and generates a diagnostic result including the device state stage, the reason for the state version inconsistency, the configuration owner identifier, the expected version 11, and the current version 12.

[0094] Processing Result: The device does not continue admissions using the old plan, does not send the two plan blocks to the motion actuator, does not consume the one-time task authorization used to start the old plan, and does not submit the first motion command. When the drawing task needs to continue, the device rebuilds the compilation snapshot, re-layouts, re-preflights, and generates new plan binding information based on the current configuration of version 12.

[0095] The device outputs a task result of "device status inconsistent, failed and not moving," with zero plan blocks sent to the motion actuator and zero first motion command submissions. This result distinguishes it from drawing verification failure, layout failure, or plan block summary failure, thus completing the hierarchical identification of the reason for this rejection.

[0096] In some embodiments, this application provides a device-side compilation and secure execution apparatus for device-independent artwork, including an artwork generation side and a drawing device. The artwork generation side is used to generate a device-independent artwork representation, and the drawing device is used to execute the device-side compilation and secure execution method for device-independent artwork as described in any of the above embodiments.

[0097] It should be noted that the device-side compilation and secure execution system for device-independent drawings provided in this application embodiment and the device-side compilation and secure execution method for device-independent drawings provided in this application embodiment are based on the same inventive concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned device-side compilation and secure execution method for device-independent drawings, and the repeated parts will not be described again.

[0098] In some embodiments, an electronic device provided in this application includes a processor and a memory; the memory stores a stored computer program, wherein the computer program, when executed by the processor, implements the above-described device-independent drawing device-side compilation and secure execution method.

[0099] Specifically, the processor may include, for example, a general-purpose microprocessor, an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor may also include onboard memory for caching purposes. The processor may be a single processing unit or multiple processing units for performing different actions of the method flow according to embodiments of this application.

[0100] Memory can be any medium capable of containing, storing, transmitting, propagating, or transmitting instructions. For example, memory can include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, instruments, or propagation media. Specific examples of memory include: magnetic storage devices such as magnetic tape or hard disk drives (HDDs); optical storage devices such as optical discs (CD-ROMs); and also random access memory (RAM) or flash memory; and / or wired / wireless communication links.

[0101] This application also provides a computer-readable medium storing a computer program that, when executed by a processor, implements the device-side compilation and secure execution method for device-independent drawings described above. This computer-readable medium may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into that device / apparatus / system. The aforementioned computer-readable medium carries one or more programs, which, when executed, implement the method as described in the embodiments of this application.

[0102] According to embodiments of this application, a computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wired, optical fiber, radio frequency signals, etc., or any suitable combination thereof.

[0103] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application. Therefore, the scope of this application should not be limited to the above embodiments. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for device-side compilation and secure execution of device-independent drawings, characterized in that, include: Obtain device-independent drawing representation and drawing device information associated with the drawing task. The drawing device information includes device status data and an initial state version identifier set. The device status data includes drawing medium status, physical security constraints, and initial attitude. For device-independent drawings, integrity checks, structural checks, and resource boundary checks are performed. After the checks pass, a compilation snapshot is constructed based on the device status data and the initial state version identifier set. Based on the compilation snapshot, the layout transformation of the device-independent artwork representation from the artwork coordinate space to the drawing medium coordinate space is calculated, and the device-independent artwork representation is converted into a physical execution plan according to the layout transformation; Based on the physical security constraints, motion pre-check is performed on the physical execution plan. After the motion pre-check passes, plan binding information is constructed. The plan binding information is used to bind the physical execution plan, the representation identifier of the device-independent artwork representation, the artwork content summary, the layout transformation, the compilation snapshot, the state version identifier set, and the initial pose to each other. Obtain the current state version identifier set and the current attitude, perform a consistency check based on the plan binding information, and only when the consistency check passes, issue an execution command to the drawing device to execute the physical execution plan until execution is completed.

2. The device-side compilation and secure execution method for device-independent drawings as described in claim 1, characterized in that, The drawing device information includes device capability information, and obtaining the device-independent drawing representation includes: Retrieve a list of artworks containing multiple artwork representation descriptors, each artwork representation descriptor including a precision parameter; Select several candidate artwork representation descriptors that match the equipment capability information from multiple artwork representation descriptors; Select the candidate artwork representation descriptor with the highest precision parameter to obtain a qualified artwork representation descriptor; Obtain qualified coded artwork data corresponding to the qualified artwork representation descriptor from the artwork generation side, and combine the qualified artwork representation descriptor and the qualified coded artwork data to construct a device-independent artwork representation.

3. The device-side compilation and secure execution method for device-independent drawings as described in claim 2, characterized in that, The qualified artwork representation descriptor includes a total data length declaration, a path unit length declaration, a path quantity declaration, a coordinate point quantity declaration, and a coordinate extreme value range declaration. The drawing device information also includes path state machine transition rules. The execution of integrity checks, structure checks, and resource boundary checks on the device-independent artwork representation includes: Calculate the actual total byte length of the encoded artwork data, confirm that the actual total byte length is consistent with the declared total data length, and complete the integrity verification of the device-independent artwork representation: Based on the path state machine transition rules, verify the timing logic of the path markers within the coded drawing data, confirm the legality of the arrangement order of the path start marker, coordinate point sequence, and path end marker, and complete the structural verification of the device-independent drawing representation; The actual number of paths, actual number of coordinate points, and actual coordinate extreme value range within the statistical coding artwork data are verified to ensure that the actual number of paths, actual number of coordinate points, and actual coordinate extreme value range are consistent with the declared number of coordinate points, thus completing the boundary verification of the device-independent artwork representation resources.

4. The device-side compilation and secure execution method for device-independent drawings as described in claim 1, characterized in that, The device status data also includes the allowed orientation set, tool envelope, positioning error, calibration uncertainty, and no-entry zone. The device-independent artwork representation includes the artwork aspect ratio and stroke topology. The calculation of the layout transformation of the device-independent artwork representation from the artwork coordinate space to the drawing medium coordinate space based on the compilation snapshot includes: Select a direction transformation from the set of allowed directions, determine candidate pen placement areas after considering tool envelope, positioning error, calibration uncertainty, and no-entry zones, and calculate a uniform scaling ratio and translation amount within the candidate pen placement areas; select a feasible layout while maintaining the aspect ratio and stroke topology of the artwork to obtain the layout transformation.

5. The device-side compilation and secure execution method for device-independent drawings as described in claim 1, characterized in that, The device-independent artwork representation also includes the stroke path and the stroke lifting path between adjacent strokes. Converting the device-independent artwork representation into a physical execution plan based on layout transformation involves two processing passes: The first pass of the process involves a complete scan of the device-independent artwork representation, calculation of resource usage, determination of layout transformations, and calculation of the layout summary. The second processing repeats the first processing process, and converts the stroke path and the lifting path between adjacent strokes into physical coordinates and actuator states to generate the physical execution plan. After confirming that the representation identifiers, artwork content summaries, resource usage, and layout summaries obtained from the two processing passes are consistent, output the physical execution plan.

6. The device-side compilation and secure execution method for device-independent drawings as described in claim 1, characterized in that, The physical safety constraints include the allowed pen-writing area, the allowed pen-lifting space, and the safe range of joint movement. The motion pre-checking of the physical execution plan based on these physical safety constraints includes: The physical execution plan is analyzed to obtain the execution pen placement area, execution pen lifting passage space, and execution joint activity state corresponding to the current motion stage. After confirming that the execution pen placement area falls within the allowed pen placement area, the execution pen lifting passage space is within the allowed pen lifting passage space, and the execution joint activity state is within the safe joint activity state range, the motion pre-check of the physical execution plan is completed.

7. The device-side compilation and secure execution method for device-independent drawings as described in claim 1, characterized in that, The current state version identifier set includes several current state version identifiers, and the initial state version identifier set includes several initial state version identifiers. There is a one-to-one correspondence between the current state version identifiers and the initial state version identifiers. A consistency check is performed based on the plan binding information, including: Compare each current state version identifier with a number of initial state version identifiers one by one to ensure that each current state version identifier is the same as the corresponding initial state version identifier. The current pose is compared with the initial pose to ensure that the current pose is the same as the initial pose; The consistency check passes when both of the above conditions are met.

8. The device-side compilation and secure execution method for device-independent drawings as described in claim 1, characterized in that, Before the consistency check, a one-time task authorization is obtained from the drawing device. After the one-time check is passed and before the execution instruction is issued to the drawing device, the one-time task authorization is atomically converted from an unconsumed state to a consumed state.

9. The device-side compilation and secure execution method for device-independent drawings as described in claim 1, characterized in that, During the execution of the physical execution plan, it is checked in real time whether all state version identifiers at the current moment are the same as the corresponding initial state version identifiers in the initial state version identifier set. If they are the same, the motion plan continues to be executed until it is completed, and the execution is output as successful. If not, the stop process is entered.

10. A device-side compilation and secure execution system for device-independent drawings, characterized in that, The system includes an artwork generation side and a drawing device, wherein the artwork generation side is used to generate a device-independent artwork representation, and the drawing device is used to execute the device-side compilation and secure execution method for device-independent artwork as described in any one of claims 1-9.