File burning method, device, equipment and storage medium
Patent Information
- Application Number
- CN202311832495.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-12-27
AI Technical Summary
[0004]本申请实施例提供了一种文件烧录方法、装置、设备以及存储介质,解决了相关技术中上位机直接将生成的烧录文件发送至开发板,存在非法烧录或误烧录的安全风险的问题,实现了通过对烧录指令进行权限验证,确定符合当前权限等级的烧录文件,排除在权限范围外的烧录文件,防止烧录文件的随意调用,提高烧录的安全等级,同时将烧录文件分割为多个数据帧,在方便数据传输的同时,有利于开发板进行逐帧校验,确保数据的安全性以及准确性,减少非法烧录或误烧录的安全风险
[0018]本申请实施例中,通过在接收到烧录指令的情况下,对烧录指令进行权限校验,得到符合烧录指令对应的权限等级的烧录文件;将烧录文件分割为多个原始数据帧,对每个原始数据帧进行补全处理,得到多个目标数据帧;将多个目标数据帧发送至与上位机通信连接的开发板,以使开发板在每个目标数据帧校验成功的情况下存储多个目标数据帧。实现了通过对烧录指令进行权限验证,确定符合当前权限等级的烧录文件,排除在权限范围外的烧录文件,防止烧录文件的随意调用,提高烧录的安全等级,同时将烧录文件分割为多个数据帧,在方便数据传输的同时,有利于开发板进行逐帧校验,确保数据的安全性以及准确性,减少非法烧录或误烧录的安全风险。
Smart Images

Figure CN117632166B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a file burning method, apparatus, device, and storage medium. Background Technology
[0002] In the IC design process, compiled verification code needs to be programmed into the IC memory to verify whether the IC functional design meets the requirements. Developers write and compile the verification code into a programming file on a host computer. The host computer then sends the programming file to the development board via a communication connection. The development board stores the programming file, thus completing the programming process.
[0003] However, in related technologies, any user can send a burning command to the host computer. When the host computer receives the burning command, it directly sends the generated burning file to the development board, which is then directly received by the development board. This poses a security risk of illegal or erroneous burning. Summary of the Invention
[0004] This application provides a file burning method, apparatus, device, and storage medium, which solves the security risk of illegal or erroneous burning when the host computer directly sends the generated burning file to the development board. It achieves this by verifying the permissions of the burning command, identifying burning files that meet the current permission level, and excluding burning files outside the permission scope, thus preventing arbitrary access to burning files and improving the security level of burning. Simultaneously, the burning file is divided into multiple data frames, which facilitates data transmission and allows the development board to perform frame-by-frame verification, ensuring data security and accuracy and reducing the security risk of illegal or erroneous burning.
[0005] In a first aspect, embodiments of this application provide a file burning method, the method comprising:
[0006] Upon receiving a burning instruction, the permissions of the burning instruction are verified to obtain a burning file that conforms to the permission level corresponding to the burning instruction;
[0007] The burning file is divided into multiple raw data frames, and each raw data frame is completed to obtain multiple target data frames.
[0008] The plurality of target data frames are sent to the development board that is connected to the host computer, so that the development board stores the plurality of target data frames if each target data frame is successfully verified.
[0009] Secondly, embodiments of this application also provide a file burning apparatus, including:
[0010] The file determination module is configured to perform permission verification on the burning instruction upon receiving the burning instruction, and obtain a burning file that conforms to the permission level corresponding to the burning instruction;
[0011] The burning file segmentation module is configured to segment the burning file into multiple raw data frames, and perform completion processing on each raw data frame to obtain multiple target data frames.
[0012] The target data sending module is configured to send the plurality of target data frames to a development board that is connected to a host computer, so that the development board stores the plurality of target data frames when each target data frame is successfully verified.
[0013] Thirdly, embodiments of this application also provide a file burning device, the device comprising:
[0014] One or more processors;
[0015] Storage device, configured to store one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the file burning method described in the embodiments of this application.
[0017] Fourthly, embodiments of this application also provide a non-volatile storage medium for storing computer-executable instructions, which, when executed by a computer processor, are configured to perform the file burning method described in embodiments of this application.
[0018] In this embodiment, upon receiving a programming instruction, permission verification is performed on the instruction to obtain a programming file that conforms to the permission level corresponding to the instruction. The programming file is then divided into multiple raw data frames, and each raw data frame is completed to obtain multiple target data frames. These multiple target data frames are sent to a development board connected to a host computer, allowing the development board to store multiple target data frames upon successful verification of each target data frame. This achieves permission verification of programming instructions to determine programming files that conform to the current permission level, excluding programming files outside the permission scope, preventing unauthorized access to programming files, and improving the security level of programming. Furthermore, dividing the programming file into multiple data frames facilitates data transmission and allows the development board to perform frame-by-frame verification, ensuring data security and accuracy, and reducing the security risks of unauthorized or erroneous programming. Attached Figure Description
[0019] Figure 1 A flowchart illustrating a file burning method provided in this application embodiment;
[0020] Figure 2A flowchart of a file burning method, including the process of obtaining the corresponding burning file through permission verification, is provided for an embodiment of this application.
[0021] Figure 3 A flowchart illustrating another file burning method provided in this application embodiment, which includes the process of obtaining the corresponding burning file through permission verification;
[0022] Figure 4 A flowchart illustrating a file burning method, including the process of writing a corresponding burning file through permission verification, is provided in this application embodiment.
[0023] Figure 5 A flowchart illustrating another file burning method provided in this application embodiment, which includes the process of writing the corresponding burning file through permission verification;
[0024] Figure 6 A flowchart of a file burning method including a data retransmission process is provided for embodiments of this application;
[0025] Figure 7 A structural block diagram of a file burning device provided in an embodiment of this application;
[0026] Figure 8 This is a schematic diagram of a file burning device provided in an embodiment of this application. Detailed Implementation
[0027] The embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of this application and are not intended to limit the scope of the embodiments. Furthermore, it should be noted that, for ease of description, only the parts relevant to the embodiments of this application are shown in the accompanying drawings, not the entire structure.
[0028] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0029] The file burning method provided in this application can be used for IC module and system verification in the IC design process. The host computer can generate a burning file based on the compiled verification code and burn it into the IC memory via a communication connection to verify whether the IC functional design meets the requirements. For example, after the overall or partial module design of the IC is completed, the IC firmware can be downloaded to an FPGA development board. The FPGA development board can then be used as an IC development board. Engineers can write and compile the verification code into a burning file using a host computer and burn it into the IC memory via the established communication connection, thereby verifying whether various modules of the IC have defects. Of course, the aforementioned application scenarios are merely exemplary and illustrative. In practical applications, this file burning method can also be used in other file burning scenarios, and this application does not limit this. This application aims to provide a file burning method that solves the security risk of illegal or erroneous burning when the host computer directly sends the generated burning file to the development board.
[0030] The file burning method provided in this application embodiment can be executed by a host computer, which can be a computer device. The computer device refers to any electronic device with data computing, processing and storage capabilities, such as mobile phones, PCs (Personal Computers), tablet computers and other terminal devices, or servers and other devices. This application embodiment does not limit this.
[0031] Figure 1 This is a flowchart illustrating a file burning method provided in an embodiment of this application. This file burning method can be implemented using a file burning device as the executing entity. Figure 1 As shown, the specific steps for burning this file include the following:
[0032] Step S101: Upon receiving a burning instruction, perform permission verification on the burning instruction to obtain a burning file that meets the permission level corresponding to the burning instruction.
[0033] The burning command can be a command input by the user to the host computer to start the burning process. Since the host computer can provide different burning permissions to administrators with different identities, it can determine the user identity corresponding to the burning command by performing permission verification on the burning command, and then run the burning task with the permission level matching the user identity. This permission verification can involve identifying key information in the burning command to match the user identity corresponding to the current burning command, thereby determining the corresponding permission level. This key information can be a built-in check bit in the burning command, a user identifier code, etc., which are not limited in this application. For example, the burning command has a check bit set. This check bit can be used to distinguish the user identity performing the burning operation. For example, when the check bit is 001, the user identity can be the first administrator of the host computer, and the first administrator's first permission level can burn any file; when the check bit is 002, the user identity can be the second administrator of the host computer, and the second administrator can be one of the administrators with a lower level than the first administrator, whose second permission level can have corresponding restrictions on the type, size, number of times, and time of the burning file. After determining the permission level corresponding to the burning command through permission verification, the burning file corresponding to that permission level is obtained according to the instructions of the burning command. The burning file can be temporarily stored in the host computer's memory or stored in external storage media; this application does not impose any limitations on this. If the burning file is temporarily stored in the host computer's memory, the host computer can read the burning file corresponding to that permission level from memory. If the burning file is stored in external storage media, the host computer can read the burning file corresponding to that permission level from external storage media. Furthermore, different permission management methods can be set for multiple permission levels. For example, multiple permission level modes can be preset in the host computer. Based on the permission verification result of the burning command, the target permission level mode is determined, and the system switches to that target permission level mode to read the burning files allowed under that target permission level mode. For example, the burning association information of the burning instructions can be encrypted in advance using an encryption key. Based on the permission verification result of the burning instructions, the decryption key corresponding to the current permission level can be read, and the decryption key can be used to decrypt the files corresponding to the burning instructions that can be successfully decrypted. Thus, burning files that do not match the permission level will not be read, and only burning files that match the permission level of the burning instructions will proceed with the burning process.
[0034] Step S102: Divide the burning file into multiple raw data frames, and perform completion processing on each raw data frame to obtain multiple target data frames.
[0035] Different communication protocols are set for different types of communication connections between the host computer and the development board. The host computer can process the burning file according to the communication protocol corresponding to the current communication connection to obtain burning data that conforms to the transmission format. For example, according to the size of the transmission data frame specified by the communication protocol, the burning file can be divided into original data frames of a preset size, and each original data frame can be padded. This padded processing can be data padded processing that matches the communication protocol corresponding to the current communication connection. For example, adding supplementary data such as frame header, frame sequence number, frame length, check bit, and frame trailer to each original data frame. Of course, the specific content and format of the supplementary data can be adapted according to different communication protocols, which is not limited in this application. By setting frame headers and frame trailers, frame delimitation can be performed, which makes it easier for the development board to identify the start and end of each data frame. This is beneficial for the development board to correctly parse the data frame, ensure data integrity, and facilitate synchronous data transmission, ensuring that the development board can accurately locate and extract each data frame. Setting frame sequence numbers allows the development board to detect lost and duplicate data frames and take appropriate measures, such as requesting retransmission or discarding duplicate frames, to ensure data transmission accuracy. Setting checksums allows the development board to determine if received data frames are corrupted; for example, by adding a Cyclic Redundancy Check (CRC) code, retransmission or error correction can be requested if possible. Setting frame length indicates the length of the data frame, which helps the development board correctly extract and parse data frames in communication environments with different frame lengths. Furthermore, information such as frame sequence numbers and frame lengths can be used to implement flow control, ensuring balanced data transmission between the host computer and the development board, facilitating congestion control, and preventing network overload.
[0036] Step S103: Send multiple target data frames to the development board that is connected to the host computer, so that the development board stores multiple target data frames if each target data frame is successfully verified.
[0037] In this process, the host computer sends multiple target data frames obtained from the burning file to the development board. The development board verifies the received target data frames and stores them, completing the burning process. The communication connection between the host computer and the development board can be a wired connection via a communication interface, such as a serial communication connection or an Ethernet connection, or a wireless connection, such as a mobile network connection or a Wi-Fi network connection; this application does not limit the specific connection. After receiving multiple target data frames, the development board can verify each target data frame. If verification fails, it can send a retransmission command to the host computer. Optionally, if the number of retransmission commands reaches a set number, it can directly report an error. If verification is successful, the received target data frames can be written into the memory, and the program execution pointer can then be set to point to the verification code and executed.
[0038] Optionally, the communication connection between the host computer and the development board can be based on a preset communication protocol. The process of the host computer sending the target data frame to the development board may include:
[0039] Multiple target data frames are sent to a development board connected to a host computer based on a preset communication protocol. This preset communication protocol includes handshake commands, parameter setting commands, file size commands, file sending commands, IC information commands, and retransmission commands. Different preset communication commands can correspond to different data transmission functions and can be adapted to the needs of developers; this application does not impose any limitations on this.
[0040] The above describes a process where, upon receiving a programming command, permissions are verified to obtain a programming file matching the corresponding permission level. This file is then divided into multiple raw data frames, and each raw data frame is padded to obtain multiple target data frames. These target data frames are sent to a development board connected to a host computer, allowing the development board to store multiple target data frames upon successful verification of each target data frame. This approach verifies permissions on programming commands, identifies programming files matching the current permission level, excludes files outside the permitted scope, prevents unauthorized access to programming files, and improves programming security. Furthermore, dividing the programming file into multiple data frames facilitates data transmission and allows the development board to perform frame-by-frame verification, ensuring data security and accuracy and reducing the risk of unauthorized or incorrect programming.
[0041] Figure 2 A flowchart of a file burning method provided in this application embodiment, including a process of obtaining a corresponding burning file through permission verification, wherein the burning instruction includes a first check bit and multiple first encryption command codes, such as... Figure 2 As shown, the specific steps for burning this file include the following:
[0042] Step S201: Upon receiving a burning instruction, determine the current permission level based on the first check bit of the burning instruction.
[0043] The burning command may include a first checksum and multiple first encryption command codes. The first checksum can be used to determine the permission level corresponding to the user issuing the burning command. Different user identities correspond to different permission levels. For example, when the checksum is 001, the user is the first administrator of the host computer, corresponding to the highest first permission level; when the checksum is 002, the user is the second administrator of the host computer, corresponding to a second permission level with limited permissions, and so on. Different permission levels can limit the burning of files within different permission ranges, such as restrictions on the type, size, number of times, and time of the burned file. Of course, the burning command may also include a header, encryption command codes, a checksum, and a footer. Adaptive adjustments to other components of the burning command are not limited in this application.
[0044] Step S202: Decrypt multiple first encrypted command codes based on the current decryption key corresponding to the current permission level to obtain the first target command code. The number of first target command codes is less than or equal to the number of first encrypted command codes.
[0045] Different encryption keys are used for the first encrypted command codes at different permission levels, and the burning instructions may include multiple first encrypted command codes at different permission levels. After determining the current permission level through the first check bit, the current decryption key pre-stored in the host computer can be read according to the current permission level. This current decryption key can be used to decrypt the first encrypted command codes that match the current permission level to obtain the first target command code. Since the permission level corresponding to the first encrypted command code may include both the current permission level and other permission levels, and the current decryption key cannot decrypt the first encrypted command codes of other permission levels, the number of first target command codes obtained is less than or equal to the number of the first encrypted command codes. For example, the permission levels of the host computer include the first permission level of the first administrator and the second permission level of the second administrator. The second permission level is lower than the first permission level. The first permission level corresponds to the first decryption key, which can decrypt all first encrypted command codes, so the first administrator can burn any file. The second permission level corresponds to the second decryption key, which can decrypt some of the first encrypted command codes, so the second administrator can only burn some files. Optionally, the first and second encryption / decryption keys can be of the same type or different types. The key types can include AES (Advanced Encryption Standard) and DES (Data Encryption Standard), etc. For successfully decrypted encrypted command codes, the burning file can continue to be read and burned. For encrypted command codes that cannot be decrypted, the corresponding burning process cannot be initiated. Optionally, the host computer can cache undecryptable encrypted command codes in ciphertext form and request the administrator to send the corresponding decryption key to continue the burning process. If the ciphertext encrypted command code still cannot be decrypted within a preset number of attempts or a preset time period, it will be deleted from the cache.
[0046] Step S203: Read the burning file corresponding to each first target command code.
[0047] The first target command code can be an encoding used to instruct different operations on the host computer. For example, 00002 can be used to indicate a burning operation. Further data bits can be added to this encoding to indicate the location of the burning file being read. For example, 000021 can indicate both a burning instruction and the retrieval of the burning file located in storage area 1 of the host computer. This storage area can be partitioned according to sectors, blocks, pages, or segments, with bytes (B) or kilobytes (KB) as the basic storage unit. Of course, the numerical setting method and correspondence of this first target command code can be adaptively adjusted according to the developer's needs, and this application does not impose any limitations on it.
[0048] Step S204: Divide the burning file into multiple raw data frames, and perform completion processing on each raw data frame to obtain multiple target data frames.
[0049] Step S205: Send multiple target data frames to the development board that is connected to the host computer, so that the development board stores multiple target data frames if each target data frame is successfully verified.
[0050] The above-mentioned encryption and decryption keys for the current permission level are determined by the first check bit. If the encryption command is successfully decrypted, the corresponding file can be burned. This effectively manages the burning permissions, improves the security level of permission management, and sets different encryption and decryption keys for different permission levels to prevent administrators with different permission levels from burning illegally or mistakenly, thus ensuring the security of burning.
[0051] Figure 3 The flowchart of another file burning method provided in this application embodiment includes the process of obtaining the corresponding burning file through permission verification. The host computer stores burning files of different file levels, and the file level classification is based on the frequency of use, update version, size, and format of the burning file, such as... Figure 3 As shown, the specific steps for burning this file include the following:
[0052] Step S301: Upon receiving a burning instruction, determine the current permission level based on the first check bit of the burning instruction.
[0053] Step S302: Decrypt multiple first encrypted command codes based on the current decryption key corresponding to the current permission level to obtain the first target command code. The number of first target command codes is less than or equal to the number of first encrypted command codes.
[0054] Step S303: If the file level of the burning file corresponding to the first target command code matches the current permission level, read the corresponding burning file.
[0055] The burning files can be classified into different file levels based on their usage frequency, update version, size, and format. For example, the burning files include burning file 1, burning file 2, and burning file 3. Burning file 1 has a usage frequency of 50 times, an update version of V2.21, a size of 556 bytes, and a bin file format; burning file 2 has a usage frequency of 214 times, an update version of V4.11, a size of 1024 bytes, and a hex file format; burning file 3 has a usage frequency of 1142 times, an update version of V1.22, a size of 242 bytes, and a bin file format. Optionally, if the usage frequency is the primary limiting factor, burning file 3 can be set as the first file level, burning file 2 as the second file level, and burning file 3 as the third file level; if the latest update version is the primary limiting factor, burning file 2 can be set as the first file level, burning file 1 as the second file level, and burning file 3 as the third file level. Of course, there are other ways to classify file levels, which are not limited in this application. For different permission levels, the allowed file levels for burning files can be set. For example, with the current permission level being the first permission level, it means the first administrator can burn files at file levels one, two, and three. With the current permission level being the second permission level, it means the second administrator can only burn files at file levels two and three. Of course, the composition of file levels corresponding to different permission levels can be adaptively adjusted according to the needs of different application scenarios, which are not limited in this application.
[0056] Step S304: Divide the burning file into multiple raw data frames, and perform completion processing on each raw data frame to obtain multiple target data frames.
[0057] Step S305: Send multiple target data frames to the development board that is connected to the host computer, so that the development board stores multiple target data frames if each target data frame is successfully verified.
[0058] As described above, by classifying the files to be burned into different file levels and establishing a relationship between the files to be burned and the permission levels, the granularity of burning permission management is effectively refined, which is more conducive to ensuring the security of the files to be burned and customizing a reasonable permission range for the files to be burned.
[0059] Figure 4 A flowchart illustrating a file burning method, including the process of writing the corresponding burning file through permission verification, is provided for an embodiment of this application. Figure 4 As shown, the specific steps for burning this file include the following:
[0060] Step S401: Upon receiving a write command and a file to be burned, perform permission verification on the write command and store the file that meets the permission level corresponding to the write command.
[0061] The write command can be a user-input command to the host computer for writing a file. Since the host computer can provide different write permissions to administrators with different identities, it can verify the write command's permissions to determine the user's identity and then select a file with the corresponding permission level from the received files to be stored. This permission verification can involve identifying key information in the write command to match the user's identity and determine the corresponding permission level. This key information can be a built-in checksum in the write command, a user identifier, etc., which are not limited in this application. For example, the write command may have a checksum. This checksum can be used to distinguish the user's identity performing the write operation. For instance, if the checksum is 001, the user may be the first administrator of the host computer, and the first administrator's first permission level allows writing any file. If the checksum is 002, the user may be the second administrator of the host computer, and the second administrator may be one of the administrators with a lower level than the first administrator, whose second permission level may have restrictions on the type, size, number of times, and time of the file to be written. After determining the permission level corresponding to the write command through permission verification, the programmable file corresponding to that permission level is obtained according to the instructions of the write command. Furthermore, different permission management methods can be set for multiple permission levels. For example, multiple permission level modes can be preset in the host computer. Based on the permission verification result of the write command, the target permission level mode is determined, and the programmable file allowed by the target permission level mode is switched to. Alternatively, the write association information of the write command can be encrypted in advance using an encryption key. Based on the permission verification result of the write command, the decryption key corresponding to the current permission level is read, and the decryption key is used to read the programmable file corresponding to the successfully decrypted write command. Therefore, programmable files that do not match the permission level will not be written; only programmable files that match the permission level of the write command will be stored in the host computer.
[0062] Step S402: Upon receiving a burning instruction, perform permission verification on the burning instruction to obtain a burning file that meets the permission level corresponding to the burning instruction.
[0063] Step S403: Divide the burning file into multiple raw data frames, and perform completion processing on each raw data frame to obtain multiple target data frames;
[0064] Step S404: Send multiple target data frames to the development board that is connected to the host computer, so that the development board stores multiple target data frames if each target data frame is successfully verified.
[0065] As described above, by adding permission verification for write commands, the storage management of files to be burned can be restricted, reducing the input of illegal files, lowering the risk of erroneous input of files, alleviating the cache pressure on the host computer, and providing reliable protection for the subsequent file burning process.
[0066] Figure 5 A flowchart illustrating another file burning method provided in this application embodiment, including the process of writing a corresponding burning file through permission verification, wherein the writing instruction includes a second check bit and multiple second encryption command codes, such as... Figure 5 As shown, the specific steps for burning this file include the following:
[0067] Step S501: Upon receiving the write command and the burning file to be stored, determine the current permission level based on the second check bit of the write command.
[0068] The write command may include a second checksum and multiple second encryption command codes. The second checksum can be used to determine the permission level corresponding to the user issuing the write command. Different user identities correspond to different permission levels. For example, when the checksum is 001, the user is the first administrator of the host computer, corresponding to the highest permission level; when the checksum is 002, the user is the second administrator of the host computer, corresponding to a more restricted permission level, and so on. Different permission levels can limit file writing to different permission ranges, such as restrictions on the type, size, number of writes, and time of the file being burned. Of course, the write command may also include a header, encryption command codes, a checksum, and a trailer. Adaptive adjustments to other components of the write command are not limited in this application.
[0069] Step S502: Decrypt multiple second encrypted command codes based on the current decryption key corresponding to the current permission level to obtain second target command codes. The number of second target command codes is less than or equal to the number of second encrypted command codes.
[0070] In this system, different encryption keys are used for the second encrypted command codes at different permission levels, and the write command may include multiple second encrypted command codes at different permission levels. After determining the current permission level through the second check bit, the current decryption key pre-stored in the host computer can be read according to the current permission level. This current decryption key can be used to decrypt the second encrypted command codes that match the current permission level to obtain the second target command code. Since the permission level corresponding to the second encrypted command code may include both the current permission level and other permission levels, and the current decryption key cannot decrypt the second encrypted command codes at other permission levels, the number of obtained second target command codes is less than or equal to the number of the second encrypted command codes. For example, the host computer's permission levels include the first permission level of the first administrator and the second permission level of the second administrator. The second permission level is lower than the first permission level. The first permission level corresponds to the first decryption key, which can decrypt all first encrypted command codes, so the first administrator can perform arbitrary writing of the burning file. The second permission level corresponds to the second decryption key, which can decrypt some of the second encrypted command codes, so the second administrator can only perform writing of some burning files. Optionally, the first encryption / decryption key and the second encryption / decryption key can be keys of the same type or keys of different types. The key type can be AES (Advanced Encryption Standard) or DES (Data Encryption Standard). For encrypted command codes that have been decrypted, the writing of the file can continue. For encrypted command codes that cannot be decrypted, the corresponding writing process cannot be started, and the host computer will not write the corresponding file.
[0071] Step S503: Store the burning file corresponding to each second target command code.
[0072] The second target command code can be an encoding used to instruct different operations on the host computer. For example, 00001 can indicate a burning operation. Further data bits can be added to this encoding to indicate the location of the burning file being read. For example, 000012 can indicate both a burning instruction and the retrieval of the burning file located in the second storage area of the host computer. This storage area can be partitioned according to sectors, blocks, pages, or segments, with bytes (B) or kilobytes (KB) as the basic storage unit. Of course, the numerical setting method and correspondence of this second target command code can be adaptively adjusted according to the developer's needs, and this application does not impose any limitations on it.
[0073] Step S504: Upon receiving a burning instruction, perform permission verification on the burning instruction to obtain a burning file that meets the permission level corresponding to the burning instruction.
[0074] Step S505: Divide the burning file into multiple raw data frames, and perform completion processing on each raw data frame to obtain multiple target data frames.
[0075] Step S506: Send multiple target data frames to the development board that is connected to the host computer, so that the development board stores multiple target data frames if each target data frame is successfully verified.
[0076] The above-mentioned encryption and decryption keys for the current permission level are determined by the second check bit. Only when the encryption command encoding is successfully decrypted can the corresponding burning file be written. This effectively manages write permissions, improves the security level of permission management, and sets different encryption and decryption keys for different permission levels to prevent administrators of different permission levels from making illegal or erroneous writes, thus ensuring the security of writing burning files.
[0077] Figure 6 A flowchart of a file burning method including a data retransmission process is provided for an embodiment of this application, as shown below. Figure 6 As shown, the specific steps for burning this file include the following:
[0078] Step S601: Upon receiving a burning instruction, perform permission verification on the burning instruction to obtain a burning file that meets the permission level corresponding to the burning instruction.
[0079] Step S602: Divide the burning file into multiple raw data frames, and perform completion processing on each raw data frame to obtain multiple target data frames.
[0080] Step S603: Send multiple target data frames to the development board that is connected to the host computer, so that the development board stores multiple target data frames if each target data frame is successfully verified.
[0081] Step S604: Upon receiving a retransmission command from the development board, retransmit multiple target data frames to the development board.
[0082] Because data transmission may be affected by fluctuations in communication conditions, leading to instability and issues such as data frame loss or errors, the development board needs to send a retransmission command for the target data frame to the host computer if the target data frame verification fails, to ensure the smooth progress of the programming process. Therefore, when the host computer receives the retransmission command from the development board, it needs to resend the target data frame to the development board.
[0083] Step S605: When the cumulative number of retransmission commands received reaches a preset number, stop sending multiple target data frames to the development board and output error information.
[0084] In some cases, due to poor communication conditions or abnormal status of the host computer, problems such as repeated data frame loss or errors may occur. Continuing to resend the target data frame will not solve the problem and will affect the file burning efficiency. Therefore, the host computer can stop sending the target data frame and output an error message when the cumulative number of received resend commands reaches a preset number. This error message can be used to remind on-site developers or back-end administrators to troubleshoot the anomaly, reconfirm the communication connection status between the host computer and the development board, and the file burning processing status of the host computer.
[0085] As mentioned above, by setting up a retransmission mechanism, abnormal issues such as data frame loss or data frame errors can be effectively addressed, ensuring the smooth progress of the burning process. By setting up an alarm mechanism, continuous abnormal situations can be effectively identified, the number of retransmissions can be controlled within a reasonable range, avoiding prolonged invalid retransmissions, and timely reminding developers to investigate and handle the abnormalities.
[0086] Figure 7 This is a structural block diagram of a file burning device provided in an embodiment of this application. The device is configured to execute the file burning method provided in the above embodiment, and possesses the corresponding functional modules and beneficial effects for executing the method. For example... Figure 7 As shown, the device specifically includes:
[0087] The file determination module 101 is configured to perform permission verification on the burning instruction upon receiving the burning instruction, and obtain a burning file that meets the permission level corresponding to the burning instruction.
[0088] The burning file segmentation module 102 is configured to segment the burning file into multiple raw data frames, perform completion processing on each raw data frame, and obtain multiple target data frames.
[0089] The target data sending module 103 is configured to send multiple target data frames to a development board that is connected to a host computer, so that the development board stores multiple target data frames if each target data frame is successfully verified.
[0090] The above describes a process where, upon receiving a programming command, permissions are verified to obtain a programming file matching the corresponding permission level. This file is then divided into multiple raw data frames, and each raw data frame is padded to obtain multiple target data frames. These target data frames are sent to a development board connected to a host computer, allowing the development board to store multiple target data frames upon successful verification of each target data frame. This approach verifies permissions on programming commands, identifies programming files matching the current permission level, excludes files outside the permitted scope, prevents unauthorized access to programming files, and improves programming security. Furthermore, dividing the programming file into multiple data frames facilitates data transmission and allows the development board to perform frame-by-frame verification, ensuring data security and accuracy and reducing the risk of unauthorized or incorrect programming.
[0091] In one possible embodiment, the programming instructions include a first check bit and multiple first encryption command codes; the programming file determination module 101 is further configured to:
[0092] The current access level is determined based on the first checksum of the burning command;
[0093] Based on the current decryption key corresponding to the current permission level, multiple first encrypted command codes are decrypted to obtain the first target command code, and the number of first target command codes is less than or equal to the number of first encrypted command codes.
[0094] Read the burning file corresponding to each first target command code.
[0095] In one possible embodiment, the host computer stores burning files of different file levels, and the file level classification is based on the frequency of use, update version, size, and format of the burning files; the burning file determination module 101 is further configured to:
[0096] If the file level of the burning file corresponding to the first target command encoding matches the current permission level, then read the corresponding burning file.
[0097] In one possible embodiment, a file writing module is also included, configured as follows:
[0098] Upon receiving a write command and the file to be burned, the write command is validated for permissions, and the file that meets the permission level corresponding to the write command is stored.
[0099] In one possible embodiment, the write instruction includes a second check bit and multiple second encryption command codes; the file write module is further configured to:
[0100] The current permission level is determined based on the second check bit of the write command;
[0101] Based on the current decryption key corresponding to the current permission level, multiple second encrypted command codes are decrypted to obtain the second target command code. The number of second target command codes is less than or equal to the number of second encrypted command codes.
[0102] Store the burning file corresponding to each second target command code.
[0103] In one possible embodiment, a data retransmission module is also included, configured as follows:
[0104] Upon receiving a retransmission command from the development board, retransmit multiple target data frames to the development board.
[0105] If the number of retransmission commands received reaches a preset number, stop sending multiple target data frames to the development board and output an error message.
[0106] In one possible embodiment, the target data sending module 103 is further configured to:
[0107] Multiple target data frames are sent to the development board that communicates with the host computer based on a preset communication protocol. The preset communication protocol includes handshake instructions, parameter setting instructions, file size instructions, file sending instructions, IC information instructions, and retransmission instructions.
[0108] Figure 8 This is a schematic diagram of a file burning device provided in an embodiment of this application, as shown below. Figure 8 As shown, the device includes a processor 201, a memory 202, an input device 203, and an output device 204; the number of processors 201 in the device can be one or more. Figure 8 Taking a processor 201 as an example; the processor 201, memory 202, input device 203, and output device 204 in the device can be connected via a bus or other means. Figure 8 Taking a bus connection as an example, the memory 202, as a computer-readable storage medium, can be configured to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the file burning method in this embodiment. The processor 201 executes various functional applications and data processing of the device by running the software programs, instructions, and modules stored in the memory 202, thereby implementing the above-described file burning method. The input device 203 can be configured to receive input digital or character information and generate key signal inputs related to user settings and function control of the device. The output device 204 may include a display device such as a screen.
[0109] The file burning device provided above can be used to execute the file burning method provided in any of the above embodiments, and has the corresponding functions and beneficial effects.
[0110] This application also provides a non-volatile storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are configured to perform a file burning method described in the above embodiments. The method includes: upon receiving a burning instruction, performing permission verification on the burning instruction to obtain a burning file that conforms to the permission level corresponding to the burning instruction; dividing the burning file into multiple raw data frames, performing completion processing on each raw data frame to obtain multiple target data frames; and sending the multiple target data frames to a development board that is communicatively connected to a host computer, so that the development board stores the multiple target data frames when each target data frame is successfully verified.
[0111] Storage medium – any type of memory device or storage device. The term “storage medium” is intended to include: mounting media, such as CD-ROM, floppy disk, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. Storage medium may also include other types of memory or combinations thereof. Furthermore, storage medium may reside in a first computer system in which the program is executed, or it may reside in a different second computer system connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term “storage medium” can include two or more storage media residing in different locations (e.g., in different computer systems connected via a network). Storage medium may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.
[0112] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the file burning method described above, but can also perform related operations in the file burning method provided in any embodiment of this application.
[0113] It is worth noting that in the above-described embodiments of the file burning device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not configured to limit the protection scope of the embodiments of this application.
[0114] It should be noted that the numbering of each step in this solution is only used to describe the overall design framework of this solution and does not indicate a necessary sequential relationship between the steps. As long as the overall implementation process conforms to the overall design framework of this solution, it falls within the protection scope of this solution. The order of the words in the description is not an exclusive limitation on the specific implementation process of this solution. Those skilled in the art should understand that the embodiments of this application can be provided as methods, systems, or computer program products. In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory. Memory may include non-persistent memory in computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0115] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0116] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A file burning method, applied to a host computer, characterized in that, include: Upon receiving a burning instruction, the permissions of the burning instruction are verified to obtain a burning file that conforms to the permission level corresponding to the burning instruction; The burning file is divided into multiple raw data frames, and each raw data frame is completed to obtain multiple target data frames. The plurality of target data frames are sent to the development board that is connected to the host computer, so that the development board stores the plurality of target data frames if each target data frame is successfully verified. The programming instruction includes a first check bit and multiple first encryption command codes; The step of verifying the permissions of the burning command to obtain a burning file that conforms to the permission level corresponding to the burning command includes: The current permission level is determined based on the first check bit of the burning command. The first check bit is used to determine the permission level corresponding to the user identity that issued the burning command. The first target command code is obtained by decrypting the multiple first encrypted command codes based on the current decryption key corresponding to the current permission level. The number of the first target command codes is less than or equal to the number of the first encrypted command codes. The host computer stores burning files of different file levels. If the file level of the burning file corresponding to the first target command code matches the current permission level, the corresponding burning file is read.
2. The file burning method according to claim 1, characterized in that, Also includes: Upon receiving a write command and a file to be burned, the write command is validated for permissions, and the file that meets the permission level corresponding to the write command is stored.
3. The file burning method according to claim 2, characterized in that, The write instruction includes a second check bit and multiple second encryption command codes; The step of verifying the permissions of the write command and storing the burning file that meets the permission level corresponding to the write command includes: The current permission level is determined based on the second check bit of the write instruction; Based on the current decryption key corresponding to the current permission level, the plurality of second encrypted command codes are decrypted to obtain a second target command code, wherein the number of the second target command codes is less than or equal to the number of the second encrypted command codes; Store the burning file corresponding to each of the second target command codes.
4. The file burning method according to claim 1, characterized in that, After sending the plurality of target data frames to the development board that is communicatively connected to the host computer, the method further includes: Upon receiving a retransmission command from the development board, the plurality of target data frames are retransmitted to the development board. If the cumulative number of retransmission commands received reaches a preset number, the sending of the multiple target data frames to the development board will stop, and an error message will be output.
5. The file burning method according to claim 1, characterized in that, Sending the plurality of target data frames to the development board that is communicatively connected to the host computer includes: The multiple target data frames are sent to the development board that is connected to the host computer based on a preset communication protocol, wherein the preset communication protocol includes handshake instructions, parameter setting instructions, file size instructions, file sending instructions, IC information instructions, and retransmission instructions.
6. A file burning device, characterized in that, include: The file determination module is configured to perform permission verification on the burning instruction upon receiving the burning instruction, and obtain a burning file that conforms to the permission level corresponding to the burning instruction; The burning file segmentation module is configured to segment the burning file into multiple raw data frames, and perform completion processing on each raw data frame to obtain multiple target data frames. The target data sending module is configured to send the plurality of target data frames to a development board that is connected to a host computer, so that the development board stores the plurality of target data frames when each target data frame is successfully verified. The burning instruction includes a first check bit and multiple first encryption command codes, and the burning file determination module is further configured to: The current permission level is determined based on the first check bit of the burning command. The first check bit is used to determine the permission level corresponding to the user identity that issued the burning command. Based on the current decryption key corresponding to the current permission level, multiple first encrypted command codes are decrypted to obtain a first target command code. The number of first target command codes is less than or equal to the number of first encrypted command codes. The host computer stores burning files of different file levels. If the file level of the burning file corresponding to the first target command code matches the current permission level, the corresponding burning file is read.
7. A file burning device, the device comprising: One or more processors; A storage device configured to store one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the file burning method according to any one of claims 1-5.
8. A non-volatile storage medium for storing computer-executable instructions, wherein the computer-executable instructions, when executed by a computer processor, are configured to perform the file burning method according to any one of claims 1-5.
Citation Information
Patent Citations
Burnt file protection method, burnt file burning method and device, storage medium and equipment
CN110489959A
Equipment burning authentication method and system
CN116522314A