A method, system and computer-readable storage medium for embedded software programming

Through the collaboration of upper and lower computers to generate and encrypt the writing of files, and combining small carriers and software identification comparison, automated software updates of embedded products are realized, solving the problem of time-consuming, labor-intensive and leaking of embedded products, and improving efficiency and security.

CN114968303BActive Publication Date: 2025-07-08SHENZHEN HPMONT TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210590778.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-27
Publication Date
2025-07-08
Estimated Expiration
2042-05-27

AI Technical Summary

Technical Problem

The software update of existing embedded products is time-consuming and laborious and has the risk of software leakage. Especially in non-networked embedded products, writing software requires on-site operation by technicians, which is costly and inefficient.

Method used

The upper computer generates the hex file, and the lower computer processes and encrypts it into an encrypted bin file, which is stored in the intermediate carrier of the small burn file. The target device directly connects the carrier to perform software updates, and automatically burns it through software identification comparison and decryption processing.

Benefits of technology

Simplify the software update process, improve efficiency, avoid the risk of software leakage, and reduce the dependence on specialized technicians.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114968303B_ABST
    Figure CN114968303B_ABST
Patent Text Reader

Abstract

This application relates to the field of computer technology, and provides a method, system, device and computer-readable storage medium for embedded software flashing. The method includes: obtaining a first software identifier of a product to be flashed stored in the target device, and obtaining a second software identifier corresponding to the flashing file from an intermediate carrier of the flashing file; if the first software identifier is different from the second software identifier, obtaining the flashing file from the intermediate carrier of the flashing file; performing decryption processing on the flashing file to obtain a target bin file; circularly reading the target bin file and writing the target bin file into a preset code area. The above method can simplify the flashing process and improve efficiency when the embedded product needs to update software by directly inserting or connecting the intermediate carrier of the flashing file; since the flashing file is encrypted, the flashing file can also be protected from leakage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and particularly to a method, system, device, and computer-readable storage medium for burning embedded software. Background Art

[0002] In the field of embedded applications, burning software is a common and essential technical means. The existing software burning technology requires technicians to use a computer with a burning function and an emulator for the chip of the product to be burned to implement software burning. When a non-networked embedded product that is already in operation needs to update software, technicians need to carry the above-mentioned devices to burn the new software, which is costly and inefficient. There is also a problem of software leakage during this process. Summary of the Invention

[0003] Embodiments of this application provide a method, system, device, and computer-readable storage medium for burning embedded software, which are used to solve the problems of time-consuming and laborious software update of non-networked embedded products and the problem of software leakage during software burning.

[0004] In a first aspect, an embodiment of this application provides a method for burning embedded software, which is applied to a target device and includes:

[0005] Obtain a first software identifier of the product to be burned stored in the target device, and obtain a second software identifier corresponding to the burning file from an intermediate carrier of the burning file;

[0006] If the first software identifier is different from the second software identifier, obtain the burning file from the intermediate carrier of the burning file;

[0007] Perform decryption processing on the burning file to obtain a target bin file;

[0008] Read the target bin file cyclically and write the target bin file into a preset code area.

[0009] Further, the burning file is an encrypted bin file obtained by a lower computer processing a hex file to obtain an initial bin file and encrypting the initial bin file.

[0010] By encrypting the initial bin file to obtain an encrypted bin file, it is possible to effectively prevent the bin file from being leaked during transmission or storage, thus causing losses.

[0011] Further, the initial bin file is composed of data frames; the encrypted bin file is obtained by the lower computer encrypting each data frame according to a key table corresponding to the data frame and interference data.

[0012] Further, the hex file is sent from the host computer to the slave computer.

[0013] Further, the target bin file includes encrypted frames. The process of decrypting the write file to obtain the target bin file includes:

[0014] Obtain the key corresponding to the encrypted frame, and locate the position of the interference data in the encrypted frame according to the key;

[0015] Delete the interference data according to the position of the interference data to obtain the target bin file.

[0016] The encrypted bin file cannot be directly run and needs to be decrypted according to the decryption rules before it can run normally, which ensures that the write file will not be leaked during the transmission process.

[0017] Further, the intermediate carrier of the write file includes: a memory device or an external chip.

[0018] In a second aspect, an embodiment of the present application provides a system for embedded software writing, including:

[0019] A host computer, a slave computer, an intermediate carrier of the write file, and a target device;

[0020] The host computer is used to generate a hex file corresponding to the software to be written and send the hex file to the slave computer;

[0021] The slave computer is used to receive the hex file sent by the host computer; process the hex file to obtain an initial bin file, and encrypt the initial bin file to obtain an encrypted bin file; send the encrypted bin file to the intermediate carrier of the write file;

[0022] The intermediate carrier of the write file is used to store the encrypted bin file;

[0023] The target device is used to obtain the first software identifier of the product to be written stored in the target device, and obtain the second software identifier corresponding to the write file from the intermediate carrier of the write file; if the first software identifier is different from the second software identifier, obtain the write file from the intermediate carrier of the write file; decrypt the write file to obtain a target bin file; circularly read the target bin file and write the target bin file into a preset code area.

[0024] Further, the initial bin file consists of data frames. The process of encrypting the initial bin file to obtain an encrypted bin file includes:

[0025] Obtain the key corresponding to each frame of the data frame from a preset key table; the key is composed of any one digit from 0 to 9;

[0026] Perform offset processing on the data frame according to the key, and insert preset interference data into the offset data frame to obtain the encrypted bin file.

[0027] In a third aspect, an embodiment of the present application provides a target device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method described in the first aspect is implemented.

[0028] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, including a computer program stored in the computer-readable storage medium. When the computer program is executed by a processor, the method described in the first aspect is implemented.

[0029] The beneficial effects of the embodiments of the present application compared with the prior art are as follows:

[0030] In the present application, the upper computer transmits the programming file to the lower computer, and then the lower computer encrypts the programming file and transmits it to the programming file intermediate carrier. The programming file intermediate carrier has the characteristics of small volume and convenient transportation. When the embedded product needs to update the software, directly insert or connect the programming file intermediate carrier to complete the update, without the participation of other devices and professional technicians. The programming method is simple and the efficiency is improved; in addition, since the lower computer encrypts the programming file, the problem of software leakage during the programming process is solved, and the programming file is protected from leakage. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained according to these drawings.

[0032] Figure 1 It is a schematic diagram of a system for embedded software programming provided by the first embodiment of the present application;

[0033] Figure 2 It is a schematic flow chart of a method for embedded software programming provided by the second embodiment of the present application;

[0034] Figure 3 It is a schematic diagram of a device of a target device for embedded software programming provided by the third embodiment of the present application;

[0035] Figure 4 It is a schematic structural diagram of a target device for embedded software flashing provided by this application. Specific embodiments

[0036] In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of this application. However, those skilled in the art should clearly understand that this application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of this application.

[0037] It should be understood that when used in the specification and appended claims of this application, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.

[0038] It should also be understood that the term "and / or" used in the specification and appended claims of this application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0039] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when", "once", "in response to determining", or "in response to detecting" depending on the context. Similarly, the phrase "if determined" or "if detected [the described condition or event]" can be interpreted as meaning "once determined", "in response to determining", "once detected [the described condition or event]", or "in response to detecting [the described condition or event]" depending on the context.

[0040] In addition, in the description of the specification and appended claims of this application, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.

[0041] References to "one embodiment" or "some embodiments" or the like described in the specification of this application mean that a specific feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of this application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but rather mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "comprising", "including", "having" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0042] The following further elaborates on this application in conjunction with the accompanying drawings and specific embodiments.

[0043] Please refer to Figure 1 , Figure 1 which is a schematic diagram of an embedded software flashing system provided by the first embodiment of this application. In this embodiment, an embedded software flashing system includes: a host computer, a slave computer, an intermediate carrier for the flashing file, and a target device.

[0044] The host computer is used to generate a hex file corresponding to the software to be flashed and send the hex file to the slave computer;

[0045] The host computer is a device that directly issues manipulation commands and can be a device such as a computer, a tablet, a laptop computer, etc. A communication protocol is established between the host computer and the slave computer, and the host computer sends the hex file to the slave computer.

[0046] The hex file is a commonly used flashing file format. Usually, it is in units of lines, and the content of the hex file is regularly encoded and can be parsed by us. In one implementation, in the hex file, ":" is used as the start symbol, which is used to determine the start of a line of data. The ":" in the hex file is read cyclically, and the hex file is transformed into a line-by-line form.

[0047] For example, this is a line in the hex file: :10000000F02C0020B15101081152010815520108CD, then the data of this line can be parsed as follows:

[0048] The 1st byte: 10, indicating that this line has 0x10, that is, 16 data bits.

[0049] The 2nd / 3rd bytes: 0000, indicating that the starting address bit of this line is 0x0000.

[0050] The 4th byte: 00, and the flag bit 00 indicates that this line records data, and there are other flag bits.

[0051] Bytes 5 - 20: Data bits, storing data information.

[0052] Byte 21: CD, check bit, and the check method is 0x100 - (the sum of previous values % 256).

[0053] We can determine the data bit length by reading the first byte. After reading the 4th byte, continue to read the data bit length and then the check bit, and calculate whether the data of a row read at one time is incorrect using this check method. After it is correct, the host computer can send the data of this row to the slave computer. Repeating the above steps can send the hex file to the slave computer completely.

[0054] The slave computer is used to receive the hex file sent by the host computer; process the hex file to obtain the initial bin file, and encrypt the initial bin file to obtain the encrypted bin file; send the encrypted bin file to the intermediate carrier for the programming file.

[0055] In one implementation, the slave computer has multiple interfaces and can be connected to multiple intermediate carriers for the programming file for data transmission. Among them, the initial bin file can be composed of data frames, and the encrypted bin file is obtained after encrypting the initial bin file. Specifically, the slave computer obtains the key corresponding to each data frame from a preset key table, where the key is composed of any one digit from 0 to 9; performs offset processing on the data frame according to the key, and inserts preset interference data into the offset data frame to obtain the encrypted bin file.

[0056] The intermediate carrier for the programming file is used to store the encrypted bin file.

[0057] The programming file carrier can be a memory device or an external chip, which generally has the characteristics of small volume and convenient carrying, and can be directly inserted or connected to the target device, and the software programming can be completed without other manual operations.

[0058] The target device is used to obtain the first software identifier of the product to be programmed stored in the target device, and obtain the second software identifier corresponding to the programming file from the intermediate carrier for the programming file; if the first software identifier is different from the second software identifier, obtain the programming file from the intermediate carrier for the programming file; decrypt the programming file to obtain the target bin file; read the target bin file in a loop and write the target bin file to the preset code area.

[0059] The target device can be devices such as mobile phones, tablet computers, wearable devices, laptop computers, ultra-mobile personal computers (UMPCs), personal digital assistants (PDAs), etc. The embodiments of this application do not impose any restrictions on the specific types of target devices.

[0060] The first software identifier of the product to be burned is pre-stored in the target device. When the target device needs to be updated, a burning file intermediate carrier equipped with a new burning file can be directly inserted or connected. The burning file stores the version identification information of the new software, that is, the second software identifier. If it is detected that the second software identifier is different from the first software identifier, the burning starts, thereby completing the update of the software in the target device.

[0061] The above content describes the functions of the components of the embedded software burning system. In one implementation, the working process of the entire embedded system can be summarized as:

[0062] First, determine the software to be burned, generate the corresponding hex file of the software to be burned through the host computer, then establish a communication connection between the host computer and the slave computer, send the hex file from the host computer to the slave computer. After the slave computer receives the hex file, process the hex file to obtain the initial bin file, and then encrypt the initial bin file to obtain the encrypted bin file. The slave computer transfers the encrypted bin file to the burning file intermediate carrier, and the burning file receives and stores the encrypted bin file. When the target device needs to be updated, connect the burning file intermediate carrier to the target device, and the target device determines whether an update is required. If an update is required, decrypt the encrypted bin file and burn it into the target device. If an update is not required, terminate the current burning process.

[0063] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of an embedded software burning method provided by the second embodiment of this application. In this embodiment, the execution subject of an embedded software burning method is the target device. As Figure 1 shown, the embedded software burning method may include:

[0064] S101: Obtain the first software identifier of the product to be burned stored in the target device, and obtain the second software identifier corresponding to the burning file from the burning file intermediate carrier.

[0065] The target device pre-stores the first software identifier of the product to be burned. The target device obtains the first software identifier of the product to be burned. Among them, the product to be burned can be the software pre-installed when the target device leaves the factory, or the software that the user installs by himself during the use of the target device. The first software identifier can be the unique version identification information of the product to be burned.

[0066] In this embodiment, when executing the embedded software burning method, the user needs to establish a connection between the target device and the intermediate carrier of the burning file. Specifically, the intermediate carrier of the burning file is a memory device, which can be a memory device or an external chip, and the user can connect the intermediate carrier of the burning file to the target device.

[0067] The burning file is stored in the intermediate carrier of the burning file. The burning file writes the second software identifier corresponding to the burning file. Among them, the second software identifier can be the unique software version identification information of the burning file, and the second software identifier can be a character variable. In one implementation, the second software identifier is stored within 10 bytes starting from the starting address in the intermediate carrier of the burning file. When the intermediate carrier of the burning file is connected to the target device, the target device reads the second software identifier to determine whether an update is required.

[0068] In one implementation, the burning file is an encrypted bin file obtained by the lower computer processing the hex file to obtain an initial bin file and encrypting the initial bin file. That is to say, after the lower computer obtains the encrypted bin file, it can send the encrypted bin file to be stored in the intermediate carrier of the burning file.

[0069] In one implementation, the initial bin file consists of data frames; the encrypted bin file is obtained by the lower computer encrypting the data frames according to the key table corresponding to each data frame and interference data. Specifically, every time the lower computer obtains a data frame, it can obtain the key table x and interference data y corresponding to each data frame. The lower computer can insert one byte of interference data y after offsetting x bits in the data frame to complete the encryption and obtain the encrypted bin file.

[0070] For example, the first 100 frames of data in the initial bin file can be selected. Among them, each data frame is 16 bytes and is stored according to the following key table. The key table is:

[0071] {2,5,3,8,5,4,9,4,5,6,

[0072] 3,9,0,9,3,6,5,8,1,3,

[0073] 9,4,6,7,2,4,5,9,3,0,

[0074] 2,3,4,6,3,6,5,6,1,8,

[0075] 2,5,4,5,6,6,7,7,3,3,

[0076] 3,8,3,4,6,4,7,1,4,2,

[0077] 7,6,9,5,8,2,6,4,8,5,

[0078] 4,1,2,8,4,1,5,8,3,9,

[0079] 2,7,4,2,8,1,9,3,3,1,

[0080] 3,6,1,8,3,9,2,0,2,4}

[0081] This is a key array of 100 elements. Each time the lower computer receives a data frame, it takes the corresponding element value x in the key table, and then inserts a byte of interference data y after offsetting x bits in this data frame. There are a total of 100 frames.

[0082] Exemplarily, to make the interference data irregular and confusing, it can be stipulated that the 100 interference data arrays are:

[0083] {0x40,0x19,0x08,0x80,0xDF,0xF8,0x40,0x19,0x0A,0x88,

[0084] 0x0A,0x80,0x0A,0x88,0x4F,0xF6,0xDF,0x70,0x02,0x40,

[0085] 0x08,0x23,0x00,0x24,0x01,0x28,0x05,0xD1,0xDF,0xF8,

[0086] 0x02,0x24,0x10,0xE0,0xDF,0xF8,0xC8,0x5A,0x03,0x26,

[0087] 0x2D,0x5D,0x5B,0x19,0x64,0x1C,0x8C,0x42,0xF6,0xDB,

[0088] 0xDF,0xF8,0xD0,0x09,0x89,0xB2,0x30,0xF8,0x11,0x0A,

[0089] 0xB0,0x09,0x89,0xB2,0x10,0xF8,0x11,0x09,0x10,0xF0,

[0090] 0x03, 0xEB, 0x06, 0x01, 0x89, 0x78, 0x55, 0xFA, 0x81, 0xF5,

[0091] 0x0B, 0x08, 0x9B, 0xB2, 0xD2, 0x5C, 0x03, 0x09, 0x9B, 0xB2,

[0092] 0xFC, 0x39, 0xDF, 0xF8, 0x3C, 0x29, 0x0C, 0x08, 0xA4, 0xB2}

[0093] If the slave device receives a data frame of the initial bin file: F02C0020B15101081152010815520108, and if this is the third data frame of the initial bin file, according to the key table, the key corresponding to this data frame is "3". According to the preset encryption rule, that is, after offsetting this data frame by 3 bits, interference data 0x08 is inserted, and the initial data frame is encrypted into an encrypted frame: F02C000x0820B15101081152010815520108. Repeating this process can complete the encryption of the initial bin file.

[0094] Such an encryption method is simple and not easily cracked. The number of code possibilities generated thereby is at least 16 to the 100th power. In this way, the encrypted bin file segment will not be able to run properly, which can effectively protect the burned file from leakage and requires special decryption to be burned normally.

[0095] S102: If the first software identifier is different from the second software identifier, obtain the burned file from the intermediate carrier of the burned file.

[0096] The target device stores a first software identifier, and the first software identifier can be the unique version identification information of the software pre-installed on the target device at the time of factory. The burned file writes a second software identifier, and the second software identifier can be the unique software version identification information of the burned file. The target device compares the first software identifier and the second software identifier. When the first software identifier is different from the second software identifier, it indicates that the software version in the target device is different from the software version stored in the intermediate carrier of the burned file and can be updated. At this time, the target device obtains the burned file from the intermediate carrier of the burned file; when the first software identifier is the same as the second software identifier, it indicates that the software version in the target device is the same as the software version stored in the intermediate carrier of the burned file and does not need to be updated. At this time, the burning process is terminated.

[0097] In one implementation, to determine whether the software in the target device is the latest version, that is, after the intermediate carrier of the burned file is connected to the target device, compare whether the software version identification information in the target device is the same as the software version information in the intermediate carrier of the burned file. Therefore, a bootloader program is installed in the target device, and this program can compare whether the first software identifier is the same as the second software identifier, so as to determine whether the target device needs to burn new software.

[0098] The bootloader program is specifically stored in the chip of the target device, such as chips like STM32 and GD32. To avoid mixing and confusion in the code storage area, the internal code storage area of the chip is divided into two parts according to the size of the bootloader program. One part is the bootloader code area, and the other part is the application code area of the target device. The storage location of the bootloader code can be set in the burning tool keil. For example, 10 bytes at the end of the bootloader program code area on the target device can be used to store the first software identifier.

[0099] In one implementation, the specific process of the bootloader program running is as follows:

[0100] Initialize the hardware: set the system clock, initialize the communication serial port, and initialize the internal storage;

[0101] According to the command prompt of the intermediate carrier of the burned file, write a program to read the intermediate carrier of the burned file through the communication serial port;

[0102] Read the information of the intermediate carrier of the burned file, and identify the software version identification information of the burned file, that is, the second software identifier, compare the first software identifier and the second software identifier. If they are the same, do not burn; if they are different, burn;

[0103] The target device reads the encrypted bin file. At this time, the first 100 16-byte data need to be decrypted according to the key, and then the decrypted target bin file is written into the specified application code area of the target device. At this time, the bootloader program finishes running.

[0104] S103: Decrypt the burned file to obtain the target bin file.

[0105] Since the burned file in this embodiment is encrypted and cannot run directly, the target device needs to decrypt the burned file to obtain the target bin file. When the target device performs the decryption process, the decryption method can be determined corresponding to the encryption method of the burned file. The decryption method here is not specifically limited.

[0106] In one implementation, the programming file is an encrypted bin file obtained by the lower computer processing the hex file and encrypting the initial bin file. Specifically, every time the lower computer obtains a data frame, it can obtain the corresponding key table x and interference data y for each data frame. The lower computer can insert one byte of interference data y after offsetting x bits in the data frame to complete the encryption and obtain the encrypted bin file. Therefore, in this embodiment, the specific process of corresponding decryption can be as follows: the target device obtains the key corresponding to the encrypted frame, and locates the position of the interference data in the encrypted frame according to the key; the interference data is deleted according to the position of the interference data to obtain the target bin file.

[0107] For example, the target device receives an encrypted data frame: F02C000x0820B15101081152010815520108, obtains the key corresponding to this encrypted frame as 3, can locate the position of the interference array, determines that the interference array is 0x08, deletes the interference array in this encrypted data frame, and can obtain the target data frame: F02C0020B15101081152010815520108, thus completing the decryption of one data frame. Repeating this operation can complete the decryption of the entire encrypted bin file.

[0108] S104: Circularly read the target bin file and write the target bin file into the preset code area.

[0109] Optionally, the target bin file is the file finally programmed to the target device, and the target device stores the target bin file in the application code area of the target device. The application code area is a part of the internal chip code storage area of the target device. The code storage area includes an application code storage area and a bootloader code area. When the target bin file is completely written into the preset code area, the programming of the new software is completed.

[0110] In this application, the programming file is transmitted to the lower computer by the upper computer, and then the lower computer encrypts and transmits the programming file to the intermediate carrier of the programming file. The intermediate carrier of the programming file has the characteristics of small volume and convenient transportation. When the embedded product needs to update the software, directly inserting or connecting the intermediate carrier of the programming file can complete the update, without the participation of other devices and professional technicians. The programming method is simple and improves the efficiency; in addition, since the lower computer encrypts the programming file, the problem of software leakage during the programming process is solved, and the programming file is protected from leakage.

[0111] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution is prior or subsequent. The order of execution of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of this application.

[0112] Reference Figure 3 According to Embodiment 3 of the present application, a schematic diagram of a device for a target device is provided. Each module included is used to execute Figure 2 each step in the corresponding embodiment. For specific details, please refer to Figure 2 the relevant description in the corresponding embodiment. For the sake of convenience of description, only the part related to this embodiment is shown. Refer to Figure 3 , the device 3 of the target device includes:

[0113] An acquisition module 310, configured to acquire a first software identifier of a product to be burned stored in the target device, and acquire a second software identifier corresponding to a burn file from an intermediate carrier of the burn file;

[0114] A processing module 320, configured to acquire the burn file from the intermediate carrier of the burn file if the first software identifier is different from the second software identifier;

[0115] A decryption module 330, configured to perform decryption processing on the burn file to obtain a target bin file;

[0116] A burn module 340, configured to circularly read the target bin file and write the target bin file into a preset code area.

[0117] Figure 4 is a schematic structural diagram of a target device provided by Embodiment 3 of the present application. As Figure 4 shown, the target device 4 of this embodiment includes: a processor 40, a memory 41, and a computer program 42 stored in the memory 41 and executable on the processor 40, such as a target program. When the processor 40 executes the computer program 42, the steps in the above-mentioned various target method embodiments are implemented, such as Figure 2 the steps 101 to 104 shown. Alternatively, when the processor 40 executes the computer program 42, the functions of each module / unit in the above-mentioned various device embodiments are implemented, such as Figure 3 the functions of modules 310 to 340 shown.

[0118] Exemplarily, the computer program 42 can be divided into one or more modules / units. The one or more modules / units are stored in the memory 41 and executed by the processor 40 to complete the present application. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program 42 in the target device 4. For example, the computer program 42 can be divided into an acquisition module, a processing module, a decryption module, and a burn module. The specific functions of each module are as follows:

[0119] An acquisition module, configured to acquire a first software identifier of a product to be programmed stored in the target device, and acquire a second software identifier corresponding to the programming file from an intermediate carrier of the programming file;

[0120] A processing module, configured to, if the first software identifier is different from the second software identifier, acquire the programming file from the intermediate carrier of the programming file;

[0121] A decryption module, configured to perform decryption processing on the programming file to obtain a target bin file;

[0122] A programming module, configured to cyclically read the target bin file and write the target bin file into a preset code area.

[0123] The target device may include, but is not limited to, a processor 40 and a memory 41. Those skilled in the art can understand that Figure 4 merely examples of the target device 4, which do not constitute a limitation to the target device 4, may include more or fewer components than shown in the figure, or combine some components, or different components. For example, the target device may further include an input / output device, a network access device, a bus, etc.

[0124] The so-called processor 40 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0125] The memory 41 may be an internal storage unit of the target device 4, such as a hard disk or memory of the target device 4. The memory 41 may also be an external storage device of the target device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the target device 4. Further, the target device 4 may also include both an internal storage unit and an external storage device of the target device 4. The memory 41 is used to store the computer program and other programs and data required by the target device. The memory 41 may also be used to temporarily store data that has been output or is to be output.

[0126] It should be noted that for the information interaction, execution process, etc. between the above-mentioned devices / units, since they are based on the same concept as the method embodiments of this application, for their specific functions and the technical effects brought, reference can be specifically made to the method embodiment part, and details will not be repeated here.

[0127] The embodiments of this application also provide a network device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor. When the processor executes the computer program, the steps in any of the above-mentioned method embodiments are implemented.

[0128] The embodiments of this application also provide a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in each of the above-mentioned method embodiments can be implemented.

[0129] The embodiments of this application provide a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal is caused to implement the steps in each of the above-mentioned method embodiments when executed.

[0130] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the method embodiments of this application, a computer program can be used to instruct relevant hardware to complete. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps in each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the photographing device / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk, or an optical disc, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunication signal.

[0131] In the above embodiments, the descriptions of each embodiment have their own focuses. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0132] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A professional person can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0133] In the embodiments provided in this application, it should be understood that the disclosed device / network device and method can be implemented in other ways. For example, the device / network device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the shown or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical or other form.

[0134] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0135] The above-described embodiments are only used to illustrate the technical solutions of this application, rather than to limit them; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of each embodiment of this application, and should all be included in the protection scope of this application.

Claims

1. A method for burning embedded software, applied to a target device, characterized in that, The method includes: Obtain a first software identifier of the product to be programmed stored in the target device, and obtain a second software identifier corresponding to the programming file from an intermediate carrier of the programming file; the programming file is an encrypted bin file obtained by the lower computer processing a hex file to obtain an initial bin file and encrypting the initial bin file; the initial bin file consists of data frames; the encrypted bin file is obtained by the lower computer encrypting each data frame according to a key table corresponding to the data frame and interference data; If the first software identifier is different from the second software identifier, obtain the programming file from the intermediate carrier of the programming file; Perform decryption processing on the programming file to obtain a target bin file; Read the target bin file cyclically and write the target bin file into a preset code area.

2. The method according to claim 1, wherein The hex file is sent from the upper computer to the lower computer.

3. The method according to claim 1, characterized in that, The target bin file includes encrypted frames. The performing decryption processing on the programming file to obtain a target bin file includes: Obtain the key corresponding to the encrypted frame, and locate the position of the interference data in the encrypted frame according to the key; Delete the interference data according to the position of the interference data to obtain a target bin file.

4. The method according to any one of claims 1 to 3, characterized in that, The intermediate carrier of the programming file includes: a memory device or an external chip.

5. An embedded software burning system, characterized in that, The system includes: an upper computer, a lower computer, an intermediate carrier of the programming file, and a target device; The upper computer is configured to generate a hex file corresponding to the software to be programmed and send the hex file to the lower computer; The lower computer is configured to receive the hex file sent by the upper computer; process the hex file to obtain an initial bin file, and encrypt the initial bin file to obtain an encrypted bin file; send the encrypted bin file to the intermediate carrier of the programming file; the initial bin file consists of data frames; the encrypted bin file is obtained by the lower computer encrypting each data frame according to a key table corresponding to the data frame and interference data; The intermediate carrier of the programming file is configured to store the encrypted bin file; The target device is configured to obtain a first software identifier of the product to be programmed stored in the target device, and obtain a second software identifier corresponding to the programming file from the intermediate carrier of the programming file; if the first software identifier is different from the second software identifier, obtain the programming file from the intermediate carrier of the programming file; perform decryption processing on the programming file to obtain a target bin file; read the target bin file cyclically and write the target bin file into a preset code area.

6. The system according to claim 5, wherein The encrypting the initial bin file to obtain an encrypted bin file includes: Obtain the key corresponding to each data frame from a preset key table; the key consists of any one digit from 0 to 9; Perform offset processing on the data frame according to the key, and insert preset interference data into the offset data frame to obtain the encrypted bin file.

7. A target device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Factory and user data automatic programming method and system for intelligent television

    CN104349192A

  • Computing device and BIOS update method therefor, and medium

    WO2021233363A1