Writing control method and device, writing robot and storage medium
By employing a hybrid degradation path planning strategy, the problem of balancing fluency and efficiency in robot writing was solved, resulting in highly efficient writing performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU ISOFTSTONE TIANQING ROBOT TECHNOLOGY CO LTD
- Filing Date
- 2026-01-08
- Publication Date
- 2026-04-28
AI Technical Summary
Existing robot writing path planning strategies struggle to balance writing fluency and efficiency when dealing with complex or nuanced writing content, often resulting in frequent robot starts and stops that affect writing quality.
A hybrid degradation approach is used to plan the writing path. By acquiring the writing task, a sequence of control points is generated. If the planning is successful in one go, the target path is determined. Otherwise, the control point sequence is divided into subsequences for planning to ensure writing fluency and efficiency.
It achieves improved writing efficiency while ensuring smooth writing, avoids frequent start-stop cycles of the robot, and improves writing quality.
Smart Images

Figure CN121928545A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of robot control technology, and in particular to a writing control method, device, writing robot and storage medium. Background Technology
[0002] With the development of automation technology, robotic writing and drawing systems are widely used in education, artistic creation, and personalized product processing. These systems receive specific writing tasks and convert them into motion trajectories for the robot's end effector.
[0003] However, existing path planning strategies often face challenges when dealing with complex, continuous, or subtly detailed writing content. A common strategy is to attempt to plan a complete, continuous path for the entire stroke or shape in one go. While this achieves optimal smoothness and efficiency when successful, for geometrically complex paths with dramatic curvature changes, one-time planning is prone to failure due to lack of a solution or excessive planning time, leading to task interruption. Another more conservative strategy is to use fixed segments for planning and execution regardless of path complexity. While this approach is more robust, it causes frequent robot starts and stops, disrupting the flow of writing and creating unnecessary jitter or pauses at stroke connections, severely impacting writing quality and appearance.
[0004] Therefore, how to provide a technical solution that can balance the writing fluency and writing efficiency of writing robots is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] This application provides a writing control method, device, writing robot, and storage medium. By planning the writing path through a hybrid degradation approach, the writing path can be autonomously planned, thereby improving writing efficiency while ensuring the writing smoothness of the writing robot.
[0006] According to one aspect of this application, a writing control method is provided, the method comprising: In response to a writing instruction being triggered, the writing task corresponding to the writing instruction is obtained; The writing task is parsed to generate a writing data file; wherein, the writing data file includes a sequence of control points arranged in writing order; Based on the written data file, a writing path is planned, and the planning result is determined; If the planning result is successful, the target writing path is determined based on the planning result; otherwise, the control point sequence is divided into at least two sub-sequences, and the writing path is planned based on the sub-sequences to determine the target writing path, so as to control the writing robot to perform writing actions based on the target writing path.
[0007] According to another aspect of this application, a writing control device is provided, characterized in that the device comprises: The writing task acquisition module is used to acquire the writing task corresponding to the writing instruction in response to the writing instruction being triggered. The writing task parsing module is used to parse the writing task and generate a writing data file; wherein, the writing data file includes a sequence of control points arranged in writing order; The writing path planning module is used to plan the writing path based on the writing data file and determine the planning result. The writing path execution module is used to determine the target writing path based on the planning result if the planning result is successful; otherwise, it divides the control point sequence into at least two sub-sequences and performs writing path planning based on the sub-sequences to determine the target writing path, so as to control the writing robot to perform writing actions based on the target writing path.
[0008] According to another aspect of this application, a writing robot is provided, the writing robot comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the writing control method described in any embodiment of this application.
[0009] According to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the writing control method described in any embodiment of this application.
[0010] According to another aspect of this application, a computer program product is provided, the computer program product including a computer program that, when executed by a processor, implements the writing control method described in any embodiment of this application.
[0011] The technical solution provided in this application obtains a writing task corresponding to a writing instruction in response to the instruction; parses the writing task to generate a writing data file, wherein the writing data file includes a sequence of control points arranged in writing order; performs writing path planning based on the writing data file and determines the planning result; if the planning result is successful, a target writing path is determined based on the planning result; otherwise, the control point sequence is divided into at least two sub-sequences, and writing path planning is performed based on the sub-sequences to determine the target writing path, thereby controlling the writing robot to perform writing actions based on the target writing path. This technical solution plans the writing path through a hybrid degradation method to achieve autonomous planning of the writing path, improving writing efficiency while ensuring the smoothness of the writing robot's writing.
[0012] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments 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.
[0014] Figure 1 This is a flowchart of a writing control method provided in Embodiment 1 of this application.
[0015] Figure 2 This is a flowchart of a writing control method provided in Embodiment 2 of this application.
[0016] Figure 3 This is a schematic diagram of a writing control device provided in Embodiment 3 of this application.
[0017] Figure 4 This is a schematic diagram of the structure of a device that implements a writing control method according to an embodiment of this application. Detailed Implementation
[0018] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0019] It should be noted that the terms "to be drawn," "to be written," "sub," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0020] Example 1 Figure 1 This is a flowchart of a writing control method provided in Embodiment 1 of this application. This embodiment is applicable to the control of a writing robot. The method can be executed by a writing control device, which can be implemented in hardware and / or software. The writing control device can be configured in a device with data processing capabilities. Figure 1 As shown, the method includes the following steps.
[0021] S110. In response to the writing instruction being triggered, obtain the writing task corresponding to the writing instruction.
[0022] The writing instruction is a writing signal triggered by the user, which may include the writing content, the writing font, the writing layout, and so on.
[0023] For example, writing commands can be triggered based on controls in the interactive interface. For instance, a user can input "write the ancient poem 'Spring Dawn'" in the interactive interface, or select "Calligraphy Creation" from the drop-down menu, input the text "All rivers run into the sea," and click "Generate." Alternatively, writing commands can be triggered by hardware or voice, such as a user pressing the "Start" button on the writing robot or speaking the voice command "Draw a cat."
[0024] A writing task refers to the original data object corresponding to a writing instruction. The writing task can be obtained based on semantic understanding and text extraction. For example, for the writing instruction "Write the ancient poem 'Spring Dawn'", the writing task is to write the content of the ancient poem corresponding to "Spring Dawn".
[0025] In some embodiments, optionally, after obtaining the writing task corresponding to the writing instruction in response to the writing instruction being triggered, the method further includes: locking the writing task.
[0026] In this application, the writing task can be locked based on atomic locks and custom thread management.
[0027] An atomic lock uses a shared integer variable to represent the lock's state; for example, `lock_state = 0` indicates the lock is free, and `lock_state = 1` indicates it is held. When attempting to acquire a lock, a thread atomically executes the following: "If `lock_state` is currently 0, set it to 1 (lock acquisition successful); otherwise, it fails (lock already held)." Associating an atomic lock with each writing task object ensures that any thread performing a critical operation on that task, such as modifying its state or starting parsing, must successfully acquire this lock. This guarantees that only one thread can process a specific task at a time.
[0028] Custom thread management refers to a user-space lightweight scheduling mechanism, including a task queue, a worker thread pool, and a scheduler. The task queue is used to store tasks that have acquired the atomic lock and are waiting to be executed; the worker thread pool is a fixed number of pre-created native operating system threads; the scheduler is responsible for the logic running on the worker threads, which takes tasks from the task queue and delivers them to the corresponding "execution context" (such as a coroutine) for execution.
[0029] Specifically, the main thread or network request thread receives a new writing instruction and generates a corresponding writing task object. When this object is created, the associated atomic lock variable task_lock is initially in the state of 0, that is, unlocked; the thread immediately attempts to acquire the atomic lock of this task, and by calling atomic operations, attempts to set task_lock from 0 to 1; the thread that successfully acquires the atomic lock does not immediately start the time-consuming parsing and planning work, but takes the locked writing task object as a "work unit" and puts it into a global, thread-safe custom task queue; the worker threads (from the thread pool) under the custom thread management module are in a loop state, continuously fetching tasks from the above-mentioned task queue; after a worker thread fetches a task, it starts to execute the core logic chain of the task, such as parsing, path planning, etc.; after the robot completes the writing action, the worker thread marks the task status as "completed"; the worker thread calls atomic operations to release the task's task_lock from 1 back to 0; after this operation, the task becomes in a state where it can be processed again; the worker thread stores the task result in the database or returns it to the front end; the worker thread returns to the thread pool, ready to fetch the next task from the task queue.
[0030] In addition, the ROS Action server can also be adopted. The Action architecture itself has built-in complete logic for target reception, rejection, preemption, feedback, and result return. It is a standardized implementation method, which is essentially also a kind of state machine and can also achieve the purpose of robust task management.
[0031] S120. Parse the writing task to generate a writing data file; wherein, the writing data file includes a sequence of control points arranged in the writing order.
[0032] Among them, the writing data file can be a structured data set used to describe the spatial trajectory time sequence of the writing task. The writing data file can include a sequence of control points arranged in the writing order. For example, for the writing data file of the character "天", it can be the sequence of control points for each stroke, such as the long sequence of stroke data for the first stroke "一" of "天". .
[0033] Specifically, based on the writing task, a pre-built font database can be accessed to retrieve the corresponding stroke data for each Chinese character in the writing task. Then, the stroke data of each Chinese character can be arranged and laid out according to a preset layout method to obtain a writing data file.
[0034] In some embodiments, optionally, the writing data file further includes a pen state identifier for each control point, and the pen state identifier is used to represent the contact state between the writing tool and the writing surface at the control point. The pen state identifier includes a pen-lifting state and a pen-down state.
[0035] During the writing process of the writing robot, since the content to be written has multiple strokes and cannot be completed in one stroke. Therefore, the writing data file also includes a pen state identifier for each control point, that is, the contact state between the writing tool mounted on the writing robot and the writing surface, at least including the pen-down state when the writing tool touches the writing surface and the pen-lifting state when the writing tool leaves the writing surface.
[0036] Taking the first stroke "one horizontal stroke" of the character "sky" as an example for explanation. Among them, the long sequence of stroke data of "one horizontal stroke" is , and the pen state identifiers of the writing robot at point and point are the pen-lifting state, and the pen state identifiers at the remaining points are the pen-down state. When the writing robot writes, it first moves to a preset height above the point, then changes to the pen-down state to touch the writing surface, and writes in the order of to point, and moves to a preset height above the point to prepare for writing the next stroke.
[0037] In addition, the writing file data may further include the moving speed, acceleration, etc. between two adjacent control points to control the smoothness of writing and the pen tip effect.
[0038] S130. Perform writing path planning according to the writing data file to determine the planning result.
[0039] In this application, a motion planner can be called to attempt to calculate a complete Cartesian path from the starting point through the control point sequence to the end point at one time.
[0040] Specifically, based on the joint motion range limit, speed / acceleration limit, torque / torsion constraint, and end effector attitude constraint of the writing robot, constraint conditions can be constructed; under the constraint conditions, a path search and preliminary planning are performed on the control point sequence arranged in the writing order to obtain the planning result.
[0041] In some embodiments, optionally, writing path planning is performed based on the writing data file to determine the planning result, including: performing writing path planning based on the writing data file to determine an initial writing path; comparing the initial writing path with the writing data file to determine the coverage of the initial writing path; and determining the planning result based on the coverage.
[0042] The initial writing path can be either a writing path obtained by sequentially connecting each control point in the control point sequence based on the writing robot's dynamic constraints, or a writing path obtained by spline interpolation of each control point in the control point sequence based on the writing robot's dynamic constraints.
[0043] The initial writing path is compared with the control point sequence of the writing data file to determine the proportion of control points covered by the initial writing path to the total number of control points in the control point sequence; this is known as the coverage rate of the initial writing path. For example, the control point sequence of a certain stroke is... The control points covered in the planned initial writing path are Therefore, the coverage rate of the initial writing path of this stroke is 6 / 8 = 0.75.
[0044] In this application, the planning result is determined by comparing the coverage rate with a preset threshold. For example, if the preset threshold is 95%, the planning result is determined to be a failure if the coverage rate is lower than 95%; otherwise, the planning result is determined to be a success.
[0045] S140. If the planning result is successful, the target writing path is determined based on the planning result; otherwise, the control point sequence is divided into at least two sub-sequences, and the writing path is planned based on the sub-sequences to determine the target writing path, so as to control the writing robot to perform writing actions based on the target writing path.
[0046] If the planning result is successful, it indicates that the stroke is simple and smooth enough. The writing robot can directly execute this smooth, complete, and jitter-free writing path. After execution, it can lift the pen to prepare for the writing of the next stroke.
[0047] If the planning fails, it indicates that the stroke is too complex or limited by the mechanical structure of the writing robot. In this case, the path planning can be downgraded by initiating a block planning mode. Specifically, according to predetermined partitioning rules, the control point sequence is divided into at least two sub-sequences. Writing path planning is performed for each sub-sequence separately, and finally, the writing path plans corresponding to each sub-sequence are combined to obtain the target writing path.
[0048] For block planning, for example, we can first set the initial loop control variable k=1, that is, starting from the first control point, and the block size=2, that is, only the path between two adjacent points is planned each time. Assuming there are n control points, the first loop planning... Click to Writing paths between points, second iteration planning Click to The writing path between points is repeated until the (n-1)th iteration of the loop. Click to The writing path between points. It should be noted that if a loop planning fails during the loop planning process, the stroke planning fails. The system will adjust the pen status indicator of the writing robot's writing tool to the pen-lifting state to ensure that the writing robot hardware is in a safe posture, and release the task lock so that the writing robot returns to the "idle" state and is ready to receive new writing tasks.
[0049] This invention provides a writing control method. The method, in response to a writing instruction, acquires a writing task corresponding to the instruction; parses the writing task to generate a writing data file; the writing data file includes a sequence of control points arranged in writing order; write path planning is performed based on the writing data file, and the planning result is determined; if the planning result is successful, a target writing path is determined based on the planning result; otherwise, the control point sequence is divided into at least two sub-sequences, and writing path planning is performed based on the sub-sequences to determine the target writing path, thereby controlling a writing robot to perform writing actions based on the target writing path. This technical solution uses a hybrid degradation approach to plan the writing path, achieving autonomous writing path planning and improving writing efficiency while ensuring the writing smoothness of the writing robot.
[0050] Example 2 Figure 2 This is a flowchart of a writing control method provided in Embodiment 2 of this application. This embodiment is an optimization based on the above embodiment, specifically dividing the writing task into a drawing task and a handwriting task, and optimizing the parsing process of the writing task accordingly. Figure 2 As shown, the method in this embodiment specifically includes the following steps.
[0051] S210. In response to the writing instruction being triggered, obtain the writing task corresponding to the writing instruction; wherein, the writing task is a drawing task and a writing task, the drawing task includes an image to be drawn, and the writing task includes a text topic to be written.
[0052] Among them, the drawing task refers to using a writing robot to perform drawing assignments, which is essentially a vision-driven outline reproduction. The handwriting task refers to using a writing robot to perform handwriting assignments, which is essentially a semantically driven symbol generation.
[0053] Specifically, drawing tasks may include images to be drawn. These images can be digital pictures provided by the user, or they can be images taken by the user after triggering the "draw" command on the interactive interface. Writing tasks may include text topics, where the user enters a text topic in an input box after triggering the "write" command on the interactive interface.
[0054] S220. The writing task is parsed to generate a writing data file; wherein, the writing data file includes a sequence of control points arranged in the writing order.
[0055] In some embodiments, optionally, the writing task is parsed to generate a writing data file, including but not limited to the following steps: S2211. If the writing task is a drawing task, then edge detection and contour extraction are performed on the image to be drawn to determine the vector image corresponding to the image to be drawn.
[0056] Edge detection refers to calculating the gradient of each pixel in an image, identifying pixels with drastic gradient changes as edge points, and marking them. The result is typically a binary image where white lines represent edges and black lines represent the background. Common edge detection algorithms include Canny and Sobel.
[0057] Contour extraction refers to finding and connecting edge points belonging to the same object's boundary using boundary tracking algorithms, based on edge detection, to form one or more closed or open continuous curves, ultimately generating a vector graphic. For example, a complex image, such as a cat, may have multiple contours extracted, including the body, eyes, whiskers, etc.
[0058] Specifically, the image to be drawn can first be processed into grayscale to obtain a grayscale image; the grayscale image is then processed using the Canny edge detector, which performs Gaussian filtering, gradient calculation, non-maximum suppression, and double threshold detection to output an edge map; the findContours() function from the OpenCV library is called to perform contour searching on the edge map obtained in the previous step. This function returns a list of contours, where each contour consists of a series of ordered pixel coordinates; finally, the image is organized and saved as a structured file, i.e., a vector graphic corresponding to the image to be drawn, according to the syntax format of vector graphics such as SVG.
[0059] S2212. Discretize the vector image to generate a written data file.
[0060] Specifically, for each path, such as a curve, a series of dense points P1, P2, ..., P are sampled on the curve, constrained by a fixed chord height error or step size. n, the denser the sampling, the more accurate the restored trajectory; determine the drawing order of each path, such as from the outer contour to the inner contour; when starting to draw the first path, insert a "pen down" instruction before the starting point P1; when completing the drawing of one path and the pen needs to move to the starting point of the next path, insert a "pen up" instruction before the movement and a "pen down" instruction after the movement and before putting the pen down; finally, arrange all the sampling points of all paths, together with the pen control instructions inserted in between, in order to generate the final writing data file.
[0061] The advantage of the above technical solution is that through edge detection, contour extraction and discretization processing, complex pictures are converted into an execution data file that can be run by a writing robot, providing an accurate data basis for subsequent writing path planning.
[0062] In some embodiments, optionally, parsing the writing task to generate a writing data file includes, but is not limited to, the following steps: S2221. If the writing task is a character writing task, generate a text string corresponding to the theme of the text to be written according to the theme of the text to be written.
[0063] Among them, the theme of the text to be written can be understood as the core description of the content that the user inputs and expects to write. Its form can be a theme word, such as "spring"; it can also be a clear text, such as "The highest good is like water". The text string is the sequence of characters that will ultimately be written after being processed in this step. For example, for the theme "spring", the generated string may be "The spring breeze has once again greened the southern shore of the Yangtze River".
[0064] Specifically, when the input is a theme word, the system calls a large language model or a dedicated poetry generation model. For example, inputting the theme "spring" into the model, the model may return the string "Spring slumber goes on unaware, Everywhere birds' singing is heard". It is also possible to retrieve matching content from a preset classic poetry library according to the theme. For example, inputting "bright moon", "Raising my head, I look at the bright moon. Lowering my head, I am thinking of my hometown" is retrieved.
[0065] S2222. Parse the text string to generate a writing data file.
[0066] Among them, stroke parsing is a mapping process from character encoding to specific graphical stroke coordinates. Specifically, by calling a Chinese character stroke parser, the stroke data of the text string can be extracted from the character library and typeset into a writing data file in a unified format.
[0067] The character library can pre-store stroke order information and stroke vector data. Among them, the stroke order information is the correct stroke order for writing the character. For example, the stroke order of the character "day" is: vertical, horizontal hook, horizontal, horizontal. The stroke vector data is the geometric shape of each stroke itself, usually described by a series of control point coordinates, such as the starting point, inflection point, end point, etc.
[0068] In this application, each character in the text string can be processed character by character to determine the stroke order information and stroke vector data of each character in turn, so as to generate a writing data file.
[0069] The advantage of the above technical solution is that, through stroke analysis, text strings are transformed into standardized graphic motion data, providing an accurate data foundation for subsequent writing path planning.
[0070] S230. Based on the writing data file, perform writing path planning and determine the planning result.
[0071] S240. If the planning result is successful, the target writing path is determined based on the planning result; otherwise, the control point sequence is divided into at least two sub-sequences, and the writing path is planned based on the sub-sequences to determine the target writing path, so as to control the writing robot to perform writing actions based on the target writing path.
[0072] This invention provides a writing control method that standardizes the process of determining writing data files for drawing and handwriting tasks to obtain writing data files with a unified format. This enables the writing robot's motion planner to receive and process two writing data files from different sources but with a unified format, thereby improving the applicability of the writing robot.
[0073] Example 3 Figure 3 This is a schematic diagram of a writing control device provided in Embodiment 4 of the present invention. Figure 3 As shown, the device includes: The writing task acquisition module 310 is used to acquire the writing task corresponding to the writing instruction in response to the writing instruction being triggered. The writing task parsing module 320 is used to parse the writing task and generate a writing data file; wherein, the writing data file includes a sequence of control points arranged in writing order; The writing path planning module 330 is used to plan the writing path based on the writing data file and determine the planning result. The writing path execution module 340 is used to determine the target writing path based on the planning result if the planning result is successful, otherwise divide the control point sequence into at least two sub-sequences and perform writing path planning based on the sub-sequences to determine the target writing path, so as to control the writing robot to perform writing actions based on the target writing path.
[0074] The writing control device provided in this invention, in response to a writing command being triggered, acquires a writing task corresponding to the writing command; parses the writing task to generate a writing data file; wherein the writing data file includes a sequence of control points arranged in writing order; performs writing path planning based on the writing data file, and determines the planning result; if the planning result is successful, a target writing path is determined based on the planning result; otherwise, the control point sequence is divided into at least two sub-sequences, and a writing path is planned based on the sub-sequences to determine the target writing path, so as to control the writing robot to perform writing actions based on the target writing path. This technical solution plans the writing path through a hybrid degradation method to achieve autonomous planning of the writing path, improving writing efficiency while ensuring the writing smoothness of the writing robot.
[0075] Optionally, the writing task can be a drawing task or a handwriting task; wherein, the drawing task includes an image to be drawn, and the handwriting task includes a text topic to be written.
[0076] Optional, the writing task parsing module 320 includes: The vector graphic generation unit is used to perform edge detection and contour extraction on the image to be drawn if the writing task is a drawing task, and to determine the vector graphic corresponding to the image to be drawn. The drawing task parsing unit is used to discretize the vector image and generate a writing data file.
[0077] Optional, the writing task parsing module 320 includes: The text string generation unit is used to generate a text string corresponding to the topic of the text to be written, based on the topic of the text to be written, if the writing task is a writing task. The writing task parsing unit is used to parse the strokes of the text string and generate a writing data file.
[0078] Optionally, the writing path planning module 330 includes: The initial writing path determination unit is used to plan the writing path based on the writing data file and determine the initial writing path. The path coverage determination unit is used to compare the initial writing path with the writing data file to determine the coverage of the initial writing path; The planning result determination unit is used to determine the planning result based on the coverage rate.
[0079] Optionally, the writing data file may also include a pen status identifier for each control point. The pen status identifier is used to indicate the contact state between the writing tool and the writing surface at the control point. The pen status identifier includes a pen lifting state and a pen putting state.
[0080] Optionally, the device further includes: The task locking module is used to lock the writing task after the writing command is triggered and the writing task corresponding to the writing command is obtained.
[0081] The writing control device provided in the embodiments of the present invention can execute the writing control method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method.
[0082] Example 4 Figure 4 A schematic diagram of the structure of a device 10 that can be used to implement embodiments of this application is shown. The device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein.
[0083] like Figure 4 As shown, device 10 includes at least one processor 11 and a memory, such as read-only memory (ROM) 12, random access memory (RAM) 13, etc., communicatively connected to at least one processor 11. The memory stores computer programs executable by at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded into the RAM 13 from storage unit 18. The RAM 13 may also store various programs and data required for the operation of device 10. The processor 11, ROM 12, and RAM 13 are interconnected via bus 14. Input / output (I / O) interface 15 is also connected to bus 14.
[0084] Multiple components in device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of monitors, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0085] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as writing control methods.
[0086] In some embodiments, the writing control method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the writing control method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the writing control method by any other suitable means (e.g., by means of firmware).
[0087] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0088] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0089] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, 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 devices, magnetic storage devices, or any suitable combination of the foregoing.
[0090] To provide interaction with a user, the systems and techniques described herein can be implemented on a device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0091] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0092] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0093] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication unit 19, or installed from storage unit 18, or installed from ROM 12. When the computer program is executed by processor 11, it performs the functions defined in the methods of the embodiments of the present invention.
[0094] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this application can be achieved, and this is not limited herein.
[0095] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A writing control method, characterized in that, The method includes: In response to a writing instruction being triggered, the writing task corresponding to the writing instruction is obtained; The writing task is parsed to generate a writing data file; wherein, the writing data file includes a sequence of control points arranged in writing order; Based on the written data file, a writing path is planned, and the planning result is determined; If the planning result is successful, the target writing path is determined based on the planning result; otherwise, the control point sequence is divided into at least two sub-sequences, and the writing path is planned based on the sub-sequences to determine the target writing path, so as to control the writing robot to perform writing actions based on the target writing path.
2. The method according to claim 1, characterized in that, The writing task includes a drawing task and a writing task; wherein, the drawing task includes an image to be drawn, and the writing task includes a text topic to be written.
3. The method according to claim 2, characterized in that, The writing task is parsed to generate a writing data file, including: If the writing task is a drawing task, then edge detection and contour extraction are performed on the image to be drawn to determine the vector image corresponding to the image to be drawn; The vector image is discretized to generate a written data file.
4. The method according to claim 2, characterized in that, The writing task is parsed to generate a writing data file, including: If the writing task is a handwriting task, then a text string corresponding to the topic of the text to be written is generated according to the topic of the text to be written; The text string is parsed to generate a writing data file.
5. The method according to claim 1, characterized in that, Based on the written data file, a writing path is planned, and the planning result is determined, including: Based on the written data file, a writing path is planned to determine the initial writing path; The initial writing path is compared with the writing data file to determine the coverage of the initial writing path; The planning results are determined based on the coverage rate.
6. The method according to claim 1, characterized in that, The writing data file also includes a pen status identifier for each control point. The pen status identifier is used to indicate the contact state between the writing tool and the writing surface at the control point. The pen status identifier includes the pen lifting state and the pen putting state.
7. The method according to claim 1, characterized in that, After obtaining the writing task corresponding to the writing instruction in response to the writing instruction being triggered, the method further includes: The writing task is locked.
8. A writing control device, characterized in that, The device includes: The writing task acquisition module is used to acquire the writing task corresponding to the writing instruction in response to the writing instruction being triggered. The writing task parsing module is used to parse the writing task and generate a writing data file; wherein, the writing data file includes a sequence of control points arranged in writing order; The writing path planning module is used to plan the writing path based on the writing data file and determine the planning result. The writing path execution module is used to determine the target writing path based on the planning result if the planning result is successful; otherwise, it divides the control point sequence into at least two sub-sequences and performs writing path planning based on the sub-sequences to determine the target writing path, so as to control the writing robot to perform writing actions based on the target writing path.
9. A writing robot, characterized in that, The writing robot includes: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the writing control method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the writing control method according to any one of claims 1-7.