Task suspension and recovery implementation method and device in numerical control system, equipment and medium
By implementing a task suspension and resumption method in the CNC system, the problem of state saving during task switching is solved, enabling rapid task suspension and resumption, improving production efficiency and machining accuracy, and enhancing system flexibility and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-03-10
AI Technical Summary
Existing CNC systems lack a robust suspension and recovery mechanism during task switching, failing to effectively save the execution state of interrupted tasks, resulting in low production efficiency, resource waste, and difficulty in guaranteeing machining accuracy.
By implementing a task suspension and resumption method in the CNC system, user commands are received through a human-machine interface, a context information subdirectory is created and the task status is saved, and the specific position when the task is suspended is located and restored, ensuring the continuity and accuracy of machining.
It enables rapid task suspension and resumption, avoids redundant processing, improves production efficiency, reduces resource waste, and enhances processing accuracy and user experience.
Smart Images

Figure CN121636096A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of task management technology for CNC systems, specifically relating to a method, device, equipment, and medium for suspending and resuming tasks in a CNC system. Background Technology
[0002] Numerical control systems are widely used in various machining equipment in modern manufacturing. One of their core functions is batch processing, which involves executing multiple machining tasks sequentially or selectively from a task list. In actual production, situations often arise where it's necessary to interrupt the currently executing task to handle other urgent processing tasks. For example, when a production line needs to prioritize an urgent order, operators may want to pause the current task, complete the urgent task, and then resume processing the previously paused task.
[0003] Existing CNC systems have significant shortcomings in handling such task switching requirements. Most systems lack a robust task suspension and resumption mechanism, failing to effectively save the execution state of interrupted tasks. When a task switch is needed, the current task's execution is usually terminated entirely, requiring the entire machining process to begin upon restarting. This not only leads to low production efficiency but also wastes resources and time. While some CNC systems offer simple pause functions, these are limited to temporarily stopping the current task and do not support retaining the original task's state information after switching to another task. Furthermore, these systems lack systematic management of task context, failing to accurately record and restore the specific machining position at the time of task interruption, resulting in compromised machining accuracy.
[0004] Therefore, there is an urgent need for a mechanism that can effectively suspend and resume tasks, enabling operators to flexibly switch between multiple processing tasks. Summary of the Invention
[0005] In a first aspect, embodiments of this application provide a method for suspending and resuming tasks in a CNC system, comprising the following steps: S1. Receive a processing task suspension command triggered by the user through the human-machine interface (HMI); S2. In response to the processing task suspension command, determine whether the current processing task meets the suspension conditions; if it does, execute the task suspension operation, which includes: In the processing task context information list directory, create a subdirectory corresponding to the current processing task; Save the context information file Context.info for the current processing task to the subdirectory; S3. Receive the processing task recovery command triggered by the user through the human-machine interface (HMI); S4. In response to the processing task recovery command, determine whether the currently selected processing task meets the recovery conditions; if it does, execute the task recovery operation, which includes: The context information file of the current processing task is overwritten by the context information file Context.info in the subdirectory corresponding to the selected processing task; Based on the line number LineNo and line offset LineOffset recorded in the overwritten context information file Context.info, the specific location where the processing task was suspended can be located; The processing will continue from the specific location where it was located.
[0006] Furthermore, the specific steps of step S1 are as follows: S11. Detect user-triggered click events via the "Suspend Machining Task" button on the HMI interface, generate a suspension command, and send it to the CNC system; S12. The CNC system receives and parses the suspension command, and confirms the execution of the task suspension process.
[0007] Furthermore, the specific steps of step S2 are as follows: S21. Respond to the processing task suspension command and obtain the status information of the current processing task; S22. Based on the status information of the current processing task, determine whether the current processing task is in the process of processing; If so, proceed to step S23; If not, proceed to step S24; S23. First, send a stop processing command to the motion control layer. After processing stops, determine that the suspension condition is met and proceed to step S25. S24. Determine whether the current processing task has been completed; If so, the suspension condition is not met, and the process ends. If not, the suspension condition is met, and the process proceeds to step S25. S25. Obtain the unique identifier of the current processing task in the task list, and create a subdirectory in the processing task context information list directory using the unique identifier as the subdirectory name; S26. Read the context information file Context.info currently located in the processing task's working directory, copy it to the created subdirectory, and then verify the integrity of the copied context information file Context.info.
[0008] Furthermore, the specific steps in step S23 are as follows: S231. After sending a stop machining command to the motion control layer, continuously monitor the real-time status of each motion axis of the machine tool; S232. When all motion axes are detected to have zero speed and remain in a fixed position, it is determined that the machining has stopped.
[0009] Furthermore, the specific steps of step S3 are as follows: S31. Detect the user-triggered click event through the processing task resumption button on the HMI interface, obtain the suspended processing task selected by the user in the task list of the HMI interface, and generate a resumption command; S32. Send the generated recovery command and the identifier of the machining task selected by the user to the CNC system; S33. The CNC system receives and parses the recovery command, and confirms the execution of the task recovery process.
[0010] Furthermore, the specific steps of step S4 are as follows: S41. Respond to the machining task recovery command and obtain the machining status of the CNC system; S42. Based on the machining status of the CNC system, determine whether there are any machining tasks other than the currently selected machining task that are in the process of machining; If so, proceed to step S43; If not, proceed to step S44; S43. First, send a command to the motion control layer to stop the current processing task. After the processing stops, determine that the recovery conditions are met and proceed to step S45. S44. Directly determine that the recovery conditions are met; S45. Copy the context information file Context.info from the subdirectory corresponding to the selected processing task and overwrite the context information file in the current processing task's working directory; S46. Parse the overwritten Context.info file and extract the values of line number LineNo and line offset LineOffset; S47. Locate the corresponding line in the processing file corresponding to the current processing task based on the line number LineNo, and offset by LineOffset bytes from the beginning of the located line to locate the specific processing position: Processing position = LineNo × L + LineOffset Where L represents the fixed byte length of each line in the processing file.
[0011] Furthermore, the context information file Context.info is in text format, stored using a key-value pair structure, and includes at least a line number field represented by LineNo and an offset field represented by LineOffset.
[0012] Secondly, embodiments of this application also provide a task suspension and resumption device in a CNC system, comprising: The command receiving module is used to receive processing task suspension commands and processing task resumption commands triggered by the user through the human-machine interface (HMI). The conditional judgment module is used for: In response to the processing task suspension command, determine whether the current processing task meets the suspension conditions; In response to the processing task recovery command, determine whether the currently selected processing task meets the recovery conditions; The task suspension module is used to perform task suspension operations when the current processing task meets the suspension conditions, including: In the processing task context information list directory, create a subdirectory corresponding to the current processing task; Save the context information file Context.info for the current processing task to the subdirectory; The task recovery execution module is used to perform task recovery operations when the currently selected processing task meets the recovery conditions, including: The context information file of the current processing task is overwritten by the context information file Context.info in the subdirectory corresponding to the selected processing task; Based on the line number LineNo and line offset LineOffset recorded in the overwritten context information file Context.info, the specific location where the processing task was suspended can be located; The processing will continue from the specific location where it was located.
[0013] Thirdly, embodiments of this application also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the task suspension and resumption method in the CNC system as described in the first aspect.
[0014] Fourthly, embodiments of this application also provide a storage medium storing a computer program thereon, wherein when the computer program is executed by a processor, it implements the steps of the task suspension and resumption method in the CNC system as described in the first aspect.
[0015] As can be seen from the above technical solutions, this application has the following advantages: The method, apparatus, equipment, and medium for suspending and resuming tasks in a CNC system provided in this application enable operators to quickly pause the current task when an emergency task is inserted and resume the original task after the emergency task is completed. This avoids repetitive processing and improves production efficiency; it also avoids repetitive processing caused by task switching, reducing waste of materials and time and lowering production costs; by saving and restoring the task's context information, processing can be accurately resumed from the suspended position, ensuring processing accuracy and quality; it allows operators to flexibly switch tasks according to production needs, enhancing the adaptability and flexibility of the CNC system and meeting the needs of complex production scenarios; and it allows task suspension and resumption operations to be completed through the HMI interface, improving user convenience and enhancing the user experience. Attached Figure Description
[0016] To more clearly illustrate the technical solution of this application, the accompanying drawings used in the description 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.
[0017] Figure 1 This is a flowchart illustrating the task suspension and resumption method in the CNC system of the present invention.
[0018] Figure 2 This is a schematic diagram of the task suspension and resumption implementation system in the CNC system of the present invention. Detailed Implementation
[0019] The various embodiments of this disclosure will be described more fully in the following detailed steps of the method for suspending and resuming tasks in a CNC system. This disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of this disclosure to the specific embodiments disclosed herein, but rather this disclosure should be understood to cover all adjustments, equivalents, and / or alternatives falling within the spirit and scope of the various embodiments of this disclosure.
[0020] For example, in modern manufacturing, CNC systems are widely used in various machining equipment. One of their core functions is batch processing, that is, executing multiple processing tasks sequentially or selectively. However, in actual production, it is often necessary to interrupt the current task to handle urgent tasks, such as prioritizing urgent orders. In this case, the operator would like to pause the current task, complete the urgent task, and then resume the original task to continue processing.
[0021] However, existing CNC systems have significant shortcomings in task switching. Most systems lack a robust task suspension and resumption mechanism, failing to effectively save the state of interrupted tasks. When switching tasks, typically only the current task can be terminated, requiring restarting from the beginning upon resumption. This not only reduces production efficiency but also wastes resources and time. While some systems possess simple pause functions, they cannot retain the original task state information after task switching. Furthermore, these systems lack systematic management of task context, failing to accurately record and restore the machining position at the time of interruption, resulting in difficulty in guaranteeing machining accuracy.
[0022] Therefore, there is an urgent need for an effective task suspension and resumption mechanism to enable flexible switching between multiple processing tasks, thereby improving production efficiency and processing accuracy.
[0023] To address the aforementioned issues, this embodiment provides a method for suspending and resuming tasks in a CNC system, enabling rapid task suspension and resumption, improving production efficiency, reducing repetitive processing, minimizing resource waste, and enhancing user experience.
[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] Please see Figure 1 The diagram shows a flowchart of a task suspension and resumption method in a CNC system according to a specific embodiment. The method includes the following steps: S1. Receive a processing task suspension command triggered by the user through the human-machine interface (HMI); It should be noted that receiving user commands through the HMI interface allows users to easily trigger task suspension operations, enhancing the interactivity of the CNC system. S2. In response to the processing task suspension command, determine whether the current processing task meets the suspension conditions; if it does, execute the task suspension operation, which includes: In the processing task context information list directory, create a subdirectory corresponding to the current processing task; Save the context information file Context.info for the current processing task to the subdirectory; It should be noted that the suspension condition determination ensures that the suspension operation is only performed when the current task is in a reasonable state, avoiding invalid suspension of completed or unstarted tasks, and improving the efficiency and reliability of the CNC system; the creation of subdirectories creates an independent context information storage directory for each suspended task, which facilitates task management and recovery; by saving the context information of the current task, it ensures that the task status can be completely recorded, providing a basis for recovery operations; S3. Receive the processing task recovery command triggered by the user through the human-machine interface (HMI); It should be noted that receiving user commands through the HMI interface allows users to easily trigger task recovery operations, enhancing the interactivity of the CNC system. S4. In response to the processing task recovery command, determine whether the currently selected processing task meets the recovery conditions; if it does, execute the task recovery operation, which includes: The context information file of the current processing task is overwritten by the context information file Context.info in the subdirectory corresponding to the selected processing task; Based on the line number LineNo and line offset LineOffset recorded in the overwritten context information file Context.info, the specific location where the processing task was suspended can be located; Continue processing from the specific location identified; It should be noted that the recovery condition determination ensures that the recovery operation is only performed when the current CNC system status allows it, avoiding interference with other tasks and improving the safety of the CNC system. By overwriting the context information file of the current task, the state of the suspended task is restored, ensuring that the task can be accurately resumed from the suspended position. Based on the line number and offset, the suspended position is accurately located, and machining continues from that position, ensuring machining accuracy and continuity.
[0026] This embodiment enables operators to quickly pause and resume the current task through a task suspension and resumption mechanism, avoiding repetitive processing, reducing resource waste, and improving processing accuracy. At the same time, the operation process is simplified through the HMI interface, enhancing the flexibility of the CNC system and improving the user experience.
[0027] Furthermore, as a refinement and extension of the specific implementation of the above embodiments, in order to fully illustrate the specific implementation process in this embodiment, another method for suspending and resuming tasks in a CNC system is provided. In the CNC system, the human-machine interface (HMI) is equipped with a machining task suspension button, a resumption button, and a task list display area, supporting visual display of task status; the machining file adopts a G-code file with a fixed line byte length (L=128 bytes), and each line stores one machining instruction; the context information file adopts Context.info as a text format, adopts a key-value pair structure, and includes fields such as LineNo (line number) and LineOffset (line offset), for example, LineNo=156; LineOffset=86; the storage directory structure is the system's preset machining task context information list directory, and the context file of the suspended task is stored in the form of a subdirectory named with a unique task identifier; Assuming the CNC system is currently executing machining task Task_001 (unique identifier: T20250510001), the user needs to pause this task to handle the urgent task Task_002. The suspension steps are as follows: S1. Receive a processing task suspension command triggered by the user through the human-machine interface (HMI); The specific steps of step S1 are as follows: S11. Detect user-triggered click events via the "Suspend Machining Task" button on the HMI interface, generate a suspension command, and send it to the CNC system; S12. The CNC system receives and parses the suspension command, and confirms the execution of the task suspension process; For example, when a user locates the "Suspend Machining Task" button on the HMI interface and presses it, the HMI system detects the click event and immediately generates a standardized suspension instruction SUSPEND_TASK=T20250510001, which is then sent to the core control module of the CNC system via the internal communication bus. After receiving the instruction, the CNC system parses and confirms that the target task is Task_001, and initiates the task suspension process. S2. In response to the processing task suspension command, determine whether the current processing task meets the suspension conditions; if it does, execute the task suspension operation, which includes: In the processing task context information list directory, create a subdirectory corresponding to the current processing task; Save the context information file Context.info for the current processing task to the subdirectory; The context information file Context.info is in text format and is stored in a key-value pair structure. It contains at least a line number field represented by LineNo and an offset field represented by LineOffset. The specific steps of step S2 are as follows: S21. Respond to the processing task suspension command and obtain the status information of the current processing task; S22. Based on the status information of the current processing task, determine whether the current processing task is in the process of processing; If so, proceed to step S23; If not, proceed to step S24; S23. First, send a stop processing command to the motion control layer. After processing stops, determine that the suspension condition is met and proceed to step S25. The specific steps in step S23 are as follows: S231. After sending a stop machining command to the motion control layer, continuously monitor the real-time status of each motion axis of the machine tool; S232. When all motion axes are detected to have zero speed and remain in a fixed position, it is determined that the machining has stopped; S24. Determine whether the current processing task has been completed; If so, the suspension condition is not met, and the process ends. If not, the suspension condition is met, and the process proceeds to step S25. S25. Obtain the unique identifier of the current processing task in the task list, and create a subdirectory in the processing task context information list directory using the unique identifier as the subdirectory name; S26. Read the context information file Context.info currently located in the processing task's working directory, copy it to the created subdirectory, and then verify the integrity of the copied context information file Context.info; For example, the system first obtains the status information of Task_001, and learns from the feedback of the motion control layer that the task is in the process of machining (spindle speed 3000rpm, X / Y / Z axes are all in the feed state), and executes step S23; The CNC system sends a stop machining command STOP_PROCESS=IMMEDIATE to the motion control layer, and at the same time starts the status monitoring mechanism of each axis to collect the speed values and position coordinates of the X / Y / Z axes in real time. After continuous monitoring for 300ms, the system detected that the speed of all motion axes had dropped to 0rpm and the position coordinates remained fixed (X=125.32mm, Y=86.75mm, Z=52.10mm), and determined that the machining had completely stopped, thus meeting the suspension conditions; The system obtains the unique identifier T20250510001 for Task_001 and creates a subdirectory T20250510001 under the "Processing Task Context Information List Directory"; Read the Context.info file in the current processing task's working directory. This file currently records the processing status of Task_001: LineNo=156; LineOffset=86; (indicating that execution has reached line 156, offset 86 bytes within the line). Copy the Context.info file to the T20250510001 subdirectory. After saving the file, the system will automatically verify the integrity of the copied file, ensuring that the data is not corrupted by checking the file size and the integrity of key fields. Once the suspension is complete, the HMI interface updates the status of Task_001 to "Suspended" and highlights it in the task list. At the same time, system processing resources are released, allowing users to select the urgent task Task_002 to start processing. S3. Receive the processing task recovery command triggered by the user through the human-machine interface (HMI); The specific steps of step S3 are as follows: S31. Detect the user-triggered click event through the processing task resumption button on the HMI interface, obtain the suspended processing task selected by the user in the task list of the HMI interface, and generate a resumption command; S32. Send the generated recovery command and the identifier of the machining task selected by the user to the CNC system; S33. The CNC system receives and parses the recovery command, and confirms the execution of the task recovery process; For example, after the emergency task Task_002 is completed, the user needs to resume the processing of Task_001. The resumption steps are as follows: Trigger recovery command: The user selects Task_001, which is "Pending," from the task list on the HMI interface and clicks the "Resume Machining Task" button. Upon detecting the click event, the HMI system obtains the unique identifier T20250510001 for the selected task, generates the recovery instruction RESUME_TASK=T20250510001, and sends it along with the identifier information to the CNC system. After parsing the instruction, the CNC system confirms and executes the recovery process for Task_001. S4. In response to the processing task recovery command, determine whether the currently selected processing task meets the recovery conditions; if it does, execute the task recovery operation, which includes: The context information file of the current processing task is overwritten by the context information file Context.info in the subdirectory corresponding to the selected processing task; Based on the line number LineNo and line offset LineOffset recorded in the overwritten context information file, the specific location when the processing task was suspended can be located. Continue processing from the specific location identified; The specific steps of step S4 are as follows: S41. Respond to the machining task recovery command and obtain the machining status of the CNC system; S42. Based on the machining status of the CNC system, determine whether there are any machining tasks other than the currently selected machining task that are in the process of machining; If so, proceed to step S43; If not, proceed to step S44; S43. First, send a command to the motion control layer to stop the current processing task. After the processing stops, determine that the recovery conditions are met and proceed to step S45. S44. Directly determine that the recovery conditions are met; S45. Copy the context information file Context.info from the subdirectory corresponding to the selected processing task and overwrite the context information file in the current processing task's working directory; S46. Parse the overwritten Context.info file and extract the values of line number LineNo and line offset LineOffset; S47. Locate the corresponding line in the processing file corresponding to the current processing task based on the line number LineNo, and offset by LineOffset bytes from the beginning of the located line to locate the specific processing position: Processing position = LineNo × L + LineOffset Where L represents the fixed byte length of each line in the processing file; For example, the system obtains the current machining status of the CNC system, detects that Task_002 has been completed and there are no other tasks in the machining process, and directly determines that the recovery conditions are met; If other tasks are still being processed at this time, the system will first send a command to the motion control layer to stop the current task, and then execute the recovery process after the task stops. The system locates the T20250510001 subdirectory, reads the Context.info file stored therein, copies it and overwrites the Context.info file in the current processing task's working directory, thus completing the context information recovery.
[0028] Parse the overwritten Context.info file and extract the key parameters: LineNo=156, LineOffset=86; According to the processing position calculation formula, processing position = LineNo × L + LineOffset, substituting L = 128 bytes, the specific processing position is calculated as: 156 × 128 + 86 = 20054 bytes; Based on the calculation results, the system located line 156 in the G-code file corresponding to Task_001, and accurately found the processing instruction fragment before suspension by offsetting 86 bytes from the first byte of that line (original instruction: G01 X130.5 Y92.3F150.0, which had been executed up to the "Y92.3" part when suspended). The system automatically restores the machining parameters of Task_001 (e.g., spindle speed 3000rpm, feed rate 150mm / min), sends a start command to the motion control layer, and continues machining from the specific location. The HMI interface updates the status of Task_001 to "machining". For tasks that are not in the processing stage, if the user triggers the suspension command and Task_003 is in the "pending processing" state (processing has not started), the system determines that it is not in the processing stage and has not been completed, directly meets the suspension conditions, creates the corresponding subdirectory and saves the current Context.info file (at this time LineNo=0, LineOffset=0). For a suspended request for a completed task, if the user triggers a suspended command for the completed Task_004, the system detects that the task status is "completed", determines that the suspension conditions are not met, immediately pops up a prompt on the HMI interface saying "The current task is completed and does not need to be suspended", and ends the suspension process. If a task is being processed while Task_005 is being processed, the system first sends a stop command to the motion control layer for Task_005. After its motion axis has completely stopped, the system then performs the context file overwrite and processing position positioning operations for Task_001 to avoid task conflicts.
[0029] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0030] like Figure 2 As shown, the following is an embodiment of the task suspension and resumption implementation device in a CNC system provided by this disclosure. This system and the task suspension and resumption implementation method in the CNC system of the above embodiments belong to the same inventive concept. For details not described in detail in the embodiments of the task suspension and resumption implementation device in the CNC system, please refer to the embodiments of the task suspension and resumption implementation method in the CNC system described above.
[0031] The device includes: The command receiving module is used to receive processing task suspension commands and processing task resumption commands triggered by the user through the human-machine interface (HMI). The conditional judgment module is used for: In response to the processing task suspension command, determine whether the current processing task meets the suspension conditions; In response to the processing task recovery command, determine whether the currently selected processing task meets the recovery conditions; The task suspension module is used to perform task suspension operations when the current processing task meets the suspension conditions, including: In the processing task context information list directory, create a subdirectory corresponding to the current processing task; Save the context information file Context.info for the current processing task to the subdirectory; The task recovery execution module is used to perform task recovery operations when the currently selected processing task meets the recovery conditions, including: The context information file of the current processing task is overwritten by the context information file Context.info in the subdirectory corresponding to the selected processing task; Based on the line number LineNo and line offset LineOffset recorded in the overwritten context information file Context.info, the specific location where the processing task was suspended can be located; The processing will continue from the specific location where it was located.
[0032] This embodiment achieves rapid task suspension and resumption through the interactive collaboration of the command receiving module, condition judgment module, task suspension and execution module, and task resumption and execution module, thereby improving production efficiency, reducing repetitive processing, reducing resource waste, and enhancing user experience.
[0033] The task suspension and resumption method in a CNC system provided in this application can be applied to electronic devices. Those skilled in the art will understand that the electronic device structure involved in the embodiments of this invention does not constitute a limitation on the electronic device. An electronic device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements. In the embodiments of this invention, the electronic device includes, but is not limited to, laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of this application described and / or claimed herein.
[0034] Electronic devices may include processors, external memory interfaces, internal memory, universal serial bus (USB) interfaces, charging management modules, power management modules, batteries, wireless communication modules, audio modules, speakers, microphones, sensor modules, buttons, cameras, displays, and SIM card interfaces, etc.
[0035] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0036] A processor may include one or more processing units, such as a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.
[0037] The processor can serve as the nerve center and command center of an electronic device. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.
[0038] The processor may also include memory for storing instructions and data. In some embodiments, the memory in the processor is a cache memory. This memory can store instructions or data that the processor has just used or that are used repeatedly. If the processor needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces processor latency, and thus improves system efficiency.
[0039] The aforementioned electronic device implements the task suspension and resumption method of the CNC system of this application, which includes receiving a machining task suspension command triggered by the user through a human-machine interface (HMI); responding to the machining task suspension command, determining whether the current machining task meets the suspension conditions; if so, executing a task suspension operation, the task suspension operation including: creating a subdirectory corresponding to the current machining task in the machining task context information list directory; saving the current machining task's context information file Context.info to the subdirectory; receiving a machining task resumption command triggered by the user through the HMI; and responding to the machining task resumption command, determining whether the currently selected machining task is... If the recovery conditions are met, a task recovery operation is performed. The task recovery operation includes: overwriting the context information file of the current processing task with the context information file Context.info in the subdirectory corresponding to the selected processing task; locating the specific position where the processing task was suspended based on the line number LineNo and line offset LineOffset recorded in the overwritten context information file; and continuing the processing from the located specific position. This achieves the beneficial effects of allowing operators to flexibly switch tasks through the task suspension and recovery function, avoiding repeated processing, reducing resource waste, improving processing accuracy, enhancing system adaptability, and increasing production efficiency.
[0040] The storage medium provided in this application stores a program product capable of implementing the task suspension and resumption method in a CNC system.
[0041] The method for suspending and resuming tasks in a CNC system includes: receiving a machining task suspension command triggered by a user through a human-machine interface (HMI); responding to the machining task suspension command, determining whether the current machining task meets the suspension conditions; if so, executing a task suspension operation, wherein the task suspension operation includes: creating a subdirectory corresponding to the current machining task in the machining task context information list directory; saving the current machining task's context information file Context.info to the subdirectory; receiving a machining task resumption command triggered by a user through the HMI; responding to the machining task resumption command, determining whether the currently selected machining task meets the resumption conditions; if so, executing a task resumption operation, wherein the task resumption operation includes: overwriting the current machining task's context information file with the context information file Context.info in the subdirectory corresponding to the selected machining task; locating the specific position where the machining task was suspended based on the line number LineNo and line offset LineOffset recorded in the overwritten context information file; and continuing machining from the located specific position.
[0042] In some possible implementations, the task suspension and resumption method in the CNC system disclosed herein can be implemented as a program product, which includes program code. When the program product is run on a terminal device, the program code is used to cause the terminal device to perform the steps described in the "Exemplary Methods" section above according to various exemplary embodiments of this disclosure.
[0043] The storage medium disclosed herein may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A 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 (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable 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.
[0044] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for implementing task suspension and resumption in a numerical control system, characterized by, Comprising the following steps: S1. Receiving a processing task suspension command triggered by a user through a human-machine interface HMI; S2. In response to the processing task suspension command, judging whether the current processing task meets the suspension condition; If yes, executing a task suspension operation, the task suspension operation comprising: Creating a subdirectory corresponding to the current processing task under a processing task context information list directory; Saving the context information file Context.info of the current processing task to the subdirectory; S3. Receiving a processing task recovery command triggered by a user through a human-machine interface HMI; S4. In response to the processing task recovery command, judging whether the currently selected processing task meets the recovery condition; if yes, executing a task recovery operation, the task recovery operation comprising: Using the context information file Context.info under the subdirectory corresponding to the selected processing task to overwrite the context information file of the current processing task; Based on the line number LineNo and line offset LineOffset recorded in the overwritten context information file Context.info, locating the specific position when the processing task was suspended; Continuing to execute the processing from the located specific position.
2. The method of claim 1, wherein the task suspension and resumption is implemented in a numerical control system. Step S1 comprises the following steps: S11. Detecting a click event triggered by a user through a processing task suspension button of the HMI interface, generating a suspension instruction, and sending it to the numerical control system; S12. The numerical control system receives and analyzes the suspension instruction, and confirms to execute the task suspension process.
3. The method of claim 1, wherein the task suspension and resumption is implemented in a numerical control system. Step S2 comprises the following steps: S21. In response to the processing task suspension command, obtaining the state information of the current processing task; S22. Based on the state information of the current processing task, judging whether the current processing task is in the processing process; If yes, executing step S23; If no, executing step S24; S23. First, sending a stop processing instruction to the motion control layer, and after the processing is stopped, judging that the suspension condition is met, and entering step S25; S24. Judging whether the current processing task is completed; If yes, judging that the suspension condition is not met, and ending the process; If no, judging that the suspension condition is met, and entering step S25; S25. Obtaining the unique identifier of the current processing task in the task list, and creating a subdirectory under the processing task context information list directory with the unique identifier as the subdirectory name; S26. Reading the context information file Context.info currently located under the processing task working directory, and copying it to the created subdirectory, and then verifying the integrity of the copied context information file Context.info.
4. The method of claim 3, wherein the task suspension and resumption is implemented in a numerical control system. Step S23 comprises the following steps: S231. After sending a stop processing instruction to the motion control layer, continuously monitoring the real-time state of each motion axis of the machine tool; S232. When monitoring that the speed of all motion axes is zero and the position remains fixed, it is determined that the processing has stopped.
5. The method of claim 1, wherein the task suspension and resumption is implemented in a numerical control system, and the task suspension and resumption is implemented by using a task queue. Step S3 comprises the following steps: S31. Detecting a click event triggered by a user through a processing task recovery button of the HMI interface, obtaining the suspended processing task selected by the user in the task list of the HMI interface, and generating a recovery instruction; S32. Send the generated recovery instruction and the identifier of the user-selected machining task to the numerical control system; S33. The numerical control system receives and parses the recovery instruction, and confirms to execute the task recovery process.
6. The method of claim 1, wherein the task suspension and resumption is implemented in a numerical control system. Step S4 includes the following specific steps: S41. In response to the machining task recovery command, obtain the machining state of the numerical control system; S42. Determine whether there is a machining task other than the currently selected machining task that is in the machining process based on the machining state of the numerical control system; If yes, execute step S43; If no, execute step S44; S43. First, send an instruction to the motion control layer to stop the current machining task, and after the machining is stopped, determine that the recovery condition is met, and proceed to step S45; S44. Directly determine that the recovery condition is met; S45. Copy and overwrite the context information file Context.info under the subdirectory corresponding to the selected machining task to the context information file under the working directory of the current machining task; S46. Parse the overwritten Context.info file to extract the values of the line number LineNo and the line offset LineOffset; S47. According to the line number LineNo, locate the corresponding line in the machining file corresponding to the current machining task, and offset LineOffset bytes from the beginning of the line to locate the specific machining position: machining position = LineNo × L + LineOffset Where L represents the fixed byte length of each line in the machining file.
7. The method of claim 1, wherein the task suspension and resumption is implemented in a numerical control system. The context information file Context.info is in text format and uses a key-value pair structure for storage, and at least includes a line number value field represented by LineNo and an offset value field represented by LineOffset.
8. A task suspension and resumption device in a CNC system, characterized in that, Comprise: The command receiving module is used for receiving the machining task suspension command and the machining task recovery command triggered by the user through the human-machine interface HMI; The condition judgment module is used for: In response to the machining task suspension command, determine whether the current machining task meets the suspension condition; In response to the machining task recovery command, determine whether the currently selected machining task meets the recovery condition; The task suspension execution module is used for executing the task suspension operation when the current machining task meets the suspension condition, including: Create a subdirectory corresponding to the current machining task under the machining task context information list directory; Save the context information file Context.info of the current machining task to the subdirectory; The task recovery execution module is used for executing the task recovery operation when the currently selected machining task meets the recovery condition, including: Use the context information file Context.info under the subdirectory corresponding to the selected machining task to overwrite the context information file of the current machining task; Based on the line number LineNo and the line offset LineOffset recorded in the overwritten context information file Context.info, locate the specific position when the machining task is suspended; Continue to execute the machining from the located specific position.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the steps of the method for implementing task suspension and resumption in the numerical control system according to any one of claims 1 to 7 when executing the program.
10. A storage medium having stored thereon a computer program, characterized in that The computer program implements the steps of the method for implementing task suspension and resumption in the numerical control system according to any one of claims 1 to 7 when executed by the processor.