Numerical control program encryption authorization method, device, system, storage medium and program product

By separating the authorization information of CNC programs and encrypting it into an authorization code, and using a decoding and verification program for authorization control, the problems of authorization being tied to programs and having numerous versions in CNC systems are solved, achieving independent management and efficient and secure authorization control.

CN122490487APending Publication Date: 2026-07-31SIEMENS (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SIEMENS (CHINA) CO LTD
Filing Date
2026-04-15
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing CNC systems suffer from problems in authorization control, such as poor independence between authorization and individual programs, numerous versions, complex maintenance, and the need to handle new authorizations separately. Furthermore, closed systems cannot directly apply encrypted authorization schemes.

Method used

The authorization information is separated from the CNC program, and an authorization code is generated through an encryption algorithm. The code is then parsed and verified using a decoding and verification program to achieve customized authorization control.

Benefits of technology

It enables independent management and unified control of authorization information, reduces maintenance costs, supports independent authorization of most control programs, improves scalability and security, solves the problem of version proliferation, and runs effectively in a virtual machine environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122490487A_ABST
    Figure CN122490487A_ABST
Patent Text Reader

Abstract

This application discloses an encryption authorization method, apparatus, system, storage medium, and program product for CNC programs. The method includes: when a pre-set decoding and verification program is invoked by a current CNC program loaded onto an authorization device, the decoding and verification program obtains the authorization code of the authorization device; the authorization code is an authorization code obtained by encrypting the authorization information of the authorization device for the current CNC program using an encryption algorithm; the decoding and verification program parses the authorization code to obtain the authorization information corresponding to the authorization code; the decoding and verification program performs authorization verification of the current CNC program on the authorization device based on the authorization information, and returns the verification result to the current CNC program, which then decides whether to run based on the verification result. The technical solution in this application embodiment can achieve personalized authorization control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of CNC system program protection technology, and in particular to a method, device, system, storage medium and program product for encrypting and authorizing CNC programs. Background Technology

[0002] In some CNC product applications, machine tool manufacturers typically develop high-value CNC programs based on equipment characteristics, industry needs, and process experience. These programs are core technological assets that enhance product competitiveness. To protect intellectual property rights and reflect the added value of technology, it is necessary to encrypt and control the authorization of these high-value NC programs to ensure that they cannot be viewed, modified, decompiled, or run on unauthorized devices.

[0003] Currently, some CNC systems in the industry have attempted to address the protection issue of NC programs. A common approach is to directly write authorization information such as the device's hardware serial number into the CNC source program. The program internally verifies whether the hardware serial number matches a preset value. If they match, the program runs on the device. Then, it uses a program encryption lock, such as the CNC system's Lock MyCycles tool, to encrypt the program and prevent it from being viewed, modified, or decompiled. However, although these data systems have robust system-level permission management mechanisms, they do not provide open programming interfaces for permission functions, preventing users from directly implementing customized authorization control through native commands. Summary of the Invention

[0004] In view of this, the embodiments of this application propose, on the one hand, an encryption authorization method for CNC programs, and on the other hand, an encryption authorization device, system, storage medium, and program product for CNC programs, so as to realize customized authorization control.

[0005] An encrypted authorization method for a CNC program proposed in this application embodiment includes: when a pre-set decoding and verification program is called by a current CNC program loaded onto an authorization device, the decoding and verification program obtains the authorization code of the authorization device; the authorization code is an authorization code obtained by encrypting the authorization information of the authorization device for the current CNC program using an encryption algorithm; the decoding and verification program parses the authorization code to obtain the authorization information corresponding to the authorization code; the decoding and verification program performs authorization verification of the current CNC program on the authorization device based on the authorization information, and returns the verification result to the current CNC program, which then decides whether to run based on the verification result.

[0006] In some implementations, the authorization information includes: device identifier and authorization period.

[0007] In some implementations, the same authorized device supports different CNC programs, and the authorization codes corresponding to different CNC programs are stored in the same authorization file; the authorization information further includes: program identifier; the decoding and verification program obtains the authorization code of the authorized device by: the decoding and verification program reads the authorization file of the authorized device, and obtains the authorization code corresponding to the current CNC program from the authorization file based on the pre-established correspondence between the program identifiers of different CNC programs and the corresponding authorization codes.

[0008] In some implementations, the decoding verification program obtains the authorization code of the authorized device by: when the authorized device is powered on or when a set verification period expires; after performing authorization verification of the authorized device based on the authorization information using the current CNC program, the process further includes: caching the verification result in the memory of the authorized device; before the authorized device is powered off or before the set verification period expires, when the decoding verification program is called by the current CNC program, directly reading the verification result from the memory and returning the read verification result to the current CNC program.

[0009] In some implementations, caching the verification result in the memory of the authorized device includes caching the verification result in a write-protected system variable in the memory of the authorized device.

[0010] In some implementations, the decoding and verification program is isolated from the current CNC program; the calling of the pre-set decoding and verification program by the current CNC program loaded on the authorized device includes: the current CNC program loaded on the authorized device calling the decoding and verification program through a pre-set communication protocol instruction that serves as a cross-layer communication bridge.

[0011] In some embodiments, encrypting the authorization information of the authorized device using an encryption algorithm includes: encrypting plaintext information containing the authorization information of the authorized device using a symmetric encryption algorithm to obtain primary ciphertext; performing secondary processing on the primary ciphertext using a set custom logic calculation to obtain an authorization code; the decoding verification program includes: an authorization code acquisition subroutine; a decoding subroutine based on the set custom logic calculation and the inverse operation of the symmetric encryption algorithm; and an authorization verification subroutine based on the verification logic of the authorization information.

[0012] An encryption authorization device for a CNC program, as proposed in this application embodiment, includes: an information acquisition module, used to acquire the authorization code of the authorization device when the current CNC program is loaded onto the authorization device; the authorization code is an authorization code obtained by encrypting the authorization information of the authorization device for the current CNC program using an encryption algorithm; a decoding module, used to parse the authorization code to obtain the authorization information corresponding to the authorization code; and a verification module, used to perform authorization verification of the current CNC program on the authorization device based on the authorization information, and return the verification result to the current CNC program, which then decides whether to run based on the verification result.

[0013] In some implementations, the same authorized device supports different CNC programs, and the authorization codes corresponding to different CNC programs are stored in the same authorization file; the information acquisition module reads the authorization file of the authorized device, and obtains the authorization code corresponding to the current CNC program from the authorization file based on the pre-established correspondence between the program identifiers of different CNC programs and the corresponding authorization codes.

[0014] In some implementations, the information acquisition module acquires the authorization code of the authorized device when the authorized device is powered on or when the set verification period expires; after the verification module performs authorization verification of the authorized device for the current CNC program based on the authorization information, it further caches the verification result in the memory of the authorized device; before the authorized device is powered off or before the set verification period expires, when the information acquisition module is called by the current CNC program, it directly reads the verification result from the memory and returns the read verification result to the current CNC program.

[0015] In some implementations, the information acquisition module, the decoding module, and the verification module are isolated from the current CNC program; the signal acquisition module is invoked by the current CNC program loaded onto the authorized device through a pre-set communication protocol instruction that serves as a cross-layer communication bridge.

[0016] Another CNC program licensing device proposed in this application includes: at least one memory storing a computer program; and at least one processor for reading and executing the computer program to implement the CNC program licensing method as described in any of the above embodiments.

[0017] The CNC program authorization system proposed in this application includes: an authorization encryption device for encrypting the authorization information of the authorization device for a CNC program using an encryption algorithm to obtain a corresponding authorization code; and the CNC program authorization device as described in any of the above embodiments.

[0018] In some implementations, the authorization encryption device uses a symmetric encryption algorithm to encrypt plaintext information containing authorization information of the authorization device to obtain primary ciphertext; the primary ciphertext is then processed a second time using a predefined custom logic calculation to obtain an authorization code.

[0019] In some implementations, the authorization encryption device encrypts plaintext information containing the corresponding authorization information of the authorization device using a symmetric encryption algorithm for each CNC program supported by the authorization device, to obtain primary ciphertext; the primary ciphertext is then subjected to secondary processing using a custom algorithm to obtain the corresponding authorization code; and the authorization codes corresponding to different CNC programs are stored in an authorization file.

[0020] This application provides a computer-readable storage medium storing computer instructions; the computer instructions can be executed by at least one processor to implement the CNC program authorization method described in any of the above embodiments.

[0021] The computer program product proposed in this application includes a computer program; the computer program can be executed by at least one processor and implement the CNC program authorization method as described in any of the above embodiments.

[0022] In this embodiment, by separating the authorization information from the CNC program, encrypting the authorization information to generate an authorization code, setting a separate decoding and verification program to decode and verify the authorization code, and providing the verification result to the CNC program, customized authorization control can be achieved. This ensures that the program does not need to be modified for different devices, and CNC programs with the same function do not need to be modified for different devices, solving the problem of version proliferation, reducing maintenance costs, and improving scalability.

[0023] In addition, since the decryption cache can be executed only once when the device is powered on or when the preset verification period expires, there is no duplicate calculation and the device's operating efficiency is not affected. Attached Figure Description

[0024] The preferred embodiments of this application will now be described in detail with reference to the accompanying drawings, so that those skilled in the art can more clearly understand the above and other features and advantages of this application, in which:

[0025] Figure 1This is an exemplary flowchart of the CNC program authorization method in the embodiments of this application;

[0026] Figure 2 This is an exemplary structural diagram of the CNC program authorization device in the embodiments of this application;

[0027] Figure 3 This is a schematic diagram of the structure of another CNC program authorization device in an embodiment of this application;

[0028] Figure 4 This is a schematic diagram of the structure of the CNC program authorization system in the embodiments of this application.

[0029] The reference numerals and their meanings in the attached figures are as follows:

[0030] S11, S12, S13: Steps

[0031] 20, 30: CNC program authorization

[0032] 21: Information Acquisition Module

[0033] 22: Decoding module

[0034] 23: Verification Module

[0035] 31: Memory

[0036] 32: Processor

[0037] 33: Bus

[0038] 40: CNC program authorization system

[0039] 41: Authorized encryption device Detailed Implementation

[0040] After conducting an in-depth analysis of the aforementioned method of directly writing authorization information such as the device hardware serial number into the NC source program, realizing authorization control by verifying the hardware serial number within the program, and then encrypting the program using a program encryption lock, the inventors found that the method has the following problems: 1) Authorization is bound to a single program, resulting in poor independence; 2) There are many versions of the same CNC program on different devices, making maintenance complex; 3) New authorized programs need to be processed separately.

[0041] Therefore, in this embodiment of the application, the authorization information is separated from the CNC program. This way, the authorization information does not need to be written into the CNC program, thereby avoiding the need to set different versions of the same CNC program on different devices.

[0042] However, after separating the authorization information from the CNC program, the security of the authorization information needs to be considered. Therefore, this embodiment of the application considers encrypting the authorization information, converting it into an authorization code. Specifically, various encryption algorithms can be used to encrypt the authorization information; for example, a symmetric encryption algorithm can be used to encrypt the authorization information to obtain initial ciphertext. Furthermore, to make the encryption process more private, a custom logical calculation can be used to perform a secondary processing on the initial ciphertext to obtain the final authorization code.

[0043] However, considering that some CNC systems are closed systems, the instructions of the native CNC program do not support decryption of the authorization code generated by the cryptographic algorithm, making it difficult to directly apply this encryption authorization scheme. Therefore, in this embodiment, a corresponding decoding and verification program is pre-written for the authorization code. For example, a decoding process can be written based on the inverse operation of the encryption algorithm and the inverse operation of the custom logical calculation, and a verification process can be encoded based on the verification logic of the authorization information. Simultaneously, authorization code acquisition and communication functions are provided for this decoding and verification program.

[0044] In practical applications, the CNC program only needs to call the decoding and verification program. Then, the decoding and verification program obtains the authorization code, parses and verifies the verification code, and returns the verification result to the CNC program. The CNC program then decides whether to run the program based on the verification result.

[0045] In practice, if the decoding and verification program is written in a high-level language through a human-machine interface, the CNC program can call it based on pre-set MMC communication protocol instructions.

[0046] The above disclosure details the technical problems existing in the relevant technology and the thought process and analysis process for solving these problems. In fact, the understanding of these technical problems is not common knowledge in the field, but rather a novel discovery by the inventors during their research. Furthermore, the tracing of the causes of these technical problems and the thought process and analysis process for solving them are also the results of the inventors' gradual analysis and experiments during actual research, and are not common knowledge in the field.

[0047] To make the objectives, technical solutions, and advantages of this application clearer, the following examples are provided to further illustrate this application in detail.

[0048] To make the description concise and intuitive, the solutions of this disclosure will be illustrated below through several representative embodiments. Many details in the embodiments are only used to help understand the solutions of this disclosure, but obviously, the technical solutions of this disclosure can also be implemented without being limited to these details. To avoid unnecessarily obscuring the solutions of this disclosure, well-known components, parts, and circuits are not described in detail. In the following text, "comprising" means "including but not limited to"; "according to..." means "at least according to..., but not limited to...". If the quantity of a component is not explicitly defined below, the component may be one or more, or it may be understood as at least one.

[0049] Figure 1 This is an exemplary flowchart of the CNC program authorization method in an embodiment of this application. Figure 1 As shown, method 10 may include the following processing:

[0050] In step S11, when the pre-set decoding and verification program is called by the current CNC program loaded onto the authorized device, the decoding and verification program obtains the authorization code of the authorized device.

[0051] The authorization code is obtained by the CNC program authorization side encrypting the authorization information of the authorization device for the current CNC program using an encryption algorithm.

[0052] In some implementations, the process of encrypting the authorization information of the authorized device using an encryption algorithm may include: encrypting the plaintext information containing the authorization information of the authorized device using a symmetric encryption algorithm such as AES, which has strong anti-cracking capabilities, to obtain primary ciphertext; and performing secondary processing on the primary ciphertext using a predefined custom logic calculation to obtain the authorization code. The custom logic calculation can be any custom algorithm, such as ASCII code conversion algorithms or various mathematical operations.

[0053] The decoding and verification program may include: an authorization code acquisition subroutine; a decoding subroutine obtained based on the set custom algorithm and the inverse operation of the symmetric encryption algorithm; and an authorization verification subroutine obtained based on the verification logic of the authorization information.

[0054] In some implementations, for authorized devices that support only a single CNC program, the authorization information may include: a device identifier and an authorization period. In other implementations, the authorization information may further include a program identifier in addition to the device identifier and authorization period. The authorized device may be a hardware device or a virtual device. The device identifier may include: a device serial number or a pre-defined device number that uniquely identifies the device. The device serial number may include the hardware serial number of the hardware device or the MAC address of the virtual device's host computer. The program identifier may be the name of the CNC program or a pre-defined program number that uniquely identifies the CNC program. Furthermore, for authorized devices that support only a single CNC program, the authorization code may be stored in an authorization file and provided to the authorized device in advance, or it may be provided to the authorized device when the CNC program's authorization device initiates an authorization request.

[0055] In some implementations, for an authorized device that supports multiple CNC programs, the authorization information may include: device identifier, authorization period, and program identifier. In this case, a separate authorization code can be obtained for each CNC program of the authorized device, and the authorization code and its corresponding CNC program identifier can be stored in an authorization file. This authorization file may be in INI format. For example, in one example, the authorization file may include the following content:

[0056] [Option]

[0057] Names=Skiving; CNC program name

[0058] [Skiving]

[0059] Key=ba23… ; Authorization code

[0060] In practice, the authorization file can be provided to the authorization device in advance, or the authorization device of the CNC program can provide the corresponding authorization code to the authorization device based on the program identifier carried in the authorization request when it initiates the authorization request.

[0061] When the current CNC program calls the decoding and verification program, it can indicate its own program identifier to the decoding and verification program.

[0062] Accordingly, the process of obtaining the authorization code of the authorized device by the decoding and verification program in step S11 may include: the decoding and verification program reading the authorization file of the authorized device, and obtaining the authorization code of the current CNC program from the authorization file based on the pre-established correspondence between the program identifiers of different CNC programs and the corresponding authorization codes.

[0063] In this embodiment, the decoding verification program may include: an authorization code acquisition subroutine; a decoding subroutine obtained based on the set custom logic calculation and the inverse operation of the symmetric encryption algorithm; and an authorization verification subroutine obtained based on the verification logic of the authorization information.

[0064] The decoding and verification program can be isolated from the current CNC program. For example, the decoding and verification program can run in the control software layer, while the CNC program runs in the CNC kernel, with the two isolated from each other. Since the decoding and verification program needs to be called through the control software layer, an MMC communication protocol instruction acting as a cross-layer communication bridge can be pre-set, allowing the current CNC program to call the decoding and verification program through this pre-set MMC communication protocol instruction. Specifically, the decoding and verification program can be written using a high-level programming language, for example, but not limited to, through a human-machine interface.

[0065] In other implementations, the decoding and verification program can run in the CNC kernel along with the CNC program, in which case the CNC program can directly call the decoding and verification program without the need for cross-layer communication between the two.

[0066] Step S12: The decoding and verification program parses the authorization code to obtain the authorization information corresponding to the authorization code.

[0067] In some implementations, the specific parsing process of step S12 may include: performing the inverse operation of the set custom logic calculation on the authorization code to obtain the primary ciphertext; and performing the inverse operation of the symmetric encryption algorithm on the primary ciphertext to obtain the authorization information.

[0068] Step S13: The decoding and verification program performs authorization verification of the current CNC program on the authorized device based on the authorization information, and returns the verification result to the current CNC program, which then decides whether to run the program based on the verification result.

[0069] In this step, for the authorization information including device identifier, authorization period, and program identifier, it can be determined whether the program identifier in the authorization information is consistent with the program identifier of the current CNC program, whether the device identifier in the authorization information is consistent with the device identifier of the current authorized device, and whether the current authorization period is within the specified time. If all are yes, a verification result indicating authorization passed is output, for example, 1. If the authorization period has expired, a verification result indicating authorization expired is output, for example, 0. If other verification results are obtained, such as the program identifier in the authorization information being inconsistent with the program identifier of the current CNC program, or the device identifier in the authorization information being inconsistent with the device identifier of the current authorized device, a verification result indicating an error is output, for example, -1. The program identifier of the current CNC program and the device identifier of the current authorized device can be obtained in advance. For example, in some embodiments, they can be obtained when the authorized device is powered on and started, or when the set verification period expires, or when the authorization code is obtained and decoded.

[0070] Furthermore, to optimize operating efficiency and avoid consuming time by performing authorization verification every time the CNC program is run, this application implements a method where the decoding verification program in step S11 is executed only when the authorized device is powered on or when the set verification period expires to obtain the authorization code of the authorized device. After obtaining the verification result in step S13, the method further includes caching the verification result in the memory of the authorized device. For example, it can be cached in a write-protected system variable in the memory of the authorized device, such as the variable $P_MMCA. When the authorized device is powered off, the verification result is cleared. Accordingly, before the authorized device is powered off or before the set verification period expires, when the decoding verification program is called by the current CNC program, it can directly read the verification result from the memory and return the read verification result to the current CNC program.

[0071] The CNC program authorization method in the embodiments of this application has been described in detail above. The CNC program authorization device and system in the embodiments of this application will be described in detail below. The CNC program authorization device in the embodiments of this application can be used to implement the CNC program authorization method in the embodiments of this application. For details not disclosed in detail in the device and system embodiments of this application, please refer to the corresponding descriptions in the method embodiments of this application, which will not be repeated here.

[0072] Figure 2 This is an exemplary structural diagram of the CNC program authorization device in the embodiments of this application. Figure 2 As shown, the device 20 may include: an information acquisition module 21, a decoding module 22, and a verification module 23.

[0073] The information acquisition module 21 is used to acquire the authorization code of the authorized device when the current CNC program loaded onto the authorized device is invoked; the authorization code is: the authorization code obtained by encrypting the authorization information of the authorized device using an encryption algorithm for the authorized device of the current CNC program.

[0074] In some implementations, the process of encrypting the authorization information of the authorized device using an encryption algorithm to obtain the authorization code may include: encrypting the plaintext information containing the authorization information of the authorized device using a symmetric encryption algorithm such as AES encryption algorithm, which has strong anti-cracking capabilities, to obtain primary ciphertext; and performing secondary processing on the primary ciphertext using a set custom logic calculation to obtain the authorization code.

[0075] In some implementations, for authorized devices that support only a single CNC program, the authorization information may include: a device identifier and an authorization period. In other implementations, the authorization information may further include: a program identifier, in addition to the device identifier and authorization period. Furthermore, for authorized devices that support only a single CNC program, the authorization code may be stored in an authorization file provided to the authorized device in advance, or it may be provided to the authorized device when the CNC program's authorization device initiates an authorization request.

[0076] In some implementations, for an authorized device that supports multiple CNC programs, the authorization information may include: device identifier, authorization period, and program identifier. In this case, a separate authorization code can be obtained for each CNC program on the authorized device, and the authorization code and its corresponding CNC program identifier can be stored in an authorization file. This authorization file may be in INI format. The authorization file may be provided to the authorized device in advance, or the CNC program authorization device may provide the corresponding authorization code to the authorized device based on the program identifier carried in the authorization request when initiating the authorization request.

[0077] Accordingly, the information acquisition module 21 can read the authorization file of the authorized device and obtain the authorization code corresponding to the current CNC program from the authorization file based on the pre-established correspondence between the program identifiers of different CNC programs and the corresponding authorization codes.

[0078] The decoding module 22 is used to parse the authorization code to obtain the authorization information corresponding to the authorization code. In some embodiments, the decoding module 22 can perform the inverse operation of the set custom logic calculation on the authorization code to obtain the primary ciphertext; and perform the inverse operation of the symmetric encryption algorithm on the primary ciphertext to obtain the authorization information.

[0079] The verification module 23 is used to perform authorization verification of the current CNC program on the authorized device based on the authorization information, and return the verification result to the current CNC program, which then decides whether to run the program based on the verification result.

[0080] In some implementations, the information acquisition module 21 acquires the authorization code of the authorized device when the authorized device is powered on or when the set verification period expires. After acquiring the verification result, the verification module 23 can further cache the verification result in the memory of the authorized device. Subsequently, before the authorized device is powered off or before the set verification period expires, when the information acquisition module 21 is called by the current CNC program, it can directly read the verification result from the memory and return the read verification result to the current CNC program.

[0081] In some implementations, the information acquisition module 21, the decoding module 22, and the verification module 23 are isolated from the current CNC program, and the signal acquisition module 21 can be invoked by the current CNC program loaded onto the authorized device through a pre-set MMC communication protocol instruction that serves as a cross-layer communication bridge.

[0082] Figure 3 This is a schematic diagram of the structure of another CNC program authorization device in an embodiment of this application. Figure 3 As shown, the device 30 may include at least one memory 31 and at least one processor 32. It may also include other components, such as communication ports. These components communicate via a bus 33.

[0083] At least one memory 31 is used to store a computer program. In one embodiment, the computer program can be understood to include... Figure 2 The diagram shows the various modules of the CNC program authorization device. In addition, at least one memory 31 can store an operating system, etc. Operating systems include, but are not limited to: Android, Symbian, Windows, Linux, etc.

[0084] At least one processor 32 is used to read and execute the computer program to implement the CNC program authorization method described in the embodiments of this application. The processor 32 may be a CPU, processing unit / module, ASIC, logic module, or programmable gate array, etc. It can receive and send data through the communication port.

[0085] Furthermore, this application also provides a CNC program authorization system in its embodiments. Figure 4 This is a schematic diagram of the structure of the CNC program authorization system in an embodiment of this application. Figure 4The system 40 may include: an authorization encryption device 41 and an authorization device 20 or 30 for the CNC program as described in any of the above embodiments.

[0086] The authorization encryption device 41 is used to authorize a CNC program and encrypt the authorization information of the authorization device using an encryption algorithm to obtain the corresponding authorization code.

[0087] In some embodiments, the authorization encryption device 41 may use a symmetric encryption algorithm to encrypt plaintext information containing authorization information of the authorization device to obtain primary ciphertext; and perform secondary processing on the primary ciphertext using a set custom logic calculation to obtain the authorization code.

[0088] In some implementations, for authorized devices that support only a single CNC program, the authorization information may include: a device identifier and an authorization period. In other implementations, the authorization information may further include: a program identifier, in addition to the device identifier and authorization period. Furthermore, for authorized devices that support only a single CNC program, the authorization code may be stored in an authorization file provided to the authorized device in advance, or it may be provided to the authorized device when the CNC program's authorization device initiates an authorization request.

[0089] In some implementations, for an authorized device that supports multiple CNC programs, the authorization information may include: device identifier, authorization period, and program identifier. In this case, a separate authorization code can be obtained for each CNC program of the authorized device, and the authorization code and its corresponding CNC program identifier can be stored in an authorization file. This authorization file may be in INI format. Specifically, the authorization file may be provided to the authorized device in advance, or the CNC program authorization device may provide the corresponding authorization code to the authorized device based on the program identifier carried in the authorization request when initiating the authorization request.

[0090] Those skilled in the art will recognize that the descriptions in the embodiments of this application are merely exemplary and are not intended to limit the scope of protection of the embodiments of this application.

[0091] It should be noted that not all steps and modules in the above processes and structural diagrams are mandatory; some steps or modules can be omitted as needed. The execution order of the steps is not fixed and can be adjusted as required. The division of modules is merely for the convenience of description and functional division. In actual implementation, a module can be implemented by multiple modules, and the functions of multiple modules can also be implemented by the same module. These modules can be located in the same device or in different devices.

[0092] It is understood that the modules in the above embodiments can be purely software modules or hardware modules, and hardware modules can be implemented mechanically or electronically. For example, a hardware module may include specially designed permanent circuits or logic devices (such as dedicated processors, such as FPGAs or ASICs) to perform specific operations. A hardware module may also include programmable logic devices or circuits (such as general-purpose processors or other programmable processors) temporarily configured by software to perform specific operations. The specific method used to implement the hardware module—whether it is mechanical, a dedicated permanent circuit, or a temporarily configured circuit (such as one configured by software)—can be determined based on cost and time considerations.

[0093] Furthermore, this application embodiment also provides a computer program product, including a computer program that can be executed by a processor to implement the CNC program authorization method described in this application embodiment. This application embodiment also provides a computer-readable storage medium storing a computer program that can be executed by a processor to implement the CNC program authorization method described in this application embodiment. Specifically, a system or device equipped with a storage medium can be provided, on which software program code implementing the functions of any of the above embodiments is stored, and the computer (or CPU or MPU) of the system or device can read and execute the program code stored in the storage medium. Furthermore, the operating system or other system operating on the computer can perform some or all of the actual operations through instructions based on the program code. The program code read from the storage medium can also be written to a memory located in an expansion board inserted into the computer or to a memory located in an expansion unit connected to the computer. Subsequently, the CPU or other system installed on the expansion board or expansion unit can execute some or all of the actual operations based on the instructions of the program code, thereby implementing the functions of any of the above embodiments. Storage media implementations for providing program code include USB, floppy disk, hard disk, magneto-optical disk, optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tape, non-volatile memory cards, and ROM, etc. Alternatively, program code can be downloaded from a server computer via a communication network.

[0094] Compared with the prior art, the present invention has the following beneficial effects:

[0095] 1) Independent management of authorization: Authorization information is separated from CNC programs, and unified management is achieved through authorization documents. Different devices do not need to modify the program, only the authorization documents need to be replaced.

[0096] 2) Simplified and unified version: CNC programs with the same function do not need to be modified for different devices, which completely solves the problem of version proliferation and reduces maintenance costs.

[0097] 3) Excellent scalability: Supports independent authorization of most CNC programs. When adding a new CNC program, there is no need to modify the program framework, only the corresponding authorization code needs to be added.

[0098] 4) Virtual machine compatibility: Supports using the host MAC address as the device identifier in virtual machine scenarios, which solves the problem of authorization failure caused by the same virtual machine hardware serial number.

[0099] 5) High security: By using symmetric encryption algorithms such as AES encryption algorithm, and storing the authorization result in write-protected variables, it can prevent cracking and tampering.

[0100] 6) High-efficiency operation: The decryption cache is only executed once when the device is powered on or when the preset verification period expires. There is no duplicate calculation and the device's operating efficiency is not affected.

[0101] Those skilled in the art will understand that the features described in the various embodiments and / or claims disclosed in this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, without departing from the spirit and teachings of this application, the features described in the various embodiments and / or claims of this application can be combined and / or combined in various ways, and all such combinations and / or combinations fall within the scope of this application.

Claims

1. A method for authorizing CNC programs, characterized in that, include: When the pre-set decoding and verification program is invoked by the current CNC program loaded onto the authorized device, the decoding and verification program obtains the authorization code of the authorized device; the authorization code is: for the authorized device of the current CNC program, the authorization information of the authorized device is encrypted using an encryption algorithm to obtain the authorization code; The decoding and verification program parses the authorization code to obtain the authorization information corresponding to the authorization code; The decoding and verification program performs authorization verification on the authorized device for the current CNC program based on the authorization information, and returns the verification result to the current CNC program, which then decides whether to run the program based on the verification result.

2. The CNC program authorization method according to claim 1, characterized in that, The authorization information includes: device identifier and authorization period.

3. The CNC program authorization method according to claim 2, characterized in that, The same authorized device supports different CNC programs, and the authorization codes corresponding to different CNC programs are stored in the same authorization file; The authorization information further includes: program identifier; The decoding and verification program obtains the authorization code of the authorized device by: the decoding and verification program reads the authorization file of the authorized device, and obtains the authorization code of the current CNC program from the authorization file based on the pre-established correspondence between the program identifiers of different CNC programs and the corresponding authorization codes.

4. The CNC program authorization method according to claim 1, characterized in that, The decoding and verification program obtains the authorization code of the authorized device by: when the authorized device is powered on and started, or when the set verification period expires; After performing authorization verification of the current CNC program on the authorized device based on the authorization information, the method further includes: caching the verification result in the memory of the authorized device; Before the authorized device is powered off, or before the set verification period expires, when the decoding verification program is called by the current CNC program, it directly reads the verification result from the memory and returns the read verification result to the current CNC program.

5. The CNC program authorization method according to claim 4, characterized in that, The step of caching the verification result in the memory of the authorized device includes: caching the verification result in a write-protected system variable in the memory of the authorized device.

6. The method for authorizing a CNC program according to any one of claims 1 to 5, characterized in that, The decoding and verification program is isolated from the current CNC program; The pre-set decoding and verification program being invoked by the current CNC program loaded onto the authorized device includes: the current CNC program loaded onto the authorized device invoking the decoding and verification program through a pre-set communication protocol instruction that serves as a cross-layer communication bridge.

7. The method for authorizing a CNC program according to any one of claims 1 to 5, characterized in that, The encryption of the authorization information of the authorized device using an encryption algorithm includes: encrypting the plaintext information containing the authorization information of the authorized device using a symmetric encryption algorithm to obtain a primary ciphertext; and performing a secondary processing on the primary ciphertext using a set custom logic calculation to obtain an authorization code. The decoding and verification program includes: an authorization code acquisition subroutine; a decoding subroutine obtained based on the set custom logic calculation and the inverse operation of the symmetric encryption algorithm; and an authorization verification subroutine obtained based on the verification logic of the authorization information.

8. A CNC program authorization device, characterized in that, include: The information acquisition module is used to acquire the authorization code of the authorized device when the current CNC program loaded onto the authorized device is invoked. The authorization code is: for the authorized device in the current CNC program, the authorization information of the authorized device is encrypted using an encryption algorithm to obtain the authorization code; A decoding module is used to parse the authorization code to obtain the authorization information corresponding to the authorization code; The verification module is used to verify the authorization of the current CNC program for the authorized device based on the authorization information, and return the verification result to the current CNC program, which then decides whether to run the program based on the verification result.

9. The CNC program authorization device according to claim 8, characterized in that, The same authorized device supports different CNC programs, and the authorization codes corresponding to different CNC programs are stored in the same authorization file; The information acquisition module reads the authorization file of the authorized device and obtains the authorization code corresponding to the current CNC program from the authorization file based on the pre-established correspondence between the program identifiers of different CNC programs and the corresponding authorization codes.

10. The CNC program authorization device according to claim 8, characterized in that, The information acquisition module acquires the authorization code of the authorized device when the authorized device is powered on or when the set verification period expires. After performing authorization verification of the current CNC program on the authorized device based on the authorization information, the verification module further caches the verification result in the memory of the authorized device. Before the authorized device is powered off, or before the set verification period expires, when the information acquisition module is called by the current CNC program, it directly reads the verification result from the memory and returns the read verification result to the current CNC program.

11. The CNC program authorization device according to any one of claims 8 to 10, characterized in that, The information acquisition module, the decoding module, and the verification module are isolated from the current CNC program; The signal acquisition module is invoked by the current CNC program loaded onto the authorized device through a pre-set communication protocol instruction that serves as a cross-layer communication bridge.

12. A CNC program authorization device, characterized in that, include: At least one memory, wherein the at least one memory stores a computer program; as well as At least one processor, the at least one processor being configured to read and execute the computer program to implement the authorization method of the CNC program as described in any one of claims 1 to 7.

13. A CNC program authorization system, characterized in that, include: An authorization encryption device is used to encrypt the authorization information of a CNC program through an encryption algorithm to obtain a corresponding authorization code. and The authorization device for the CNC program as described in any one of claims 8 to 12.

14. The CNC program authorization system according to claim 13, characterized in that, The authorization encryption device uses a symmetric encryption algorithm to encrypt plaintext information containing authorization information of the authorization device to obtain primary ciphertext; the primary ciphertext is then processed a second time using a set custom logic calculation to obtain the authorization code.

15. The CNC program authorization system according to claim 13, characterized in that, The authorized encryption device uses a symmetric encryption algorithm to encrypt plaintext information containing the corresponding authorization information of the authorized device for each CNC program supported by the authorized device, thereby obtaining primary ciphertext. The primary ciphertext is then subjected to a second processing using a custom algorithm to obtain the corresponding authorization code. The corresponding authorization codes for different CNC programs are stored in an authorization file.

16. A computer-readable storage medium storing computer instructions; characterized in that, The computer instructions can be executed by at least one processor to implement the CNC program authorization method as described in any one of claims 1 to 7.

17. A computer program product, comprising a computer program; characterized in that, The computer program can be executed by at least one processor and implement the CNC program authorization method as described in any one of claims 1 to 7.