Program copying and burning method and device, computer equipment and storage medium
By using program copying and verification between the internal and external serial memories of the chip in PCBA processing, combined with the boot program and burning labels, the problems of frequent chip disassembly and low efficiency in the traditional burning process are solved, achieving high efficiency and automation. Program burning reduces costs and supports batch operations.
Patent Information
- Application Number
- CN202410972306.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-10-11
AI Technical Summary
The program burning process in traditional PCBA processing requires frequent chip disassembly, which results in high cost and time-consuming retroactive correction during production testing. In addition, online burning has the problem of low efficiency through wire connection.
Provides a method of program copying and burning. Through program copying and verification between internal and external serial memories of the chip, automatic burning is performed using the boot program and burning tags, limiting the number of copies to improve the success rate, and supporting batch burning. .
It simplifies the burning process, improves the success rate and efficiency of program burning, reduces costs, supports batch operations, and reduces the number of chip disassembly and re-burning.
Smart Images

Figure CN118760446A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of chip technology, and in particular to a program copying and burning method, device, computer equipment and storage medium. Background Art
[0002] PCBA (Printed Circuit Board Assembly) processing technology has become increasingly mature and widely used, playing a key role in various intelligent devices. In order for the circuit board to achieve the expected design function, in addition to the hardware in place, the matching support of software, that is, the program, is indispensable. The program is solidified into the IC (Integrated Circuit) by burning.
[0003] In traditional technology, PCBA processing program burning, that is, the process of moving the program into the internal storage space of the chip, is generally divided into offline burning and online burning. Offline burning generally refers to burning the incoming chip. Various sockets (test sockets) are compatible with chips of different packages. The chips and sockets can be used together to realize the burning of the program. The prices of sockets of different package types vary greatly. After the chip is burned, it is mounted on the applied PCBA board. Online burning generally refers to directly burning the program to the storage chip or SoC (System-on-a-Chip) chip on the PCBA board through the PC (Personal Computer) end. Online burning uses the standard communication bus of the chip, such as USB (Universal Serial Bus), SWD (Software Design), JTAG (Joint Test Action Group), UART (Universal Asynchronous Receiver / Transmitter), etc. The interface is generally fixed, and there are fewer pins to be connected during burning. Since online burning is performed by connecting the program through wires, if an error is found during production testing, the erroneous PCBA can be immediately traced back and re-burned without disassembling the chip.
[0004] However, in traditional technology, when errors occur in production testing, the chip needs to be removed from the product and re-burned according to the prescribed process during production backtracking and correction, which is time-consuming, labor-intensive and costly. Summary of the invention
[0005] Based on this, it is necessary to provide a program copying and burning method, device, computer equipment and computer-readable storage medium that can batch burn and speed up the production line copying rate to address the above technical problems.
[0006] In a first aspect, the present application provides a method for copying and burning a program. The method comprises:
[0007] When the chip is powered on, a program is read from a first serial memory stacked inside the chip according to a preset boot program in the chip to obtain a first reading result;
[0008] When the first reading result indicates that the preset program does not exist, reading the program from a second serial memory outside the chip to obtain a second reading result;
[0009] When the second reading result indicates that the preset program exists, copying the preset program in the second serial memory to the first serial memory, and verifying the program in the first serial memory after the copying is completed to obtain a copy verification result;
[0010] When the copy verification result is an unsuccessful copy procedure, the current copy count is recorded, and it is determined whether the current copy count exceeds a preset copy threshold;
[0011] When the current number of copies does not exceed the preset copy threshold, the preset program is copied to the first serial memory again until the current number of copies exceeds the preset copy threshold or the preset program is copied successfully.
[0012] In one embodiment, a program is read from a first serial memory stacked inside a chip according to a preset boot program in the chip to obtain a first reading result, including:
[0013] Read the program from the first serial memory according to the preset boot program to obtain the first program data and chip information of the chip;
[0014] Verify the first program data according to a preset burning label in the chip to obtain a first verification result;
[0015] When the first verification result is that the preset program exists, setting the first verification result as the first reading result;
[0016] When the first verification result is that the preset program does not exist, the first verification result and the chip information are set as the first reading result.
[0017] In one embodiment, performing a program read on the second serial memory according to a preset boot program to obtain a second read result includes:
[0018] Read the second serial memory according to the preset boot program to obtain second program data;
[0019] Verify the second program data according to a preset burning label in the chip to obtain a second verification result;
[0020] The first read result and the second verification result are set as the second read result.
[0021] In one embodiment, copying a preset program in the second serial memory to the first serial memory, and verifying the program in the first serial memory after the copy is completed to obtain a copy verification result, including:
[0022] After determining that the preset program exists in the second serial memory, copying the preset program to the first serial memory using the copy code in the second serial memory;
[0023] Acquiring a copy storage capacity of the copy program in the first serial memory;
[0024] The copy storage capacity is verified with the preset storage capacity of the preset program to obtain a copy verification result.
[0025] In one embodiment, when the current number of copies does not exceed the preset copy threshold, the preset program is copied to the first serial memory again until the current number of copies exceeds the preset copy threshold or the preset program is successfully copied, including:
[0026] After determining that the preset program is copied successfully, running the preset program in the first serial memory to the verification code address;
[0027] The check code of the check code address is updated according to the check code replacement instruction of the chip and the preset replacement check code, the updated first serial memory is obtained and the burning operation is ended.
[0028] In one embodiment, after performing program reading on the first serial memory according to the preset boot program in the chip and obtaining the first reading result, the method further includes:
[0029] When the first reading result indicates that the preset program exists, verifying the preset program in the first serial memory according to the preset verification code to obtain a third verification result;
[0030] When the third verification result is that the verification code successfully matches, the first serial memory is booted and started according to the preset boot program to obtain the preset program data and complete the running startup operation.
[0031] In a second aspect, the present application also provides a program copying and burning device. The device comprises:
[0032] A booting module, used for reading a program from a first serial memory encapsulated inside the chip according to a preset booting program in the chip when the chip is powered on, to obtain a first reading result;
[0033] The booting module is further used to read the program from the second serial memory outside the chip to obtain a second reading result when the first reading result indicates that the preset program does not exist;
[0034] a program copy module, for, when the second reading result indicates that the preset program exists, copying the preset program in the second serial memory to the first serial memory, and verifying the program in the first serial memory after the copy is completed, to obtain a copy verification result;
[0035] The copy analysis module is used to record the current number of copies when the copy verification result is an unsuccessful copy program, and determine whether the current number of copies exceeds a preset copy threshold;
[0036] The program copy module is used to re-copy the preset program to the first serial memory when the current copy times do not exceed the preset copy threshold value, until the current copy times exceed the preset copy threshold value or the preset program is successfully copied.
[0037] In one of the embodiments, the boot startup module is also used to read the program from the first serial memory according to a preset boot program to obtain first program data and chip information of the chip; verify the first program data according to a preset burning label in the chip to obtain a first verification result; when the first verification result is that the preset program exists, the first verification result is set as the first reading result; when the first verification result is that the preset program does not exist, the first verification result and the chip information are set as the first reading result.
[0038] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0039] When the chip is powered on, a program is read from a first serial memory stacked inside the chip according to a preset boot program in the chip to obtain a first reading result;
[0040] When the first reading result indicates that the preset program does not exist, reading the program from a second serial memory outside the chip to obtain a second reading result;
[0041] When the second reading result indicates that the preset program exists, copying the preset program in the second serial memory to the first serial memory, and verifying the program in the first serial memory after the copying is completed to obtain a copy verification result;
[0042] When the copy verification result is an unsuccessful copy procedure, the current copy count is recorded, and it is determined whether the current copy count exceeds a preset copy threshold;
[0043] When the current number of copies does not exceed the preset copy threshold, the preset program is copied to the first serial memory again until the current number of copies exceeds the preset copy threshold or the preset program is copied successfully.
[0044] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0045] When the chip is powered on, a program is read from a first serial memory stacked inside the chip according to a preset boot program in the chip to obtain a first reading result;
[0046] When the first reading result indicates that the preset program does not exist, reading the program from a second serial memory outside the chip to obtain a second reading result;
[0047] When the second reading result indicates that the preset program exists, copying the preset program in the second serial memory to the first serial memory, and verifying the program in the first serial memory after the copying is completed to obtain a copy verification result;
[0048] When the copy verification result is an unsuccessful copy procedure, the current copy count is recorded, and it is determined whether the current copy count exceeds a preset copy threshold;
[0049] When the current number of copies does not exceed the preset copy threshold, the preset program is copied to the first serial memory again until the current number of copies exceeds the preset copy threshold or the preset program is copied successfully.
[0050] The program copying and burning method, device, computer equipment and storage medium described above start the preset boot program in the chip to read the preset program from the first serial memory to start the chip after the chip is powered on; when the preset program cannot be read in the first serial memory, the preset program is read from the second serial memory; when the preset program cannot be read in the second serial memory, the chip information is recorded and an error is reported; when the preset program is successfully read in the second serial memory, the preset program in the second serial memory is copied to the first serial memory within the copying number threshold, and the check code in the second serial memory is updated, and the burning is completed; the first serial memory and the second serial memory are sequentially program-checked, and the preset program can be burned by copying it from the second serial memory, and the copying number is also limited, which can avoid accidental copying failures and can copy as much as possible, effectively improving the burning success rate, simplifying the burning process and allowing batch burning operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 A schematic diagram of a flow chart of a program copying and burning method in one embodiment;
[0052] Figure 2 A structural block diagram of a program copying and burning device in an embodiment;
[0053] Figure 3 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0055] In one embodiment, Figure 1 As shown, a program copying and burning method is provided. This embodiment uses the method applied to a terminal as an example. In this embodiment, the method includes the following steps:
[0056] Step 102 , when the chip is powered on, a program is read from a first serial memory stacked inside the chip according to a preset boot program in the chip to obtain a first reading result.
[0057] The first reading result includes that the preset program does not exist and that the preset program exists, the preset boot program uses a boot loader, and the first serial memory is an internally stacked SPI Flash (Serial Peripheral Interface Flash).
[0058] Specifically, program data is obtained from the first serial memory, ie, the internally stacked SPI Flash, through the SPI (Serial Peripheral Interface) interface of the first serial memory, and the obtained program data is checked to determine whether a preset program exists in the first serial memory.
[0059] Step 104 : when the first reading result indicates that the preset program does not exist, a program is read from a second serial memory outside the chip to obtain a second reading result.
[0060] The second serial memory is an external SPI Flash, and the second reading result includes that the preset program does not exist and that the preset program exists.
[0061] Specifically, when the preset program is not burned in the first serial memory (ie, the internally stacked SPI Flash), the preset boot program is run again to read the second serial memory through the SPI interface of the second serial memory to determine whether the preset program exists in the second serial memory, that is, the second reading result.
[0062] Step 106 , when the second reading result indicates that the preset program exists, the preset program in the second serial memory is copied to the first serial memory, and after the copying is completed, the program in the first serial memory is verified to obtain a copy verification result.
[0063] Specifically, after determining that the preset program exists in the second serial memory, the copy code in the second serial memory is called and executed to copy the preset program to the first serial memory. After copying, it is checked whether the preset program exists in the first serial memory, that is, whether the size of the program in the first serial memory after copying is consistent with the size of the preset program in the second serial memory.
[0064] Step 108, when the copy verification result is an unsuccessful copy procedure, the current copy times are recorded, and it is determined whether the current copy times exceeds a preset copy threshold.
[0065] Specifically, when it is determined that the size of the program in the first serial memory is inconsistent with the size of the preset program in the second serial memory, that is, the program is not copied successfully, the current copy number is updated and the updated current copy number is compared with the preset copy threshold to determine whether to continue the copy operation.
[0066] Step 110 , when the current number of copies does not exceed the preset copy threshold, the preset program is copied to the first serial memory again until the current number of copies exceeds the preset copy threshold or the preset program is copied successfully.
[0067] Specifically, after comparing the current number of copies with the preset copy threshold and determining that the current number of copies does not exceed the preset copy threshold, the operation of copying the preset program from the second serial memory to the first serial memory is repeated and verified.
[0068] If the verification fails, that is, the copy is unsuccessful, the cumulative number of copies is increased by one, that is, the current number of copies is recorded, and it is determined whether the current number of copies exceeds the copy number threshold. If it exceeds the copy number threshold, the copy is terminated, the chip information is recorded, and the burning failure is reported; otherwise, the next copy operation and verification operation are performed.
[0069] In this embodiment, after the chip is powered on, the preset boot program in the chip is started to read the preset program from the first serial memory to start the chip; when the preset program cannot be read in the first serial memory, the preset program is read from the second serial memory; when the preset program cannot be read in the second serial memory, the chip information is recorded and an error is reported; when the preset program is successfully read in the second serial memory, the preset program in the second serial memory is copied to the first serial memory within the copy number threshold, and the check code in the second serial memory is updated, and the burning is completed; the first serial memory and the second serial memory are program tested in turn, and the preset program can be burned by copying it from the second serial memory, and the number of copies is limited, which can avoid accidental copy failures and can copy as much as possible, effectively improving the success rate of burning, simplifying the burning process and performing batch burning operations.
[0070] In one embodiment, a program is read from a first serial memory stacked inside a chip according to a preset boot program in the chip to obtain a first reading result, including:
[0071] The program is read from the first serial memory according to the preset boot program to obtain the first program data and the chip information of the chip; the first program data is verified according to the preset burning label in the chip to obtain a first verification result; when the first verification result is that the program exists, the first verification result is set as the first reading result; when the first verification result is that the program does not exist, the first verification result and the chip information are set as the first reading result.
[0072] Among them, a preset burning label is set in the chip.
[0073] Specifically, the chip is connected to a power source, the preset boot program is run to boot, and the pre-burned preset program is read from the internally stacked SPI Flash. The preset burning label extracted from the preset program is used to verify the preset program to determine whether the preset program exists in the first serial memory.
[0074] In this embodiment, a preset program is read from the first serial memory to start the chip, that is, the internally stacked SPI Flash is verified. The verification can be automatically run without using a host computer program, thereby reducing the verification cost after burning.
[0075] In one embodiment, performing program reading on the second serial memory according to a preset boot program to obtain a second reading result includes:
[0076] The second serial memory is program-read according to the preset boot program to obtain second program data; the second program data is verified according to the preset burning label in the chip to obtain a second verification result; and the first reading result and the second verification result are set as the second reading result.
[0077] Specifically, after the preset boot program is run and the pre-burned preset program is not read from the internally stacked SPI Flash, the program is read from the second serial memory, i.e., the external SPI Flash, to obtain the second program data. The second program data obtained from the second serial memory is verified using the preset burning label to determine whether the preset program exists in the second serial memory.
[0078] When the second verification result is that the match is unsuccessful, the second reading result is that the preset program does not exist in the first serial memory and the second serial memory, and a burning failure is reported.
[0079] When the second verification result is a successful match, the operation of copying the preset program in the second serial memory to the first serial memory can be performed.
[0080] In this embodiment, when the preset program cannot be read in the first serial memory, the preset program is read from the second serial memory. The verification can be automatically run without using the host computer program, thereby reducing the verification cost after burning. The preset program is obtained from the second serial memory by powering on the chip, thereby realizing the burning of the first serial memory, reducing the burning cost and improving the burning efficiency.
[0081] In one embodiment, copying a preset program in the second serial memory to the first serial memory, and verifying the program in the first serial memory after the copy is completed to obtain a copy verification result, including:
[0082] After determining that the preset program exists in the second serial memory, the preset program is copied to the first serial memory using the copy code in the second serial memory; the copy storage capacity of the copied program in the first serial memory is obtained; the copy storage capacity is verified with the preset storage capacity of the preset program to obtain a copy verification result.
[0083] The second serial memory is provided with a copy code, and the copy storage capacity is the code amount of the preset program obtained by copying.
[0084] Specifically, after determining that the second serial memory, i.e., the external SPI Flash, is provided with a preset program, the copy code in the second serial memory is run to copy the preset program in the second serial memory to the first serial memory. After the copy is completed, the code amount of the preset program copied in the first serial memory, i.e., the copy storage capacity, is read, and the copy storage capacity is compared with the actual storage capacity of the preset program to determine whether the first serial memory is sufficient to copy and obtain the preset program.
[0085] In this embodiment, a preset program is read from the second serial memory, and then the program is copied to the first serial memory by copying the code, which effectively reduces the burning cost and improves the burning efficiency.
[0086] In one embodiment, when the current number of copies does not exceed the preset copy threshold, recopying the preset program to the first serial memory until the current number of copies exceeds the preset copy threshold or the preset program is successfully copied includes:
[0087] After confirming that the preset program is copied successfully, the preset program in the first serial memory is run to the check code address; the check code of the check code address is updated according to the check code replacement instruction of the chip and the preset replacement check code, the updated first serial memory is obtained and the burning operation is ended.
[0088] Among them, the chip is provided with a check code modification instruction and a preset replacement check code, and the check code address refers to the address before the check code.
[0089] Specifically, after the operation of copying the preset program to the first serial memory is completed within the preset copy threshold, the preset program obtained by copying is run according to the preset boot program until the address before the check code is run. At this time, the chip check code replacement instruction is executed to update the check code in the preset program to the preset replacement check code, such as changing it to 5A5A5A5A.
[0090] For example, when the code size is 64KB, the code in the second serial memory is moved byte by byte, and the starting address is 0X0000. When the 64KB code is moved, it runs to the address 0XFFFF. At this time, the instruction to modify the check code is executed, and the check code stored after the address 0XFFFF is modified to 5A5A5A5A. When checking whether the copy is completed, it is only necessary to verify whether the check code is 5A5A5A5A.
[0091] After completing the verification code replacement operation, the burning operation ends.
[0092] In this embodiment, after the program is copied to the first serial memory, the check code in the preset program is updated to facilitate the subsequent verification of the program in the chip.
[0093] In one embodiment, after performing program reading on the first serial memory according to the preset boot program in the chip and obtaining the first reading result, the method further includes:
[0094] When the first reading result is that a preset program exists, the preset program in the first serial memory is verified according to the preset verification code to obtain a third verification result; when the third verification result is that the verification code successfully matches, the first serial memory is booted and started according to the preset boot program to obtain the preset program data and complete the running startup operation.
[0095] Specifically, after determining that the preset program exists in the first serial memory, a preset verification code is used to verify whether the chip is successfully burned. If the verification is passed, the operation is terminated and a prompt is given that the program has been burned.
[0096] In this embodiment, by updating the verification code after the burning is completed, it is convenient to check the burning status in batches later, thereby improving the burning efficiency.
[0097] In one embodiment, a program copying and burning method is provided, the method comprising the following steps:
[0098] The first serial memory is program-read according to the preset boot program to obtain the first program data and chip information of the chip.
[0099] The first program data is verified according to a preset burning label in the chip to obtain a first verification result.
[0100] When the first verification result indicates that the preset program exists, the first verification result is set as the first reading result.
[0101] When the first verification result is that the preset program does not exist, the first verification result and the chip information are set as the first reading result.
[0102] When the first reading result indicates that the preset program exists, the preset program in the first serial memory is verified according to the preset verification code to obtain a third verification result.
[0103] When the third verification result is that the verification code successfully matches, the first serial memory is booted and started according to the preset boot program to obtain the preset program data and complete the running and starting operation.
[0104] The second serial memory is program-read according to the preset boot program to obtain second program data.
[0105] The second program data is verified according to a preset burning label in the chip to obtain a second verification result.
[0106] The first read result and the second verification result are set as the second read result.
[0107] After determining that the preset program exists in the second serial memory, the preset program is copied to the first serial memory using the copy code in the second serial memory.
[0108] The copy storage capacity of the copy program in the first serial memory is obtained.
[0109] The copy storage capacity is verified with the preset storage capacity of the preset program to obtain a copy verification result.
[0110] When the copy verification result is an unsuccessful copy procedure, the current copy number is recorded, and it is determined whether the current copy number exceeds a preset copy threshold.
[0111] When the current number of copies does not exceed the preset copy threshold, the preset program is copied to the first serial memory again until the current number of copies exceeds the preset copy threshold or the preset program is copied successfully.
[0112] After it is determined that the copying of the preset program is successful, the preset program in the first serial memory is run to the verification code address.
[0113] The check code of the check code address is updated according to the check code replacement instruction of the chip and the preset replacement check code, the updated first serial memory is obtained and the burning operation is ended.
[0114] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0115] Based on the same inventive concept, the embodiment of the present application also provides a program copy burning device for implementing the program copy burning method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more program copy burning device embodiments provided below can refer to the limitations of the program copy burning method above, and will not be repeated here.
[0116] In one embodiment, Figure 2As shown, a program copying and burning device is provided, including: a booting module 202, a program copying module 204 and a copying analysis module 206, wherein:
[0117] 202 is a booting module, which is used to read a program from a first serial memory encapsulated inside the chip according to a preset booting program in the chip when the chip is powered on, to obtain a first reading result.
[0118] The booting module 202 is further configured to read the program from a second serial memory outside the chip to obtain a second reading result when the first reading result indicates that the preset program does not exist.
[0119] 204 is a program copy module, which is used to copy the preset program in the second serial memory to the first serial memory when the second reading result is that the preset program exists, and to verify the program in the first serial memory after the copy is completed to obtain a copy verification result.
[0120] 206 A copy analysis module is used to record the current number of copies when the copy verification result is an unsuccessful copy program, and determine whether the current number of copies exceeds a preset copy threshold.
[0121] 204 is a program copy module, which is used to re-copy the preset program to the first serial memory when the current number of copies does not exceed the preset copy threshold, until the current number of copies exceeds the preset copy threshold or the preset program is successfully copied.
[0122] In one embodiment, the boot startup module 202 is also used to read the program from the first serial memory according to a preset boot program to obtain first program data and chip information of the chip; verify the first program data according to a preset burning label in the chip to obtain a first verification result; when the first verification result is that the program exists, the first verification result is set as the first reading result; when the first verification result is that the program does not exist, the first verification result and the chip information are set as the first reading result.
[0123] In one embodiment, the boot startup module 202 is also used to read the program from the second serial memory according to a preset boot program to obtain second program data; verify the second program data according to a preset burning label in the chip to obtain a second verification result; and set the first reading result and the second verification result as the second reading result.
[0124] In one embodiment, the program copy module 204 is also used to copy the preset program to the first serial memory using the copy code in the second serial memory after determining that the preset program exists in the second serial memory; obtain the copy storage capacity of the copied program in the first serial memory; and verify the copy storage capacity with the preset storage capacity of the preset program to obtain a copy verification result.
[0125] In one embodiment, the program copying and burning device also includes a verification update module, which is used to run the preset program in the first serial memory to the verification code address after determining that the preset program is copied successfully; update the verification code of the verification code address according to the verification code replacement instruction of the chip and the preset replacement verification code, obtain the updated first serial memory and end the burning operation.
[0126] In one embodiment, the verification update module is also used to verify the preset program in the first serial memory according to the preset verification code to obtain a third verification result when the first reading result is that the preset program exists; when the third verification result is that the verification code successfully matches, the first serial memory is booted and started according to the preset boot program to obtain the preset program data and complete the run startup operation.
[0127] Each module in the program copying and burning device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0128] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store preset program data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a program copying and burning method is implemented.
[0129] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0130] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0131] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0132] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0133] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0134] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0135] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A program copying and burning method, characterized in that: The method comprises: When the chip is powered on, a program is read from a first serial memory encapsulated inside the chip according to a preset boot program in the chip to obtain a first reading result; When the first reading result indicates that the preset program does not exist, reading the program from the second serial memory outside the chip to obtain a second reading result; When the second reading result indicates that the preset program exists, copying the preset program in the second serial memory to the first serial memory, and verifying the program in the first serial memory after the copying is completed to obtain a copy verification result; When the copy verification result is an unsuccessful copy procedure, the current number of copies is recorded, and it is determined whether the current number of copies exceeds a preset copy threshold; When the current number of copies does not exceed the preset copy threshold, the preset program is copied to the first serial memory again until the current number of copies exceeds the preset copy threshold or the preset program is successfully copied.
2. The method according to claim 1, characterized in that The chip is provided with a preset burning label; and a first serial memory encapsulated in the chip is program-read according to a preset boot program in the chip to obtain a first reading result, including: Reading a program from the first serial memory according to the preset boot program to obtain first program data and chip information of the chip; Verifying the first program data according to a preset burning label in the chip to obtain a first verification result; When the first verification result is that the preset program exists, setting the first verification result as the first reading result; When the first verification result is that the preset program does not exist, the first verification result and the chip information are set as the first reading result.
3. The method according to claim 1, characterized in that The step of performing program reading on the second serial memory according to the preset boot program to obtain a second reading result includes: Read the second serial memory according to the preset boot program to obtain second program data; Verifying the second program data according to a preset burning label in the chip to obtain a second verification result; The first reading result and the second verification result are set as the second reading result.
4. The method according to claim 1, characterized in that: The second serial memory is provided with a copy code; the copying of the preset program in the second serial memory to the first serial memory, and the verification of the program in the first serial memory after the copying is completed to obtain a copy verification result, including: After determining that a preset program exists in the second serial memory, copying the preset program to the first serial memory using the copy code in the second serial memory; Acquire the copy storage capacity of the copy program in the first serial memory; The copy storage capacity is verified with the preset storage capacity of the preset program to obtain a copy verification result.
5. The method according to claim 1, characterized in that The chip is provided with a check code modification instruction and a preset replacement check code; when the current number of copies does not exceed the preset copy threshold, the preset program is copied to the first serial memory again until the current number of copies exceeds the preset copy threshold or the preset program is successfully copied, including: After determining that the preset program is copied successfully, running the preset program in the first serial memory to the verification code address; The check code of the check code address is updated according to the check code replacement instruction of the chip and the preset replacement check code, an updated first serial memory is obtained and the burning operation is ended.
6. The method according to claim 1, characterized in that After reading the program from the first serial memory according to the preset boot program in the chip and obtaining the first reading result, the method further includes: When the first reading result indicates that a preset program exists, verifying the preset program in the first serial memory according to the preset verification code to obtain a third verification result; When the third verification result is that the verification code successfully matches, the first serial memory is booted and started according to the preset boot program to obtain preset program data and complete the running startup operation.
7. A program copying and burning device, characterized in that: The device comprises: A booting module, used for reading a program from a first serial memory encapsulated inside the chip according to a preset booting program in the chip when the chip is powered on, to obtain a first reading result; The boot module is further configured to read a program from a second serial memory outside the chip to obtain a second reading result when the first reading result indicates that the preset program does not exist; a program copy module, configured to copy the preset program in the second serial memory to the first serial memory when the second reading result indicates that the preset program exists, and verify the program in the first serial memory after the copy is completed to obtain a copy verification result; A copy analysis module, used for recording the current number of copies when the copy verification result is an unsuccessful copy procedure, and determining whether the current number of copies exceeds a preset copy threshold; The program copy module is used to re-copy the preset program to the first serial memory when the current number of copies does not exceed the preset copy threshold, until the current number of copies exceeds the preset copy threshold or the preset program is successfully copied.
8. The device according to claim 7, characterized in that The device comprises: The boot startup module is also used to read the program from the first serial memory according to the preset boot program to obtain first program data and chip information of the chip; verify the first program data according to a preset burning label in the chip to obtain a first verification result; when the first verification result is that the preset program exists, the first verification result is set as the first reading result; when the first verification result is that the preset program does not exist, the first verification result and the chip information are set as the first reading result.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
