Program updating control method, storage medium and 3D printer
By storing the device data of the 3D printer in a specific storage area, the problem of re-leveling and setting data after the control program is updated is solved, and the effect of simplifying the operation process and improving the efficiency of use is achieved.
Patent Information
- Application Number
- CN202311315268.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-11
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2043-10-11
AI Technical Summary
After the control program of the 3D printer is updated, operations such as leveling and setting z-axis offset data need to be re-executed, resulting in cumbersome use.
The device data of the 3D printer is stored in a specific storage area, which will not be overwritten and erased when updating the control program, so that the 3D printer can still be run based on the original device data after update, omitting the steps of re-leveling and setting data.
The use steps of 3D printers are simplified, the complexity and time of operation are reduced, and the efficiency of the updated 3D printers is improved.
Smart Images

Figure CN119806565A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of 3D printing, and in particular to a program update control method, a storage medium and a 3D printer. Background Art
[0002] With the development of three-dimensional printing technology, the control programs configured in 3D printers need to be continuously upgraded and updated to better meet people's production and life needs.
[0003] However, currently, after the control program configured in the 3D printer is updated, the 3D printer needs to re-perform operations such as leveling and setting z-axis offset data when in use, which makes the process of using the 3D printer very cumbersome.
[0004] Therefore, how to simplify the operation process when reusing a 3D printer after updating the control program of the 3D printer has become a technical problem that needs to be solved urgently by those skilled in the art. Summary of the invention
[0005] The present application provides a program update control method, storage medium and 3D printer, in which the device data of the 3D printer is stored in a specific storage area, and the device data in the specific storage area will not be overwritten or erased when the control program of the 3D printer is updated. In this way, after the control program of the 3D printer is updated, the 3D printer can still be operated based on the original device data, omitting the steps of leveling the device and setting data again, and finally simplifying the use steps of the 3D printer.
[0006] In a first aspect, an embodiment of the present application provides a control method for program update, which is applied to a 3D printer, comprising:
[0007] Storing device data of the 3D printer in a specific storage area;
[0008] The control program of the 3D printer is updated, and the device data is read from the specific storage area to configure the updated control program.
[0009] In some embodiments, the 3D printer includes a memory, and the memory includes a memory; the step of updating the control program of the 3D printer includes:
[0010] reading a target control program from the memory;
[0011] The control program of the 3D printer is updated using the target control program.
[0012] In some embodiments, the memory further includes a non-volatile memory; and the program update control method further includes:
[0013] Acquire a first program set and store it in the non-volatile memory, wherein the first program set includes a plurality of first program data for updating the control program of the 3D printer, and the first program data includes a control program to be applied and a first verification code obtained by processing the control program to be applied;
[0014] Acquire the first program data from the first program set;
[0015] Verifying the control program to be applied in the first program data to obtain a second verification code;
[0016] comparing the second verification code with the first verification code in the first program data;
[0017] If the second verification code is the same as the first verification code, the control program to be applied is loaded into the memory as a target control program.
[0018] In some embodiments, the program update control method further includes:
[0019] If the second verification code is different from the first verification code, obtain the next first program data from the first program set, execute the step of verifying the control program to be applied in the first program data to obtain the second verification code, until the second verification code obtained by verifying the control program to be applied in the obtained first program data is the same as the first verification code, and load the control program to be applied corresponding to the second verification code identical to the first verification code into the memory as the target control program.
[0020] In some embodiments, the memory further includes a non-volatile memory; and the program update control method further includes:
[0021] Acquire a first program set and store it in the non-volatile memory, wherein the first program set includes a plurality of first program data for updating the control program of the 3D printer, and the first program data includes a control program to be applied and a first verification code obtained by processing the control program to be applied;
[0022] Verifying all the control programs to be applied in all the first program data in the first program set to obtain a second verification code corresponding to the control program to be applied;
[0023] Obtaining a second verification code in the first program data;
[0024] comparing the second verification code with the first verification code in the first program data;
[0025] If the second verification code is the same as the first verification code, the control program to be applied is loaded into the memory as a target control program.
[0026] In some embodiments, the program update control method further includes:
[0027] If the second verification code is not the same as the first verification code, obtain the second verification code in the next first program data, and execute the step of comparing the second verification code with the first verification code until the obtained second verification code is the same as the first verification code, and load the control program to be applied corresponding to the second verification code that is the same as the first verification code into the memory as the target control program.
[0028] In some embodiments, the program update control method further includes:
[0029] Delete the other contents in the first program set except the first program data corresponding to the target control program.
[0030] In some embodiments, the memory further includes a non-volatile memory; and the program update control method further includes:
[0031] Acquire a second program set and store it in the non-volatile memory, wherein the second program set includes first program data and a plurality of second program data, the first program data includes a control program to be applied and a first check code obtained by processing the control program to be applied, and the second program data includes a current control program and a third check code obtained by processing the current control program;
[0032] From the second program set, obtaining the first program data;
[0033] Verifying the control program to be applied in the first program data to obtain a second verification code;
[0034] comparing the second verification code with the first verification code in the first program data;
[0035] If the second verification code is the same as the first verification code, the control program to be applied is loaded into the memory as a target control program.
[0036] In some embodiments, the program update control method further includes:
[0037] If the second verification code is different from the first verification code, obtaining a second program data;
[0038] Verifying the current control program in the second program data to obtain a fourth verification code;
[0039] comparing the fourth verification code with the third verification code in the second program data;
[0040] If the fourth check code is the same as the third check code, the current control program is loaded into the memory as a target control program.
[0041] In some embodiments, the program update control method further includes:
[0042] If the fourth verification code is not the same as the third verification code, obtain the next second program data, execute the step of verifying the current control program in the second program data to obtain the fourth verification code, until the fourth verification code obtained by verifying the current control program in the second program data is the same as the third verification code, and load the current control program corresponding to the fourth verification code that is the same as the third verification code into the memory as the target control program.
[0043] In some embodiments, the program update control method further includes:
[0044] The other contents in the second program set except the first program data and the second program data including the target control program are deleted.
[0045] In some embodiments, the step of storing the device data of the 3D printer in a specific storage area includes:
[0046] Encrypting the device data of the 3D printer to obtain encrypted data, wherein the data type of the device data is a text file type;
[0047] The encrypted data is stored on a disk.
[0048] In some embodiments, reading the device data from the specific storage area to configure the updated control program includes:
[0049] When the updated control program is run, the encrypted data in the disk is decrypted to obtain device data;
[0050] loading the device data into a memory;
[0051] The updated control program is run using the device data in the memory. In a second aspect, an embodiment of the present application further provides a 3D printer, comprising:
[0052] Processor; and
[0053] A memory is arranged to store computer executable instructions, which when executed cause the processor to perform the control method of program updating.
[0054] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores one or more programs, and when the one or more programs are executed by a 3D printer including multiple application programs, the 3D printer executes a control method for updating the program.
[0055] In the above embodiment, a control method for program update, a storage medium and a 3D printer are provided. In this method, the device data of the 3D printer is stored in a specific storage area. The device data in the specific storage area will not be overwritten or erased when the control program of the 3D printer is updated. In this way, after the control program of the 3D printer is updated, the 3D printer can still be operated based on the original device data, omitting the steps of leveling the device again and setting the data, and finally simplifying the steps of using the 3D printer. The method includes: storing the device data of the 3D printer in a specific storage area; updating the control program of the 3D printer, and reading the device data from the specific storage area to configure the updated control program. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 The schematic diagram of the storage method of device data in the related art is exemplified;
[0057] Figure 2 A flowchart of a method for controlling program update is exemplarily shown according to some embodiments;
[0058] Figure 3 A schematic diagram of a storage method of device data provided according to some embodiments is exemplarily shown;
[0059] Figure 4 A flowchart of another program update control method is exemplarily shown according to some embodiments;
[0060] Figure 5 A flowchart of another program update control method is exemplarily shown according to some embodiments;
[0061] Figure 6 A schematic diagram of a storage method of multiple main programs provided according to some embodiments is exemplarily shown;
[0062] Figure 7 A schematic structural diagram of a control device for program updating provided according to some embodiments is exemplarily shown. DETAILED DESCRIPTION
[0063] In order to make the purpose and implementation method of the present application clearer, the exemplary implementation method of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.
[0064] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.
[0065] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances.
[0066] The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.
[0067] With the development of three-dimensional printing technology, the control programs configured in 3D printers need to be continuously upgraded and updated to better meet people's production and life needs.
[0068] However, currently, after the control program configured in the 3D printer is updated, the 3D printer needs to re-perform operations such as leveling and setting z-axis offset data when in use, which makes the process of using the 3D printer very cumbersome.
[0069] The reason is that the device data generated by the original leveling and setting of z-axis offset data will be erased or overwritten when the control program is upgraded. Although the device data of the 3D printer has not changed, it is still necessary to reset the device data when using the 3D printer again.
[0070] Figure 1 The following is a schematic diagram showing an exemplary storage method of device data in the related art. Figure 1 In the example, the device data is located in the data area in the corresponding storage location of the control program (in this example, the control program can be a program firmware, such as Marlin firmware). When the control program is upgraded using a bootloader, the data in the data area will be erased, so that the device data needs to be set again after the control program configured in the 3D printer is upgraded.
[0071] Therefore, how to simplify the operation process when reusing a 3D printer after updating the control program of the 3D printer has become a technical problem that needs to be solved urgently by those skilled in the art.
[0072] In order to solve the above technical problems, the embodiment of the present application provides a control method for program update, in which the device data of the 3D printer is stored in a specific storage area, and the device data in the specific storage area will not be overwritten or erased when the control program of the 3D printer is updated. In this way, after the control program of the 3D printer is updated, the 3D printer can still be operated based on the original device data, omitting the steps of leveling the device and setting data again, and finally simplifying the use steps of the 3D printer.
[0073] Figure 2 The flowchart of a control method for program update according to some embodiments is exemplarily shown. The method includes S100-S200.
[0074] S100: Storing device data of the 3D printer in a specific storage area.
[0075] In the embodiment of the present application, the device data of the 3D printer includes device-related data such as leveling data and / or z-axis offset data. The device data in the embodiment of the present application may be automatically generated by the 3D printer or may be manually set by the user.
[0076] In some embodiments, the specific storage area and the control program may be stored in the same storage area. Exemplarily, they may both be stored in a non-volatile storage area. In addition, the specific storage area and the control program may also be stored in a different storage area.
[0077] In the embodiment of the present application, the device data in the specific storage area will not be overwritten or erased when the control program of the 3D printer is updated. In this way, there is no need to reset the device data when the 3D printer is used subsequently, and the device data previously stored in the specific storage area can be directly used.
[0078] Figure 3 The following is a schematic diagram showing a storage method of device data according to some embodiments. Figure 3 In the example, the specific storage area is not within the storage location of the control program, and the device data stored in the specific storage area will not be overwritten due to the upgrade of the control program (in this example, the control program of the 3D printer can be program firmware, such as Marlin firmware). In this way, there is no need to set the device data again when running the 3D printer again, which simplifies the operation steps of using the 3D printer.
[0079] The method in the embodiment of the present application can be applied to a program firmware system (eg, a Marlin firmware system), and can also be applied to a host and host system architecture.
[0080] S200: updating the control program of the 3D printer, and reading the device data from the specific storage area to configure the updated control program.
[0081] In the embodiment of the present application, the control program is a piece of code. The control program is configured in the 3D printer, and can enable the 3D printer to perform a printing operation.
[0082] In some embodiments, the boot loader may perform the step of updating the control program of the 3D printer.
[0083] In some embodiments, the step of updating the control program of the 3D printer includes: obtaining a target control program from an external device, and using the target control program to update the control program of the 3D printer. In the embodiment of the present application, the control program of the 3D printer and the target control program may be program firmware, such as Marlin firmware. The target control program may be obtained from an external device using a communication interface such as a serial port, USB, or Ethernet.
[0084] In some embodiments, the 3D printer includes a memory, the memory includes a memory and a non-volatile memory; the step of updating the control program of the 3D printer includes:
[0085] Read the target control program from the memory;
[0086] The control program of the 3D printer is updated using the target control program.
[0087] In the embodiment of the present application, a target control program is pre-stored in the memory, and the target control program is read from the memory of the 3D printer when in use. The target control program read from the memory can be a program firmware, such as Marlin, or a main program in the upper and lower computer system architecture. The following is a detailed introduction to the process of determining the target control program when the target control program is the main program.
[0088] In some embodiments, Figure 4 A flowchart of another control method for program update according to some embodiments is exemplarily shown, including S201-S206. The method further includes:
[0089] S201. Obtain a first program set and store it in a non-volatile memory, wherein the first program set includes a plurality of first program data for updating a control program of a 3D printer, and the first program data includes a control program to be applied and a first verification code obtained by processing the control program to be applied.
[0090] Exemplarily, the version of the control program of the current 3D printer is version 1.0, and the control program to be applied in the first program data may be version 2.0, that is, used to upgrade the control program of the current 3D printer.
[0091] In order to avoid the failure of upgrading the control program of the 3D printer due to problems with the control program to be applied, a first program set is set in the embodiment of the present application. The first program set is provided with multiple first program data for updating the control program of the 3D printer. The multiple first program data initially set are the same data. Each first program data includes the control program to be applied and a first verification code corresponding to the control program to be applied. Due to power failure and other reasons, problems may occur in the control program to be applied in some of the first program data in the first program set. At this time, other first program data can be used to continue upgrading the control program of the 3D printer. This can avoid the failure of upgrading the control program of the 3D printer.
[0092] In the embodiment of the present application, the amount of first program data in the first program set can be set according to actual needs and is not limited here.
[0093] S202: Obtain a first program data from the first program set.
[0094] In the embodiment of the present application, the first program data in the first program set may be modified during the process of being downloaded to the 3D printer. Therefore, when using the control program to be applied in the first program data to upgrade, it is first necessary to verify the control program to be applied in the first program data downloaded to the 3D printer. When the control program to be applied is determined to have not been modified or no other problems have occurred through verification, the control program to be applied is used to upgrade the control program of the 3D printer.
[0095] S203, verifying the control program to be applied in the first program data to obtain a second verification code;
[0096] In some embodiments, when determining the first verification code in the first program data, an MD5 value may be calculated for the control program to be applied, and the MD5 value may be used as the first verification code. At the same time, in the same manner, an MD5 value may be calculated for the control program to be applied that has been downloaded to the 3D printer, and the MD5 value may be used as the second verification code.
[0097] In one example, the second verification code may be written at the end of the control program to be applied.
[0098] S204: Compare the second verification code with the first verification code in the first program data.
[0099] In the embodiment of the present application, the second verification code obtained by verifying the control program to be applied in the acquired first program data is compared with the first verification code in the acquired first program data. If the two are the same, it means that the control program to be applied is valid and correct, and the control program to be applied that has been downloaded to the 3D printer has not been tampered with or other problems.
[0100] S205: If the second verification code is the same as the first verification code, the control program to be applied is loaded into the memory as the target control program.
[0101] In the embodiment of the present application, the control program to be applied is loaded into the memory as the target control program, so that the target control program can be read from the memory later, and the control program of the 3D printer can be updated using the target control program.
[0102] In some embodiments, the method also includes: S206, if the second verification code is not the same as the first verification code, then obtaining the next first program data from the first program set, executing the step of verifying the control program to be applied in the first program data, and obtaining the second verification code, until the second verification code obtained by verifying the control program to be applied in the obtained first program data is the same as the first verification code, and the control program to be applied corresponding to the second verification code that is the same as the first verification code is loaded into the memory as the target control program.
[0103] In the embodiment of the present application, after obtaining a first program data, a second verification code corresponding to the control program to be applied in the first program data is obtained by calculation. If the second verification code is different from the first verification code, it means that the control program to be applied may be tampered with, or the download is interrupted due to power failure, causing the code to be abnormal. Therefore, the next first program data in the first program set can be obtained at this time, and the step of verifying the control program to be applied in the next first program data to obtain the second verification code is executed. In this way, when the control program to be applied of a first program data in the first program set cannot complete the upgrade of the control program of the 3D printer, the next first program data in the first program set can continue to be used until the control program of the 3D printer is successfully upgraded.
[0104] In one example, the first program set includes first program data A, first program data B, first program data C and first program data D, the first program data A includes a control program A to be applied and a first verification code A, the first program data B includes a control program B to be applied and a first verification code B, the first program data C includes a control program C to be applied and a first verification code C, and the first program data D includes a control program D to be applied and a first verification code D.
[0105] First, the first program data A is obtained from the first program set, and the control program A to be applied in the first program data A is verified to obtain the second verification code A, and the second verification code A is compared with the first verification code A. If they are not the same, the first program data B is obtained, and the control program B to be applied in the first program data B is verified to obtain the second verification code B, and the second verification code B is compared with the first verification code B. If they are not the same, the first program data C is obtained, and the control program C to be applied in the first program data C is verified to obtain the second verification code C, and the second verification code C is compared with the first verification code C. If they are the same, the control program C to be applied is loaded into the memory as the target control program.
[0106] In other embodiments, in addition to the above-mentioned solution of verifying the control program to be applied in the first program data to obtain the second verification code only when the first program data is obtained, it is also possible to verify all the control programs to be applied in the first program set directly after the first program set is obtained to obtain the second verification code corresponding to the control program to be applied. Specifically, Figure 5 A flowchart of another control method for program update according to some embodiments is exemplarily shown, including S207-S212. The method further includes:
[0107] S207, obtaining a first program set and storing it in a non-volatile memory, wherein the first program set includes a plurality of first program data for updating the control program of the 3D printer, and the first program data includes a control program to be applied and a first verification code obtained by processing the control program to be applied. The contents of step S207 are the same as those of step S201, and S201 has been described in detail above and will not be repeated here.
[0108] S208. Verify all control programs to be applied in the first program set to obtain a second verification code corresponding to the control program to be applied. The process of verifying and obtaining the second verification code has been described in detail above and will not be repeated here. It should be noted that, in an embodiment of the present application, after obtaining the first program set, all control programs to be applied in the first program set are calculated to obtain corresponding second verification codes. Exemplarily, the first program set includes first program data A and first program data B. At this time, the control program to be applied in the first program data A and the control program to be applied in the second program data B are verified to obtain a second verification code corresponding to the control program to be applied in the first program data A, and a second verification code corresponding to the control program to be applied in the second program data B.
[0109] S209: Obtain a second verification code in the first program data from the first program set.
[0110] Since all the control programs to be applied in the first program set have been verified in the embodiment of the present application, and each control program to be applied has been verified to obtain the corresponding second verification code, the second verification code in the first program data can be directly obtained in step S209.
[0111] S210, compare the second verification code with the first verification code in the first program data. Step S210 is the same as S204, and S204 has been described in detail above and will not be described again.
[0112] S211: If the second verification code is the same as the first verification code, the control program to be applied is loaded into the memory as the target control program.
[0113] S212. If the second verification code is not the same as the first verification code, obtain the second verification code in the next first program data, and perform the step of comparing the second verification code with the first verification code until the second verification code obtained is the same as the first verification code, and load the control program to be applied corresponding to the second verification code that is the same as the first verification code into the memory as the target control program.
[0114] Since all the control programs to be applied in the first program set have been verified in the embodiment of the present application to obtain the corresponding second verification code, this step can directly obtain the second verification code of the next first program data.
[0115] In some embodiments, the method further includes: deleting other contents in the first program set except the first program data corresponding to the target control program.
[0116] In an embodiment of the present application, when the second verification code is the same as the first verification code, the control program to be applied corresponding to the second verification code is determined as the target control program for upgrading the control program of the 3D printer. At this time, the first program data corresponding to other control programs to be applied in the first program set will no longer be used, so the first program data corresponding to other control programs to be applied that are not the target control program can be directly deleted to free up storage space in the 3D printer.
[0117] In some embodiments, the method further comprises:
[0118] A second program set is obtained and stored in the non-volatile memory, wherein the second program set includes first program data for updating the control program of the 3D printer and a plurality of second program data, wherein the first program data includes a control program to be applied and a first verification code obtained by processing the control program to be applied, and the second program data includes a current control program and a third verification code obtained by processing the current control program.
[0119] In the embodiment of the present application, in order to avoid problems with the control program to be applied in the first program data, second program data is also provided in the second program set, and the second program data includes the current control program and a third verification code obtained by processing the current control program. The current control program is a backup of the control program of the currently running 3D printer. The number of second program data in the second program set can be set according to actual needs and is not limited here.
[0120] From the second program set, obtaining the first program data;
[0121] Verifying the control program to be applied in the first program data to obtain a second verification code;
[0122] comparing the second verification code with the first verification code;
[0123] If the second verification code is the same as the first verification code, the control program to be applied is loaded into the memory as a target control program.
[0124] In an embodiment of the present application, the steps from obtaining the first program data from the second program set to loading the control program to be applied as the target control program into the memory if the second verification code is the same as the first verification code are executed in the same manner as steps S201-S205 above, and will not be repeated here.
[0125] In the embodiment of the present application, the control program to be applied in the first program data of the second program set is first verified. When the second verification code determined by the control program to be applied is the same as the first verification code, the control program to be applied is directly loaded into the memory as the target control program. If the second verification code is different from the first verification code, the control program of the 3D printer is continuously upgraded using the current control program in the second program data.
[0126] In some embodiments, if the second verification code is different from the first verification code, obtaining the second program data;
[0127] The current control program in the second program data is verified to obtain a fourth verification code. In the embodiment of the present application, the method for verifying the current control program in the second program data is the same as the method for verifying the control program to be applied in the first program data mentioned above, and will not be repeated.
[0128] comparing the fourth check code with the third check code;
[0129] If the fourth verification code is the same as the third verification code, loading the current control program as a target control program into the content;
[0130] If the fourth verification code is not the same as the third verification code, obtain the next second program data, execute the step of verifying the current control program in the second program data to obtain the fourth verification code, until the fourth verification code obtained by verifying the current control program in the second program data is the same as the third verification code, and load the current control program corresponding to the fourth verification code that is the same as the third verification code into the memory as the target control program.
[0131] In an embodiment of the present application, when the second verification code corresponding to the control program to be applied is different from the first verification code, the current control program is used to calculate the corresponding fourth verification code, and the fourth verification code is compared with the third verification code. In this way, when the control program to be applied cannot upgrade the control program of the 3D printer, the current control program can still be used to continue to ensure that the 3D printer can operate normally.
[0132] In some embodiments, the method further comprises:
[0133] The other contents in the second program set except the first program data and the second program data including the target control program are deleted.
[0134] In the embodiment of the present application, in order to free up more space, other contents in the second program set except the first program data and the second program data corresponding to the target control program stored in the memory may be deleted.
[0135] In the embodiment of the present application, it can be applied to the upper and lower computer system architecture. When applied to the upper and lower computer system architecture, the control program and target control program of the 3D printer are the main programs in the lower computer. The determination of the target control program when the control program and target control program of the 3D printer are the main programs is described in detail below.
[0136] In the related art, 3D printers use a system architecture of upper and lower computers, specifically including an upper computer and a lower computer. There are three main ways to upgrade the control program of the MCU (Microcontroller Unit) in the lower computer, that is, to upgrade the main program. The first is to upgrade through the debugging simulator protocol (for example, Jlink) / debugger (for example, Jtag); the second is to upgrade through TF / SD card; the third is for the upper computer to upgrade the lower computer through the bus protocol.
[0137] For the upper and lower computer system architecture, the Jlink / Jtag solution requires technicians to combine with corresponding professional tool software to implement, and does not have mass production capabilities, so the first method is not suitable for upgrading the main program; since the MCU is no longer equipped with a TF / SD card, the second program upgrade method is difficult to apply; in the third solution, the upper computer upgrades the lower computer through the bus protocol. During the process, the main program upgrade may fail due to some reasons (such as power failure). Therefore, in the mass production stage or in the hands of customers, if the lower computer is abnormal, the 3D printer will not be able to operate normally. Therefore, it is necessary to find a method to ensure the OTA (Over-the-Air Technology) upgrade of the lower computer, that is, the main program upgrade is more reliable.
[0138] In order to solve the problem of unreliable main program upgrade, the above-mentioned steps before reading the target control program from the memory may be performed in an embodiment of the present application.
[0139] Specifically, the lower computer runs the bootloader and the main program (MainAPP) of the MCU. The Bootloader is a special code located inside the MCU, which is mainly responsible for the startup of the lower computer system, the update of the firmware and the management of the communication interface. It can read the code and data of the application from a specific storage medium (non-volatile memory) and load it into the memory of the microcontroller. After that, the Bootloader can jump to the entry point of the application to achieve smooth system switching.
[0140] In some embodiments, a first program set is obtained by using a boot loader and stored in a non-volatile memory. The first program set includes a plurality of first program data, and the first program data includes a control program to be applied (main program) and a first check code obtained by processing the main program. When the main program is stored in a non-conscious memory, the plurality of main programs can be arranged in a certain order. The subsequent execution steps are the same as the execution steps after obtaining the first program set in the above text, and are not repeated here.
[0141] Figure 6 A schematic diagram of a storage method of multiple main programs according to some embodiments is exemplarily shown. Figure 5 There are three main programs in the system, including the first main program (Main App), the second main program (Main App backup1) and the third main program (Main App backup2). Figure 6In addition to displaying the main program, a second verification code calculated by the main program is also displayed. In an embodiment of the present application, after obtaining the first program set, all main programs in the first program set are directly verified to obtain the second verification code and place it at the end of the corresponding main program.
[0142] Of course, in the embodiment of the present application, the above-mentioned solution can also be adopted that after obtaining a main program from the first program set, only the obtained main program is verified to obtain the second verification value, and the remaining main programs are not verified in advance.
[0143] When the main programs in the first program set are initially set, the multiple main programs have the same content. However, errors may occur in some main programs in the first program set due to power outages and other reasons. When the original main program is upgraded using the erroneous main program, the upgrade fails. In an embodiment of the present application, a first program set including multiple main programs is set. When an upgrade fails when upgrading using one of the main programs, other main programs can be continued to be used for upgrading, thereby improving the reliability of the upgrade.
[0144] In other embodiments, a second program set is obtained by using a boot loader and stored in a non-volatile memory, the second program set including first program data and multiple second program data, the first program data including a control program to be applied (main program) and a first check code obtained by processing the control program to be applied, and the second program data including a current control program (currently running main program) and a third check code obtained by processing the current control program. The subsequent steps are the same as the execution steps after obtaining the second program set in the above text, and will not be repeated here.
[0145] In some embodiments, the step of storing the device data in the specific storage area includes:
[0146] The device data is encrypted to obtain encrypted data, the data type of the device data is a text file type, and the encrypted data is stored in a disk.
[0147] In the embodiment of the present application, the data type of the text file type is easy to understand but easy to be snooped, so when the data type of the device data is set to the text file type, the device data is encrypted, and the encrypted device data is not easy to be snooped. In addition, in the embodiment of the present application, the encrypted data is stored in the disk instead of the memory because when the 3D printer loses power, the data in the memory will be lost, while the encrypted data in the disk will not be lost.
[0148] In the embodiment of the present application, the step of encrypting the device data to obtain the encrypted data can also be applied to the scenario of FDM (Fused Deposition Modeling) type 3D printer. The device data of FDM type 3D printer is mostly text file type or binary text type. Although the text file type is easy to understand, it is easy to be spied on. Although the binary file has certain regularity, it is not easy to understand, and there are inconveniences in subsequent modification and debugging. Therefore, the embodiment of the present application sets the data type of the device data to the text file type and encrypts the device data, which can ensure the security of the device data.
[0149] In some embodiments, the method further comprises:
[0150] When the updated control program is run by using the boot loader, the encrypted data in the disk is decrypted to obtain the device data; the device data is loaded into the memory; and the updated control program is run by using the device data in the memory.
[0151] In the embodiment of the present application, after encrypting the device data, the encrypted data is obtained and stored in the disk. When the 3D printer is running, the encrypted data is decrypted to obtain the device data, and the device data is stored in the memory. The 3D printer parses the device data in the memory and then applies the device data.
[0152] In the above embodiment, a method for updating a control program is provided, in which the device data of a 3D printer is stored in a specific storage area, and the device data in the specific storage area will not be overwritten or erased when the control program of the 3D printer is updated. In this way, after the control program of the 3D printer is updated, the 3D printer can still be operated based on the original device data, omitting the steps of leveling the device again and setting data, and finally simplifying the steps of using the 3D printer. The method includes: storing the device data of the 3D printer in a specific storage area; updating the control program of the 3D printer, and reading the device data from the specific storage area to configure the updated control program.
[0153] In the embodiment of the present invention, as Figure 2 , Figure 4 and Figure 5 The specific implementation of the method shown in the embodiment provides a control program update device, such as Figure 7 As shown, the device includes: a storage unit 701 and an updating unit 702.
[0154] Storage unit 701, used to store device data of the 3D printer in a specific storage area;
[0155] The updating unit 702 is used to update the control program of the 3D printer and read the device data from the specific storage area to configure the updated control program.
[0156] In some embodiments, the apparatus further comprises:
[0157] A first acquisition unit is used to acquire a first program set and store it in the non-volatile memory, wherein the first program set includes a plurality of first program data for updating the control program of the 3D printer, and the first program data includes a control program to be applied and a first verification code obtained by processing the control program to be applied;
[0158] A second acquisition unit, configured to acquire a first program data from the first program set;
[0159] A first verification unit, configured to verify the control program to be applied in the first program data to obtain a second verification code;
[0160] a first comparison unit, configured to compare the second verification code with a first verification code in the first program data;
[0161] The first loading unit is configured to load the control program to be applied as a target control program into the memory if the second verification code is the same as the first verification code.
[0162] In some embodiments, the apparatus further comprises:
[0163] A third acquisition unit is used to obtain the next first program data from the first program set if the second verification code is different from the first verification code, and execute the step of verifying the control program to be applied in the first program data to obtain the second verification code, until the second verification code obtained by verifying the control program to be applied in the obtained first program data is the same as the first verification code, and the control program to be applied corresponding to the second verification code identical to the first verification code is loaded into the memory as the target control program.
[0164] In some embodiments, the apparatus further comprises:
[0165] a fourth acquisition unit, configured to acquire a first program set and store the first program set in the non-volatile memory, wherein the first program set includes a plurality of first program data for updating the control program of the 3D printer, the first program data including a control program to be applied and a first verification code obtained by processing the control program to be applied;
[0166] A second verification unit, configured to verify all control programs to be applied in all first program data in the first program set to obtain a second verification code corresponding to the control program to be applied;
[0167] a fifth obtaining unit, configured to obtain a second verification code in the first program data;
[0168] a second comparison unit, configured to compare the second verification code with a first verification code in the first program data;
[0169] The second loading unit is configured to load the control program to be applied as a target control program into the memory if the second verification code is the same as the first verification code.
[0170] In some embodiments, the apparatus further comprises:
[0171] The sixth acquisition unit is used to obtain the second verification code in the next first program data if the second verification code is not the same as the first verification code, and execute the step of comparing the second verification code with the first verification code until the second verification code obtained is the same as the first verification code, and the control program to be applied corresponding to the second verification code that is the same as the first verification code is loaded into the memory as the target control program.
[0172] In some embodiments, the apparatus further comprises:
[0173] The first deleting unit is used to delete other contents in the first program set except the first program data corresponding to the target control program.
[0174] In some embodiments, the apparatus further comprises:
[0175] a seventh acquisition unit, configured to acquire a second program set and store the second program set in the non-volatile memory, wherein the second program set includes first program data and a plurality of second program data, the first program data includes a control program to be applied and a first check code obtained by processing the control program to be applied, and the second program data includes a current control program and a third check code obtained by processing the current control program;
[0176] an eighth acquiring unit, configured to acquire the first program data from the second program set;
[0177] A third verification unit, configured to verify the control program to be applied in the first program data to obtain a second verification code;
[0178] a third comparison unit, configured to compare the second verification code with the first verification code in the first program data;
[0179] The third loading unit is configured to load the control program to be applied as a target control program into the memory if the second verification code is the same as the first verification code.
[0180] In some embodiments, the apparatus further comprises:
[0181] a ninth acquiring unit, configured to acquire a second program data if the second verification code is different from the first verification code;
[0182] a fourth verification unit, configured to verify the current control program in the second program data to obtain a fourth verification code;
[0183] a fourth comparison unit, configured to compare the fourth verification code with a third verification code in the second program data;
[0184] A fourth loading unit is used to load the current control program as a target control program into the memory if the fourth check code is the same as the third check code.
[0185] In some embodiments, the apparatus further comprises:
[0186] A tenth acquisition unit is used to acquire the next second program data if the fourth verification code is different from the third verification code, and execute the step of verifying the current control program in the second program data to obtain the fourth verification code, until the fourth verification code obtained by verifying the current control program in the second program data is the same as the third verification code, and load the current control program corresponding to the fourth verification code that is the same as the third verification code into the memory as the target control program.
[0187] In some embodiments, the apparatus further comprises:
[0188] The second deleting unit is used to delete other contents in the second program set except the first program data and the second program data including the target control program.
[0189] In some embodiments, the first storage unit specifically performs:
[0190] Encrypting the device data of the 3D printer to obtain encrypted data, wherein the data type of the device data is a text file type;
[0191] The encrypted data is stored on a disk.
[0192] In some embodiments, the updating unit specifically performs:
[0193] A decryption unit, used to decrypt the encrypted data in the disk to obtain device data when running the updated control program;
[0194] A loading unit, used for loading the device data into a memory;
[0195] An operating unit is used to operate the updated control program using the device data in the memory.
[0196] An embodiment of the present invention further provides a 3D printer, comprising:
[0197] Processor; and
[0198] A memory is arranged to store computer executable instructions, which when executed cause the processor to perform the control method of program updating.
[0199] An embodiment of the present invention further provides a computer-readable storage medium storing one or more programs, which, when executed by a 3D printer including a plurality of application programs, enables the 3D printer to execute the control method for program update.
[0200] In an embodiment of the present invention, a 3D printer includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the following is achieved: Figure 2 , Figure 4 and Figure 5 The control method of program update shown.
[0201] It should be noted that for other corresponding descriptions of the functional units involved in the 3D printer and the program update control device provided in this embodiment, reference can be made to Figure 2 , Figure 4 and Figure 5 The corresponding descriptions in all the above contents in the specification of the present invention will not be repeated here.
[0202] Based on the above Figure 2 , Figure 4 and Figure 5 The method shown in the embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned Figure 1 , Figure 2 The control method of program update shown.
[0203] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product. The software product to be identified can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for enabling a 3D printer (which can be a personal computer, a server, or a network device, etc.) to execute the methods of various implementation scenarios of the present application.
[0204] Based on the above Figure 2 , Figure 4 and Figure 5 The method shown, and Figure 7 In order to achieve the above-mentioned purpose, the present embodiment also provides a control entity device for program update, which can be a personal computer, a server, a smart phone, a tablet computer, a smart watch, or other network devices, etc. The entity device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 2 , Figure 4 and Figure 5 The method shown.
[0205] The physical device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.
[0206] Those skilled in the art will appreciate that the program update control entity device structure provided in this embodiment does not constitute a limitation on the entity device, and may include more or fewer components, or a combination of certain components, or different component arrangements.
[0207] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware of the physical device and the software resources to be identified, and supports the operation of the information processing program and other software and / or programs to be identified. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.
[0208] The present application also provides the following embodiments:
[0209] Embodiment 1: A program update control method, applied to a 3D printer, comprising:
[0210] Storing device data of the 3D printer in a specific storage area;
[0211] The control program of the 3D printer is updated, and the device data is read from the specific storage area to configure the updated control program.
[0212] Embodiment 2: According to the control method for program update of embodiment 1, the 3D printer includes a memory, and the memory includes a memory; the step of updating the control program of the 3D printer includes:
[0213] reading a target control program from the memory;
[0214] The control program of the 3D printer is updated using the target control program.
[0215] Embodiment 3: According to the program update control method of embodiment 2, the memory further includes a non-volatile memory; the method further includes:
[0216] Acquire a first program set and store it in the non-volatile memory, wherein the first program set includes a plurality of first program data for updating the control program of the 3D printer, and the first program data includes a control program to be applied and a first verification code obtained by processing the control program to be applied;
[0217] Acquire the first program data from the first program set;
[0218] Verifying the control program to be applied in the first program data to obtain a second verification code;
[0219] comparing the second verification code with the first verification code in the first program data;
[0220] If the second verification code is the same as the first verification code, the control program to be applied is loaded into the memory as the target control program.
[0221] Embodiment 4: The control method for program update according to embodiment 3 further includes:
[0222] If the second verification code is different from the first verification code, obtain the next first program data from the first program set, execute the step of verifying the control program to be applied in the first program data to obtain the second verification code, until the second verification code obtained by verifying the control program to be applied in the obtained first program data is the same as the first verification code, and load the control program to be applied corresponding to the second verification code identical to the first verification code into the memory as the target control program.
[0223] Embodiment 5: According to the program update control method of embodiment 2, the memory further includes a non-volatile memory; the method further includes:
[0224] Acquire a first program set and store it in the non-volatile memory, wherein the first program set includes a plurality of first program data for updating the control program of the 3D printer, and the first program data includes a control program to be applied and a first verification code obtained by processing the control program to be applied;
[0225] Verifying all the control programs to be applied in all the first program data in the first program set to obtain a second verification code corresponding to the control program to be applied;
[0226] Obtaining a second verification code in the first program data;
[0227] comparing the second verification code with the first verification code in the first program data;
[0228] If the second verification code is the same as the first verification code, the control program to be applied is loaded into the memory as the target control program.
[0229] Embodiment 6: The control method for program update according to embodiment 5 further includes:
[0230] If the second verification code is not the same as the first verification code, obtain the second verification code in the next first program data, and execute the step of comparing the second verification code with the first verification code until the obtained second verification code is the same as the first verification code, and load the control program to be applied corresponding to the second verification code that is the same as the first verification code into the memory as the target control program.
[0231] Embodiment 7: The control method for program update according to any one of embodiments 3-6 further includes:
[0232] Delete the other contents in the first program set except the first program data corresponding to the target control program.
[0233] Embodiment 8: According to the program update control method of embodiment 2, the memory further includes a non-volatile memory; the method further includes:
[0234] Acquire a second program set and store it in the non-volatile memory, wherein the second program set includes first program data and a plurality of second program data, the first program data includes a control program to be applied and a first check code obtained by processing the control program to be applied, and the second program data includes a current control program and a third check code obtained by processing the current control program;
[0235] From the second program set, obtaining the first program data;
[0236] Verifying the control program to be applied in the first program data to obtain a second verification code;
[0237] comparing the second verification code with the first verification code in the first program data;
[0238] If the second verification code is the same as the first verification code, the control program to be applied is loaded into the memory as the target control program.
[0239] Embodiment 9: The control method for program update according to embodiment 8 further includes:
[0240] If the second verification code is different from the first verification code, obtaining a second program data;
[0241] Verifying the current control program in the second program data to obtain a fourth verification code;
[0242] comparing the fourth verification code with the third verification code in the second program data;
[0243] If the fourth check code is the same as the third check code, the current control program is loaded into the memory as the target control program.
[0244] Embodiment 10: The control method for program update according to embodiment 9 further includes:
[0245] If the fourth verification code is not the same as the third verification code, obtain the next second program data, execute the step of verifying the current control program in the second program data to obtain the fourth verification code, until the fourth verification code obtained by verifying the current control program in the second program data is the same as the third verification code, and load the current control program corresponding to the fourth verification code that is the same as the third verification code into the memory as the target control program.
[0246] Embodiment 11: The control method for program update according to any one of embodiments 8-10, further comprising:
[0247] The other contents in the second program set except the first program data and the second program data including the target control program are deleted.
[0248] Embodiment 12: According to the control method for program update of embodiment 1, the step of storing the device data of the 3D printer in a specific storage area comprises:
[0249] Encrypting the device data of the 3D printer to obtain encrypted data, wherein the data type of the device data is a text file type;
[0250] The encrypted data is stored on a disk.
[0251] Embodiment 13, according to the control method for program update of embodiment 12, the step of reading the device data from the specific storage area to configure the updated control program comprises:
[0252] When the updated control program is run, the encrypted data in the disk is decrypted to obtain device data;
[0253] loading the device data into a memory;
[0254] The updated control program is run using the device data in the memory.
[0255] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform, or by hardware. The device data of the 3D printer is stored in a specific storage area, and the device data in the specific storage area will not be overwritten or erased when the control program of the 3D printer is updated. In this way, after updating the control program of the 3D printer, the 3D printer can still be run based on the original device data, omitting the steps of leveling the device again and setting the data, and finally simplifying the use steps of the 3D printer. The above serial numbers of this application are for description only and do not represent the advantages and disadvantages of the implementation scenarios. The above discloses only several specific implementation scenarios of the present application, but the present application is not limited to this, and any changes that can be thought of by those skilled in the art should fall within the scope of protection of the present application.
Claims
1. A program update control method, applied to a 3D printer, characterized in that: include: Storing device data of the 3D printer in a specific storage area; The control program of the 3D printer is updated, and the device data is read from the specific storage area to configure the updated control program.
2. The program update control method according to claim 1, characterized in that: The 3D printer includes a memory, and the memory includes a memory; the step of updating the control program of the 3D printer includes: reading a target control program from the memory; The control program of the 3D printer is updated using the target control program.
3. The program update control method according to claim 2, characterized in that: The memory further includes a non-volatile memory; and the method further includes: Acquire a first program set and store it in the non-volatile memory, wherein the first program set includes a plurality of first program data for updating the control program of the 3D printer, and the first program data includes a control program to be applied and a first verification code obtained by processing the control program to be applied; Acquire the first program data from the first program set; Verifying the control program to be applied in the first program data to obtain a second verification code; comparing the second verification code with the first verification code in the first program data; If the second verification code is the same as the first verification code, the control program to be applied is loaded into the memory as the target control program.
4. The program update control method according to claim 3, characterized in that: Also includes: If the second verification code is different from the first verification code, obtain the next first program data from the first program set, execute the step of verifying the control program to be applied in the first program data to obtain the second verification code, until the second verification code obtained by verifying the control program to be applied in the obtained first program data is the same as the first verification code, and load the control program to be applied corresponding to the second verification code identical to the first verification code into the memory as the target control program.
5. The program update control method according to claim 2, characterized in that: The memory further includes a non-volatile memory; and the method further includes: Acquire a second program set and store it in the non-volatile memory, wherein the second program set includes first program data and a plurality of second program data, the first program data includes a control program to be applied and a first check code obtained by processing the control program to be applied, and the second program data includes a current control program and a third check code obtained by processing the current control program; From the second program set, obtaining the first program data; Verifying the control program to be applied in the first program data to obtain a second verification code; comparing the second verification code with the first verification code in the first program data; If the second verification code is the same as the first verification code, the control program to be applied is loaded into the memory as the target control program.
6. The program update control method according to claim 5, characterized in that: Also includes: If the second verification code is different from the first verification code, obtaining a second program data; Verifying the current control program in the second program data to obtain a fourth verification code; comparing the fourth check code with the third check code in the second program data; If the fourth check code is the same as the third check code, the current control program is loaded into the memory as the target control program.
7. The program update control method according to claim 1, characterized in that: The step of storing the device data of the 3D printer in a specific storage area comprises: Encrypting the device data of the 3D printer to obtain encrypted data, wherein the data type of the device data is a text file type; The encrypted data is stored on a disk.
8. The program update control method according to claim 7, characterized in that: The reading of the device data from the specific storage area to configure the updated control program comprises: When the updated control program is run, the encrypted data in the disk is decrypted to obtain device data; loading the device data into a memory; The updated control program is run using the device data in the memory.
9. A 3D printer, comprising: processor; as well as A memory arranged to store computer executable instructions, characterized in that when the executable instructions are executed, the processor executes the control method for program update according to any one of claims 1 to 8.
10. A computer-readable storage medium storing one or more programs, characterized in that: When the one or more programs are executed by a 3D printer including a plurality of application programs, the 3D printer executes the program updating control method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Program updating method and system of sensor controlled vehicle
CN103777988A
Method and device for operating upgrade data packet of numerical control machine tool
CN107395666A
Remote upgrading method and device, terminal equipment and storage medium
CN113407212A
Data storage method, device and equipment of air conditioner and storage medium
CN113849510A
Remote updating method and system for set-up printer program and data
CN1588312A