Burning method and device, electronic equipment and storage medium
By adjusting the order of the boot image file in the burning configuration file to after the target image file, the boot anomaly problem caused by incomplete burning in the existing technology is solved, and a fast and accurate image file integrity judgment is achieved.
Patent Information
- Application Number
- CN202311142572.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-05
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2043-09-05
AI Technical Summary
In the current burning process, testers may disconnect the cable before the file is completely burned in order to speed up the process. This can cause some machines to get stuck on the logo or other abnormal problems during startup, making it difficult to quickly determine whether the burning is complete.
By obtaining the burning configuration file and multiple image files, the burning order of the boot image files is adjusted to be after the target image file. The burning is then performed according to the adjusted sequence, and the integrity of the image file is quickly determined when the boot fails.
It can quickly determine whether the image file is complete, improving the accuracy and efficiency of the burning process and avoiding boot abnormalities caused by incomplete burning of some files.
Smart Images

Figure CN117270892B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data storage technology, specifically to a burning method, apparatus, electronic device, and storage medium. Background Technology
[0002] Burning refers to the process of burning desired data onto a special medium using tools such as a CD burner. However, current burning processes generally use a one-to-many burning method. Sometimes, in order to speed up the process, testers will disconnect the connection before the file is completely burned. This can cause some machines to get stuck on the logo during boot or other abnormal problems. When such problems occur, it is necessary to read back the image file and compare it to determine whether the burning is incomplete, which makes it difficult to quickly determine whether the burning is complete. Summary of the Invention
[0003] This application discloses a burning method, apparatus, electronic device, and storage medium, which can quickly determine whether the burned image file is complete, making it convenient and fast.
[0004] The first aspect of this application discloses a programming method, the method comprising:
[0005] Obtain a burning configuration file and multiple first image files; the burning configuration file includes configuration information corresponding to each first image file and a burning sequence composed of the multiple first image files; the multiple first image files include at least one or more target image files and a boot image file;
[0006] The burning order corresponding to the boot image file is adjusted to a specified position in the burning sequence to obtain an adjusted burning sequence; the specified position includes being arranged after some or all of the target image files;
[0007] According to the adjusted burning sequence, each of the first image files is burned into the memory in sequence based on the configuration information corresponding to each of the first image files.
[0008] As an optional implementation, in the first aspect of this application, before burning each target image file and the boot image file to the memory according to the adjusted burning sequence and the configuration information corresponding to each of the first image files, the method further includes:
[0009] Determine the historical boot image files and corresponding configuration information burned into the memory;
[0010] The historical boot image file in the memory is erased according to the configuration information corresponding to the historical boot image file.
[0011] As an optional implementation, adjusting the burning order corresponding to the boot image file to a specified position in the burning sequence to obtain an adjusted burning sequence includes:
[0012] The burning order corresponding to the boot image file is adjusted to the last position of the burning sequence to obtain the adjusted burning sequence;
[0013] Based on the configuration information corresponding to the historical boot image file, the historical boot image file in the storage is erased, including:
[0014] Based on the configuration information corresponding to the last historical image file burned into the memory, the last historical image file burned into the memory is erased.
[0015] As an optional implementation, in the first aspect of the embodiments of this application, the configuration information includes a programming address and a programming identifier;
[0016] The step of burning each target image file and boot image file to the memory sequentially according to the adjusted burning sequence and the configuration information corresponding to each of the first image files includes:
[0017] According to the adjusted burning sequence, each of the first image files is burned to the corresponding burning address in the memory in sequence, and the burning progress of each of the first image files is recorded using the burning identifier corresponding to each of the first image files.
[0018] As an optional implementation, in the first aspect of the embodiments of this application, before adjusting the burning order corresponding to the boot image file to the specified position of the burning sequence, the method further includes:
[0019] The programming configuration file is parsed;
[0020] The configuration information in the parsed burning configuration file is read line by line, and the burning order of each first image file is determined according to the order of the image files corresponding to the read configuration information.
[0021] The burning sequence is constructed according to the burning order corresponding to each of the first image files.
[0022] As an optional implementation, in the first aspect of the embodiments of this application, obtaining a plurality of first image files includes:
[0023] An intermediate file is generated based on the target program data; the target program data is the program data that needs to be burned into the memory; the intermediate file is a file directly generated based on the target program data.
[0024] The file size of the intermediate file is adjusted according to the storage space of the memory to obtain the first image file.
[0025] As an optional implementation, in the first aspect of the embodiments of this application, the method further includes:
[0026] If the operation of stopping the burning of the memory is detected, the electronic device corresponding to the memory is controlled to power on.
[0027] If the electronic device successfully performs the power-on operation, then the electronic device is transferred to the next workstation;
[0028] If the electronic device fails to perform the power-on operation, a programming error message is generated and output.
[0029] As an optional implementation, in the first aspect of the embodiments of this application, the step of transferring the electronic device to the next workstation if the electronic device successfully performs the power-on operation includes:
[0030] If the electronic device successfully performs the power-on operation, it reads the multiple second image files burned into the memory and compares the read multiple second image files with the multiple first image files;
[0031] If the plurality of second image files are identical to the plurality of first image files, then the electronic device is transferred to the next workstation;
[0032] If any of the second image files is different from the first image file, a burning error message is generated and output.
[0033] A second aspect of this application discloses a programming apparatus, the apparatus comprising:
[0034] The file acquisition module is used to acquire the burning configuration file and multiple first image files; the burning configuration file includes configuration information corresponding to each first image file and a burning sequence composed of the multiple first image files; the multiple first image files include at least one or more target image files and a boot image file;
[0035] The file adjustment module is used to adjust the burning order of the boot image file to a specified position in the burning sequence to obtain the adjusted burning sequence; the specified position includes being arranged after some or all of the target image files;
[0036] The file burning module is used to burn each of the first image files into the memory in sequence according to the adjusted burning sequence and the configuration information corresponding to each of the first image files.
[0037] The third aspect of this application discloses an electronic device, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor implements a programming method disclosed in the first aspect of this application.
[0038] The fourth aspect of this application discloses a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements a burning method disclosed in the first aspect of this application.
[0039] Compared with related technologies, the embodiments of this application have the following beneficial effects:
[0040] By acquiring the burning configuration file and multiple first image files, a burning sequence is obtained, consisting of the burning order of the target image files and the boot image files within the first image files. Then, the burning order of the boot image files is adjusted to a specified position in the burning sequence, and each target image file and boot image file is burned according to the adjusted burning sequence. Since the burning order corresponding to the boot image files is adjusted to after some or all of the target image files, and burning is performed according to the adjusted burning sequence, if a burning interruption occurs during the file burning process, it is possible to quickly determine whether some or all of the multiple first image files to be burned are completely burned by directly checking whether the boot function guaranteed by the boot image file is normal. This allows for quick and convenient determination of whether the burned image files are complete. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is an application scenario diagram of the programming method disclosed in the embodiments of this application;
[0043] Figure 2 This is a schematic flowchart of a programming method disclosed in an embodiment of this application;
[0044] Figure 3 This is a schematic flowchart of another programming method disclosed in an embodiment of this application;
[0045] Figure 4 This is a schematic flowchart of another programming method disclosed in the embodiments of this application;
[0046] Figure 5 This is a schematic flowchart of another programming method disclosed in the embodiments of this application;
[0047] Figure 6 This is a schematic diagram of the structure of a programming device disclosed in an embodiment of this application;
[0048] Figure 7 This is a schematic diagram of another programming device disclosed in the embodiments of this application;
[0049] Figure 8 This is a schematic diagram of another programming device disclosed in the embodiments of this application;
[0050] Figure 9 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application. Detailed Implementation
[0051] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0052] It should be noted that the terms "comprising" and "having," and any variations thereof, in the embodiments and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0053] This application discloses a burning method, apparatus, electronic device, and storage medium, which can quickly determine whether the burned image file is complete. The following is a detailed description in conjunction with the accompanying drawings.
[0054] Please see Figure 1 , Figure 1 This is an application scenario diagram of the programming method disclosed in the embodiments of this application. For example... Figure 1As shown, the device may include a burning device 10 and an electronic device 20. The burning device 10 may include, but is not limited to, a burner, a burner, or a burning system. The electronic device 20 may include, but is not limited to, desktop computers, tablets, laptops, mobile phones, and wearable devices. The burning device 10 and the electronic device 20 may include at least a central processing unit (CPU), and the electronic device 20 may also include a memory for storing data or files burned by the burning device 10 to the electronic device 20. The computer system in the burning device 10 and the electronic device 20 may include, but is not limited to, Windows, Linux, iOS, or Unix, and is not specifically limited thereto.
[0055] The programming device 10 is wired to the electronic device 20. The programming device 10 acquires a programming configuration file and multiple first image files. The programming configuration file includes configuration information corresponding to each first image file, and a programming sequence consisting of the programming order of the multiple first image files. The multiple first image files include at least one or more target image files and a boot image file. The programming device 10 adjusts the programming order of the boot image file to a specified position in the programming sequence, that is, arranges it after some or all of the target image files. Following the adjusted programming order, the programming device 10 sequentially programs each first image file into the memory of the electronic device 20 according to the configuration information of each first image file.
[0056] Please see Figure 2 , Figure 2 This is a schematic flowchart of a programming method disclosed in an embodiment of this application. This programming method can be applied to... Figure 1 The programming device 10 shown is an example. Figure 2 As shown, the method may include the following steps:
[0057] 210. Obtain the burning configuration file and multiple first image files; the burning configuration file includes the configuration information corresponding to each first image file and the burning sequence consisting of multiple first image files; the multiple first image files include at least one or more target image files and boot image files.
[0058] In this embodiment, the programming device can receive a programming configuration file and multiple first image files sent by an external device, or the programming device can actively search for and download the programming configuration file and multiple first image files stored in the external device. The programming configuration file is a file containing configuration information of the data or file to be programmed; the configuration information refers to the information required to program the data or file to be programmed, such as programming address and programming identifier. The programming address refers to the address in the memory where the data or file to be programmed is to be programmed, and the programming identifier refers to information such as the name used to identify the data or file to be programmed; the configuration information may also include information such as the programming operation to be performed on the data or file to be programmed.
[0059] The burning configuration file includes configuration information corresponding to each first image file and a burning sequence consisting of multiple first image files. A first image file refers to the image file to be burned into the memory of the electronic device. An image file is a single file created from a specific series of files according to a certain format for easy download and use by the user. The burning sequence is the order in which the first image files are burned. The burning order refers to the position of the first image files during burning. Each first image file includes at least one or more target image files and a boot image file. The boot image file is the bootloader file, primarily used to boot the operating system from the partition with the activation flag after the system hardware self-test. Target image files refer to image files other than the boot image file used to implement other functions.
[0060] 220. Adjust the burning order of the boot image file to the specified position in the burning sequence to obtain the adjusted burning sequence; the specified position includes being arranged after some or all of the target image files.
[0061] In this embodiment, the burning device determines the burning order of each target image file and the burning order of the boot image file according to the burning sequence in the burning configuration file. Then, the burning device adjusts the burning order of the boot image file to a specified position in the burning sequence, that is, it arranges the burning order of the boot image file after the burning order of some or all the target image files. In other words, the burning sequence is adjusted so that some or all the target image files are burned first, followed by the burning of the boot image file.
[0062] 230. According to the adjusted burning sequence, and based on the configuration information corresponding to each first image file, burn each first image file to the memory in sequence.
[0063] In this embodiment of the application, the burning device sequentially burns each acquired first image file into the memory of the electronic device according to the configuration information corresponding to each first image file and the burning order corresponding to each first image file in the adjusted burning sequence.
[0064] For example, the programming device acquires three first image files, including target image file a, target image file b, and a boot image file. The programming sequence in the programming configuration file acquired by the programming device is target image file a, boot image file, and target image file b. That is, if programming is performed according to the programming sequence, target image file a is programmed first, followed by the boot image file, and finally target image file b. The programming device adjusts the programming order of the boot image file to be after target image file b, so the adjusted programming sequence becomes target image file a, target image file b, and boot image file. Based on the configuration information corresponding to target image file a, target image file b, and boot image file respectively, the programming device programs target image file a, target image file b, and boot image file into the memory of the electronic watch in the programming order of target image file a, target image file b, and boot image file.
[0065] By adopting the above embodiment, since the burning order corresponding to the boot image file is adjusted to after some or all of the target image files, and burning is performed according to the adjusted burning sequence, if a burning interruption occurs during the file burning process, it is possible to quickly determine whether some or all of the target image files that need to be burned before the burning of multiple first image files are completely burned by directly checking whether the boot function guaranteed by the boot image file is normal. This allows for quick and convenient determination of whether the burned image files are complete.
[0066] In one embodiment, see Figure 3 , Figure 3 This is a schematic flowchart of another programming method disclosed in an embodiment of this application, which can be applied to... Figure 1 The programming device 10 shown is an example. Figure 3 As shown, the method may include the following steps:
[0067] 310. Obtain the burning configuration file and multiple first image files; the burning configuration file includes the configuration information corresponding to each first image file and the burning sequence consisting of multiple first image files; the multiple first image files include at least one or more target image files and boot image files.
[0068] 320. Adjust the burning order of the boot image file to the specified position in the burning sequence to obtain the adjusted burning sequence; the specified position includes being arranged after some or all of the target image files.
[0069] 330. Determine the historical boot image files and corresponding configuration information burned into the memory.
[0070] In this embodiment, after obtaining the burning configuration file and multiple first image files, the burning device adjusts the burning order of the boot image files to a specified position in the burning sequence, resulting in an adjusted burning sequence. The burning device then enters burning mode, a mode in which the burning device initiates the burning of specific data to the electronic device's memory. After entering burning mode, before burning each first image file, the burning device can determine the historical boot image files burned to the memory and the configuration information corresponding to those historical boot image files. Since each burning process can be considered as burning a version of the image file, the current burning process is considered as burning the current version of the image file. The historical boot image files are the boot image files previously burned to the electronic device's memory before this burning, or the boot image files burned in previous versions. The configuration information corresponding to the historical boot image files includes the information required to burn the boot image files to the electronic device's memory in the past, such as the address information and name information of the historical boot image files.
[0071] 340. Erase the historical boot image files in the storage device according to the configuration information corresponding to the historical boot image files.
[0072] In this embodiment, the programming device determines the name and location of previously programmed historical boot image files in the memory based on the configuration information corresponding to the historical boot image files, locates the historical boot image files, and erases them. The erasure operation can involve uniformly changing the binary data constituting the historical boot image file to 0; no specific limitation is made here.
[0073] In some embodiments, the programming device performs a process of adjusting the programming order corresponding to the boot image file to a specified position in the programming sequence to obtain an adjusted programming sequence, specifically including the following steps:
[0074] Adjust the burning order of the boot image file to the last position of the burning sequence to obtain the adjusted burning sequence;
[0075] The programming device performs a process of erasing the historical boot image file in the memory based on the configuration information corresponding to the historical boot image file. This process includes the following steps:
[0076] Based on the configuration information corresponding to the last historical image file burned into the memory, the last historical image file burned into the memory is erased.
[0077] In this embodiment, the programming device adjusts the programming order of the boot image file to the last position in the programming sequence. That is, during the current programming process, the boot image file is placed after all target image files for programming, thus obtaining the adjusted programming sequence. The programming device then enters programming mode, and before programming each first image file, it first determines the configuration information corresponding to the last image file programmed into the memory. This involves determining the configuration information, such as name and programming address, of the last image file programmed into the memory during the previous programming process, thereby quickly locating and determining the last image file programmed into the memory and its location during the previous programming process. The programming device then erases the last image file programmed into the memory during the previous programming process based on the determined configuration information.
[0078] The programming device can mark the last image file to be programmed each time, so that it can quickly find and identify the last image file to be programmed to the memory during the next programming process, and erase it.
[0079] By adopting the above embodiment, by adjusting the burning order of the boot image file to the last one in each burning process, it is possible to quickly determine whether each image file has been burned completely by judging whether the electronic device where the memory is located can be powered on normally after the burning is completed. Furthermore, it is possible to quickly erase the last image file burned to the memory in the previous burning process before each burning, so as to avoid the image file interfering with the judgment of the burning result.
[0080] 350. According to the adjusted burning sequence, and based on the configuration information corresponding to each first image file, burn each first image file to the memory in sequence.
[0081] In this embodiment of the application, after the burning device enters the burning mode and erases the historical boot image file, the burning device starts to burn each of the first image files to the memory of the electronic device in sequence according to the configuration information corresponding to each first image file and the burning order corresponding to each first image file in the adjusted burning sequence, so as to realize the burning of the current version.
[0082] By using the above embodiments, the boot image files previously burned into the memory can be erased before the current burning process. This avoids the situation where some first image files are not completely burned during the current burning process, but the electronic device where the memory is located can still boot normally based on the historical boot image files, which would lead to an error in judging whether the image files are burned completely. This effectively improves the accuracy of judging whether some or all of the target image files are burned completely.
[0083] In one embodiment, see Figure 4 , Figure 4 This is a schematic flowchart of another programming method disclosed in the embodiments of this application. This method can be applied to... Figure 1 The programming device 10 shown is an example. Figure 4 As shown, the method may include the following steps:
[0084] 410. Obtain the burning configuration file and multiple first image files; the burning configuration file includes the configuration information corresponding to each first image file and the burning sequence consisting of multiple first image files; the multiple first image files include at least one or more target image files and a boot image file; the configuration information includes the burning address and the burning identifier.
[0085] 420. Parse the burning configuration file.
[0086] In this embodiment, after obtaining the programming configuration file, the programming device parses the configuration file to obtain the configuration information corresponding to each first image file in the programming file. Specifically, parsing the programming configuration file can involve converting its file format to a format readable by the programming device; splitting the configuration information corresponding to each first image file into multiple sub-configuration files, each including the configuration information corresponding to one first image file; or using one or more algorithms to parse and read data in a fixed format from the programming configuration file to obtain the configuration information corresponding to each first image file, etc. No specific limitations are imposed here.
[0087] 430. Read the configuration information in the parsed burning configuration file line by line, and determine the burning order of each first image file according to the order of the first image files corresponding to the read configuration information.
[0088] In this embodiment, after parsing the burning configuration file, the burning device reads the configuration information in the burning configuration file line by line in the recorded order, determines the read configuration information, and records the order in which the read configuration information is recorded. The burning device determines the burning order of the image files corresponding to the configuration information based on the order of the read configuration information. For example, the burning device reads the configuration information in the burning configuration file line by line, and the configuration information read in sequence is configuration information a, configuration information b, and configuration information c. Configuration information a corresponds to target image file a, configuration information b corresponds to boot image file, and configuration information c corresponds to target image file b. Therefore, based on the order of the read configuration information, the burning device determines the burning order of each first image file as target image file a, boot image file, and target image file b.
[0089] In this embodiment of the application, when the burning device reads the configuration information in the parsed burning configuration file, it can determine the first image file corresponding to each piece of configuration information read, such as the name of the image file.
[0090] 440. Construct a burning sequence based on the burning order corresponding to each first image file.
[0091] In this embodiment of the application, the burning device determines the burning order corresponding to each first image file as the burning sequence. For example, if the burning device determines the burning order of each first image file according to the order of the configuration information read, specifically as target image file a, boot image file, and target image file b, then the burning device determines the burning sequence as the order of target image file a, boot image file, and target image file b.
[0092] By using the above embodiments, the configuration information in the burning configuration file can be accurately read and the burning sequence can be determined according to the order of the first image files corresponding to the read configuration information. The burning sequence can be determined at the same time as reading the configuration information, which improves the efficiency of obtaining relevant information in the burning configuration file.
[0093] 450. Adjust the burning order of the boot image file to the specified position in the burning sequence to obtain the adjusted burning sequence; the specified position includes being arranged after some or all of the target image files.
[0094] 460. According to the adjusted burning sequence, each first image file is burned to the corresponding burning address in the memory in sequence, and the burning progress of each first image file is recorded using the burning identifier corresponding to each first image file.
[0095] In this embodiment, the programming device obtains the configuration information in the programming configuration file, including the programming address and the programming identifier; wherein, the programming address refers to the memory address or storage partition where the first image file is programmed into the memory; the programming identifier refers to the unique marking information corresponding to the first image file.
[0096] After constructing the programming sequence, the programming device adjusts the programming order of the boot image files, that is, it adjusts the programming order of the boot image files to the specified position in the programming sequence, resulting in an adjusted programming sequence. Then, the programming device programs each first image file to the corresponding programming address in the memory according to the adjusted programming sequence.
[0097] During the burning process of each first image file, the burning device binds the burning identifier corresponding to each first image file to the burning address corresponding to the first image file, and records the burning progress of the first image file. If the first image file has been completely burned to the corresponding burning address, the burning progress is recorded as "burning completed"; if another first image file is burned before the first image file is completely burned, the burning progress of the incomplete first image file is recorded as "burning incomplete", thus recording the burning progress of each acquired first image file.
[0098] Using the above embodiments, by setting a burning address in the configuration information, each first image file can be accurately burned to a suitable area in the memory; by setting a burning identifier in the configuration information, each first image file can be quickly identified, and the burning progress of each first image file can be recorded using the burning identifier, so that the cause of the abnormality can be quickly located after an abnormality occurs.
[0099] In some embodiments, the configuration information may also include the file size of each first image file.
[0100] Before the step of burning each of the first image files to the memory according to the adjusted burning sequence and the configuration information corresponding to each of the first image files, the burning device may also perform the following steps:
[0101] Based on the burning address corresponding to each first image file, determine the memory partition corresponding to each first image file;
[0102] Obtain the partition space size of each storage partition, and compare the size of the first image file with the partition space size of the corresponding storage partition;
[0103] If the size of any first image file is greater than the partition space size of the corresponding memory partition, a burning failure message is output; wherein, the burning failure message contains at least the burning identifier corresponding to the first image file.
[0104] In this embodiment, before burning each first image file, the burning device can first determine the partition of the memory to which each first image file should be burned, based on the burning address corresponding to each first image file. Then, the burning device obtains the partition size of each memory partition, such as the C drive size on a computer hard drive, and compares the size of the first image file with the partition size of the corresponding memory partition. If the file size of each first image file is less than or equal to the partition size of the corresponding memory partition, it is considered that the memory partition has sufficient data storage space for the burning device to burn the first image file to that memory partition. If the file size of any first image file is greater than the partition size of the corresponding memory partition, it is considered that the memory partition does not have sufficient data storage space for the burning device to burn the first image file to that memory partition. In this case, the burning device can generate and output a burning failure message to prompt the staff that the burning configuration of the first image file may be incorrect, so that the staff can quickly verify and correct the relevant configuration information.
[0105] By using the above embodiments, before burning the first image file, the file size of the first image file to be burned is compared with the partition space size of the memory partition to which it is to be burned, thereby quickly determining whether there will be insufficient space leading to burning failure, effectively avoiding the occurrence of invalid burning process.
[0106] In one embodiment, see Figure 5 , Figure 5 This is a schematic flowchart of another programming method disclosed in the embodiments of this application, which can be applied to... Figure 1 The programming device 10 shown is an example. Figure 5 As shown, the method may include the following steps:
[0107] 510. Obtain the burning configuration file and generate intermediate files based on the target program data; the target program data is the program data that needs to be burned into the memory; the intermediate file is a file directly generated based on the target program data; the burning configuration file includes the configuration information corresponding to each first image file and the burning sequence consisting of multiple first image files; the multiple first image files include at least one or more target image files and a boot image file.
[0108] 520. Adjust the file size of the intermediate file according to the storage space of the memory to obtain the first image file.
[0109] In this embodiment, the burning device acquires a burning configuration file and target program data, and then the burning device generates an intermediate file based on the target program data; wherein, the target program data is the program data to be burned into the memory; the intermediate file is a file directly generated based on the target program data; the burning configuration file includes configuration information corresponding to each first image file and a burning sequence composed of multiple first image files; the multiple first image files include at least one or more target image files and a boot image file.
[0110] After generating multiple intermediate files, the programming device obtains the storage space size of the memory and the file size of each generated intermediate file. If the storage space size of the memory is greater than or equal to the sum of the file sizes of the intermediate files, the programming device can directly identify each generated intermediate file as a first image file. If the storage space size of the memory is less than the sum of the file sizes of the intermediate files, the programming device can adjust the file size of one or more intermediate files to make the storage space size greater than or equal to the sum of the adjusted file sizes. Then, the programming device constructs each first image file based on the adjusted intermediate files and those that do not need adjustment. Specifically, the programming device can directly identify the adjusted intermediate files and those that do not need adjustment as the first image files. Adjusting the intermediate files can specifically involve compressing them or using one or more application commands in the system to adjust their file size; no specific limitations are specified here.
[0111] In this embodiment of the application, if the storage space of the memory is greater than or equal to the sum of the file sizes of the intermediate files, the burning device can also adjust the file size of one or more intermediate files to obtain each first image file.
[0112] By using the above embodiments, by adjusting the intermediate file directly generated based on the target program data so that its file size at least meets the storage space size of the memory, the burning failure caused by the excessive file size can be avoided. Adjusting the file size of the intermediate file can also improve the efficiency of the burning process.
[0113] 530. Adjust the burning order of the boot image file to the specified position in the burning sequence to obtain the adjusted burning sequence; the specified position includes being arranged after some or all of the target image files.
[0114] 540. According to the adjusted burning sequence, and based on the configuration information corresponding to each first image file, burn each first image file to the memory in sequence.
[0115] 550. If the operation of stopping the burning of the memory is detected, the electronic device corresponding to the memory is controlled to power on.
[0116] In this embodiment, after detecting a user's input to stop programming the memory, the programming device stops programming the memory and controls the corresponding electronic device to power on. The user can stop programming the memory by disconnecting the programming device from the memory; alternatively, the user can input a command to stop programming the memory.
[0117] The programming device can send instructions to the electronic device where the memory is located via wired or wireless communication. The electronic device then executes the boot image file according to the received instructions to perform the boot operation.
[0118] 560. If the electronic device successfully performs the power-on operation, then transfer the electronic device to the next workstation.
[0119] In this embodiment of the application, if the boot image file is completely burned, the electronic device containing the memory can successfully perform the boot operation by executing the boot image file. That is, the electronic device containing the memory can be normally powered on by executing the boot image file. At this time, the burning device can transfer the electronic device containing the memory to the next station through a conveyor belt or fixture for the next process.
[0120] 570. If the electronic device fails to power on, a programming error message is generated and output.
[0121] In this embodiment of the application, if the boot image file is not completely burned, the electronic device where the memory is located cannot perform the boot operation by executing the boot image file. That is, the electronic device where the memory is located cannot boot normally after executing the boot image file, or the electronic device fails to boot after executing the boot image file. At this time, the burning device can generate and output burning error information, which indicates that there is at least one first image file in the memory of the electronic device that has not been completely burned.
[0122] Using the above embodiment, after the programming device stops programming the memory, the programming device controls the electronic device where the memory is located to power on. The device determines whether each first image file has been programmed completely based on whether it can power on normally. If it cannot power on normally, at least one first image file has not been programmed completely (power-on image file); if it can power on normally, it is considered that each first image file has been programmed completely. This allows for a quick determination of the programming result of the memory, improving the efficiency of programming result determination.
[0123] In some embodiments, the programming device performs the process of transferring the electronic device to the next workstation if the electronic device successfully performs the power-on operation, specifically including the following steps:
[0124] If the electronic device successfully performs the power-on operation, it reads the multiple second image files burned into the memory and compares the read multiple second image files with multiple first image files;
[0125] If multiple second image files are identical to multiple first image files, the electronic device is transferred to the next workstation;
[0126] If any second image file is different from the first image file, a burning error message will be generated and output.
[0127] In this embodiment, after detecting a user's input to stop programming the memory, the programming device stops programming the memory and sends a command to the electronic device containing the memory via wired or wireless communication. The electronic device then executes a boot image file to perform a boot operation based on the received command. If the electronic device can successfully boot by executing the boot image file (i.e., the electronic device containing the memory can boot normally), the programming device can read multiple second image files programmed into the memory and compare them with corresponding first image files. The first image file refers to the image file to be programmed into the memory of the electronic device, and the second image files are image files already programmed into the memory of the electronic device. Therefore, each second image file in the memory is obtained by the programming device programming based on a corresponding first image file.
[0128] If each of the read second image files is the same as the corresponding first image file, the programming device will transfer the electronic device containing the memory to the next station for the next process.
[0129] If any of the read second image files is different from the corresponding first image file, it is considered that the second image file has not been completely burned. In this case, the burning device can generate and output burning error information.
[0130] Using the above embodiments, when the electronic device containing the memory can be powered on normally, each second image file burned into the memory is compared with the first image file used during burning. Based on the comparison results, it can be accurately determined whether each second image file in the memory has been burned completely, thus improving the accuracy of the burning result judgment.
[0131] Please see Figure 6 , Figure 6 This is a schematic diagram of a programming apparatus disclosed in an embodiment of this application. This programming apparatus can be applied to, for example... Figure 1 The burning device 10 is shown in the application scenario illustrated. For example... Figure 6 As shown, the burning device includes: a file acquisition module 610, a file adjustment module 620, and a file burning module 630.
[0132] The file acquisition module 610 is used to acquire the burning configuration file and multiple first image files; the burning configuration file includes the configuration information corresponding to each first image file and the burning sequence composed of multiple first image files; the multiple first image files include at least one or more target image files and a boot image file;
[0133] The file adjustment module 620 is used to adjust the burning order of the boot image file to a specified position in the burning sequence to obtain the adjusted burning sequence; the specified position includes being arranged after some or all of the target image files;
[0134] The file burning module 630 is used to burn each first image file into the memory in sequence according to the adjusted burning sequence and the configuration information corresponding to each first image file.
[0135] In some embodiments, the configuration information includes the burning address and the burning identifier.
[0136] The file burning module 630 is also used for:
[0137] According to the adjusted burning sequence, each first image file is burned to the corresponding burning address in the memory in sequence, and the burning progress of each first image file is recorded using the burning identifier corresponding to each first image file.
[0138] In some embodiments, the file acquisition module 610 is further configured to parse the burning configuration file before adjusting the burning order corresponding to the boot image file to a specified position in the burning sequence;
[0139] The configuration information in the parsed burning configuration file is read line by line, and the burning order of each first image file is determined according to the order of the first image files corresponding to the read configuration information.
[0140] A burning sequence is constructed based on the burning order corresponding to each first image file.
[0141] In some embodiments, the file acquisition module 610 is further configured to:
[0142] Intermediate files are generated based on the target program data; the target program data is the program data that needs to be burned into the memory; the intermediate files are files directly generated based on the target program data.
[0143] The file size of the intermediate file is adjusted according to the storage space of the memory to obtain the first image file.
[0144] In some embodiments, please refer to Figure 7 , Figure 7 This is a schematic diagram of another programming apparatus disclosed in the embodiments of this application. This programming apparatus can be applied to, for example... Figure 1 The burning device 10 is shown in the application scenario illustrated. For example... Figure 7 As shown, Figure 7 The programming device in Figure 6 The burning device shown also includes a file erasure module 640.
[0145] The file erasure module 640 is used to determine the historical boot image files and corresponding configuration information burned in the memory before burning each target image file and boot image file to the memory in sequence according to the adjusted burning sequence and the configuration information corresponding to each first image file.
[0146] Based on the configuration information corresponding to the historical boot image file, the historical boot image file in the storage is erased.
[0147] In some embodiments, the file adjustment module 620 is further configured to:
[0148] Adjust the burning order of the boot image file to the last position of the burning sequence to obtain the adjusted burning sequence;
[0149] The file erasure module 640 is also used to erase the last burned historical image file in the memory according to the configuration information corresponding to the last burned historical image file in the memory.
[0150] In some embodiments, please refer to Figure 8 , Figure 8 This is a schematic diagram of another programming device disclosed in the embodiments of this application. This programming device can be applied to, for example... Figure 1 The burning device 10 is shown in the application scenario illustrated. For example... Figure 8 As shown, Figure 8 The programming device in Figure 6 The programming device shown also includes a programming verification module 650.
[0151] The 650 programming and verification module is used for:
[0152] If the operation to stop burning the memory is detected, the corresponding electronic device of the memory is controlled to power on.
[0153] If the electronic device successfully powers on, it will be transferred to the next workstation.
[0154] If the electronic device fails to power on, a programming error message is generated and output.
[0155] In some embodiments, the programming verification module 650 is further configured to:
[0156] If the electronic device successfully performs the power-on operation, it reads the multiple second image files burned into the memory and compares the read multiple second image files with multiple first image files;
[0157] If multiple second image files are identical to multiple first image files, the electronic device is transferred to the next workstation;
[0158] If any second image file is different from the first image file, a burning error message will be generated and output.
[0159] Please see Figure 9 , Figure 9 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application.
[0160] like Figure 9 As shown, the electronic device 900 may include:
[0161] Memory 910 storing executable program code;
[0162] Processor 920 coupled to memory 910;
[0163] The processor 920 calls the executable program code stored in the memory 910 to execute any of the burning methods disclosed in the embodiments of this application.
[0164] It should be noted that, Figure 9 The electronic device shown may also include components not shown, such as a power supply, input buttons, camera, speaker, screen, RF circuit, Wi-Fi module, Bluetooth module, and sensors, which will not be described in detail in this embodiment.
[0165] This application discloses a computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute any of the burning methods disclosed in this application.
[0166] This application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute any of the burning methods disclosed in this application.
[0167] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Those skilled in the art should also recognize that the embodiments described in the specification are optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0168] In the various embodiments of this application, it should be understood that the sequence number of each process does not necessarily imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0169] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they can be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0170] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0171] If the aforementioned integrated units are implemented as software functional units and sold or used as independent products, they can be stored in a computer-accessible memory. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several requests to cause a computer device (which can be a personal computer, server, or network device, specifically a processor in the computer device) to execute some or all of the steps of the methods described in the various embodiments of this application.
[0172] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.
[0173] The foregoing has provided a detailed description of a programming method, apparatus, electronic device, and storage medium disclosed in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A programming method, characterized in that, The method includes: Obtain a burning configuration file and multiple first image files; the burning configuration file includes configuration information corresponding to each first image file and a burning sequence composed of the multiple first image files; the multiple first image files include at least one or more target image files and a boot image file; The burning order corresponding to the boot image file is adjusted to the last position of the burning sequence to obtain the adjusted burning sequence; According to the adjusted burning sequence, each of the first image files is burned into the memory in sequence based on the configuration information corresponding to each of the first image files; Before burning each target image file and boot image file to the memory according to the adjusted burning sequence and the configuration information corresponding to each of the first image files, the method further includes: Determine the historical boot image files and corresponding configuration information burned into the memory; Based on the configuration information corresponding to the last historical image file burned into the memory, the last historical image file burned into the memory is erased.
2. The method according to claim 1, characterized in that, The configuration information includes the burning address and the burning identifier; The step of burning each target image file and boot image file to the memory sequentially according to the adjusted burning sequence and the configuration information corresponding to each of the first image files includes: According to the adjusted burning sequence, each of the first image files is burned to the corresponding burning address in the memory in sequence, and the burning progress of each of the first image files is recorded using the burning identifier corresponding to each of the first image files.
3. The method according to claim 1, characterized in that, Before adjusting the burning order corresponding to the boot image file to the specified position in the burning sequence, the method further includes: The configuration file is parsed; The configuration information in the parsed burning configuration file is read line by line, and the burning order of each first image file is determined according to the order of the first image files corresponding to the read configuration information. The burning sequence is constructed according to the burning order corresponding to each of the first image files.
4. The method according to claim 1, characterized in that, The acquisition of multiple first image files includes: An intermediate file is generated based on the target program data; the target program data is the program data that needs to be burned into the memory; the intermediate file is a file directly generated based on the target program data. The file size of the intermediate file is adjusted according to the storage space of the memory to obtain the first image file.
5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: If the operation of stopping the burning of the memory is detected, the electronic device corresponding to the memory is controlled to power on. If the electronic device successfully performs the power-on operation, then the electronic device is transferred to the next workstation; If the electronic device fails to perform the power-on operation, a programming error message is generated and output.
6. The method according to claim 5, characterized in that, If the electronic device successfully performs the power-on operation, then the electronic device is transferred to the next workstation, including: If the electronic device successfully performs the power-on operation, it reads the multiple second image files burned into the memory and compares the read multiple second image files with the multiple first image files; If the plurality of second image files are identical to the plurality of first image files, then the electronic device is transferred to the next workstation; If any of the second image files is different from the first image file, a burning error message is generated and output.
7. A programming device, characterized in that, The device includes: The file acquisition module is used to acquire the burning configuration file and multiple first image files; the burning configuration file includes configuration information corresponding to each first image file and a burning sequence composed of the multiple first image files; the multiple first image files include at least one or more target image files and a boot image file; The file adjustment module is used to adjust the burning order corresponding to the boot image file to the last position of the burning sequence to obtain the adjusted burning sequence. The file burning module is used to burn each of the first image files into the memory in sequence according to the adjusted burning sequence and the configuration information corresponding to each of the first image files. The file erasure module is used to determine the historical boot image file and corresponding configuration information burned in the memory before burning each of the target image files and boot image files to the memory in sequence according to the adjusted burning sequence and the configuration information corresponding to each of the first image files. The file erasure module is also used to erase the last burned historical image file in the memory according to the configuration information corresponding to the last burned historical image file in the memory.
8. An electronic device, characterized in that, The system includes a memory and a processor, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Burning mirror image manufacturing method
CN111158697A
Extended system partitioning method and apparatus, storage medium, and computer device
WO2021143845A1