Key burning method, device, equipment and storage medium
By detecting the target key and creating an array of other keys during the HDCP key burning process, obtaining the burning start address, and writing the key into memory, the problem of insufficient Flash storage space is solved, and more efficient memory utilization is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUIZHOU HUIZHI TECH CO LTD
- Filing Date
- 2022-06-27
- Publication Date
- 2026-04-28
AI Technical Summary
In the existing technology, the HDCP key burning process requires the use of multiple separate memory banks, resulting in insufficient Flash storage space and increased memory costs, and failing to effectively utilize the 16M Flash storage space.
By detecting the target key and creating an array corresponding to the remaining keys, the starting address for burning each key to be burned is obtained. The target key file and the remaining keys are written into memory, avoiding storing multiple keys in a separate memory library. The memory library space is used for partitioning and storage.
It saves on memory storage costs, solves the problem of insufficient Flash storage space, and makes key storage space more streamlined.
Smart Images

Figure CN115206390B_ABST
Abstract
Description
Technical Field
[0001] This invention generally relates to the field of data burning technology, and specifically to a KEY burning method, apparatus, device and storage medium. Background Technology
[0002] With the continuous development of digital, networked, and intelligent technologies in television, digital television offers richer program content and is increasingly entering households. To protect program content and prevent unauthorized recording of high-definition signals transmitted via HDMI or DVI, High-bandwidth Digital Content Protection (HDCP) technology has emerged. This technology encrypts the digital signals transmitted through digital video interfaces, thus protecting multimedia content between the transmitting end (computer, DVD, set-top box, etc.) and the receiving end (monitor, television, projector, etc.). Playback or display devices supporting HDCP technology require an HDCP key. Typically, this key needs to be burned into the device's memory before it leaves the factory, for example, into the corresponding flash bank. Each device uses a different key. Therefore, how to burn the key into memory is crucial.
[0003] Currently, in the relevant technologies, each digital signal is stored in a separate bank during the burning process. For example, a 4K TV exported to Europe needs to burn three keys: HDCP1.4, HDCP2.2, and CI+, which are stored in three separate banks. However, this solution uses 8MB of Flash memory, which is insufficient to provide three free banks. If 16MB of Flash memory is used, it will require additional memory costs, and the key storage space is not efficient enough. Summary of the Invention
[0004] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a KEY burning method, apparatus, device and storage medium.
[0005] In a first aspect, the present invention provides a key burning method, the method comprising:
[0006] The key is detected to trigger the burning operation, and the target key is determined from multiple keys to be burned.
[0007] Detect the target key file corresponding to the target key;
[0008] Create an array corresponding to the remaining keys and store it in the stack area. The remaining keys are the keys other than the target key among the multiple keys to be burned.
[0009] Obtain the starting address for each key to be programmed. Based on the array of the remaining keys and the starting address, write the target key file and the remaining keys into memory. The starting address is obtained by dividing the memory library according to the size of the memory occupied by each key to be programmed.
[0010] In one embodiment, based on the array corresponding to the remaining keys and the burning start address, the target key file and the remaining keys are written into memory, including:
[0011] Obtain the memory size occupied by the remaining keys in the memory library;
[0012] Based on the burning start address and memory size corresponding to the remaining keys, the remaining keys are read and stored in the array corresponding to the remaining keys in the stack area;
[0013] Remove the write protection operation from the memory bank and erase all data in the memory bank;
[0014] Based on the starting address of the programming corresponding to the target key, the target key is written into memory;
[0015] According to the burning start address corresponding to the remaining keys, the data in the array corresponding to the remaining keys in the stack area is written into memory.
[0016] In one embodiment, after writing the data from the arrays corresponding to the remaining keys in the stack area into memory, the method further includes:
[0017] Perform a write protection operation to enable memory.
[0018] In one embodiment, after performing the memory enable write protection operation, the method further includes:
[0019] The multiple keys to be programmed are detected and verified to determine whether all of them have been programmed into the memory.
[0020] In one embodiment, the plurality of keys to be programmed are detected and verified to determine whether all of the plurality of keys to be programmed have been programmed into the memory, including:
[0021] The specified operation is executed repeatedly until the serial number corresponding to each of the multiple keys to be burned is correct, thus determining that all of the multiple keys to be burned have been burned into the memory;
[0022] The specified operation includes:
[0023] Obtain the serial number corresponding to the already burned key among the plurality of keys to be burned; when the specified operation is executed for the first time, the already burned key is the first two keys among the plurality of keys to be burned; when the specified operation is not executed for the first time, the already burned key is the one obtained when the serial number of the already burned key determined in the previous execution of the specified operation is correct and the next key has been burned.
[0024] Check if the serial number corresponding to the burned key is correct;
[0025] When the serial number corresponding to the burned key is correct, execute the burning operation for the next key and control the entry into the next specified operation;
[0026] If the serial number corresponding to the burned key is incorrect, the control will not proceed to the next specified operation.
[0027] In one embodiment, the plurality of keys to be programmed are detected and verified to determine whether all of the plurality of keys to be programmed have been programmed into the memory, including:
[0028] Using a programming tool, the stored data of multiple keys to be programmed in the memory library stored in the memory is exported;
[0029] The stored data is compared with the original data of multiple keys to be burned;
[0030] When the comparison is consistent, it is determined that all of the multiple keys to be burned have been burned into the memory.
[0031] In one embodiment, obtaining the serial number corresponding to the already programmed key among the plurality of keys to be programmed includes:
[0032] Determine the storage rules for the serial numbers corresponding to the burned keys;
[0033] According to the serial number storage rules, obtain the serial number corresponding to the burned key.
[0034] Secondly, embodiments of this application provide a key burning device, which includes:
[0035] The determination module is used to detect the key burning trigger operation and determine the target key from multiple keys to be burned;
[0036] The detection module is used to detect the target key file corresponding to the target key;
[0037] A creation module is used to create arrays corresponding to the remaining keys and store them in the stack area. The remaining keys are the keys other than the target key among the multiple keys to be burned.
[0038] The programming module is used to obtain the programming start address corresponding to each key to be programmed, and write the target key file and the remaining keys into memory based on the array corresponding to the other keys and the programming start address. The programming start address is obtained by dividing the memory library according to the size of the memory occupied by each key to be programmed.
[0039] Thirdly, embodiments of this application provide a device including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the KEY burning method as described in the first aspect above.
[0040] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, the computer program being used to implement the KEY burning method of the first aspect above.
[0041] The KEY programming method, apparatus, device, and storage medium provided in this application embodiment determine the target key from multiple keys to be programmed by detecting the key programming trigger operation, and detect the target key file corresponding to the target key. Then, an array corresponding to the remaining keys is created and stored in the stack area. The remaining keys are the keys other than the target key among the multiple keys to be programmed. The programming start address corresponding to each key to be programmed is obtained. Based on the array corresponding to the remaining keys and the programming start address, the target key file and the remaining keys are written into memory. The programming start address is obtained by dividing the memory bank according to the memory size occupied by each key to be programmed. This technical solution eliminates the need to store multiple keys to be programmed in a separate memory bank. During the key writing process, because an array corresponding to the remaining keys is created and the programming start address corresponding to each key to be programmed is obtained, a single memory bank can store multiple different keys to be programmed simultaneously, saving memory storage costs, solving the problem of insufficient Flash storage space, and making the space storage of each key more concise. Attached Figure Description
[0042] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0043] Figure 1 A schematic diagram of the implementation environment for the KEY burning method provided in this application embodiment;
[0044] Figure 2 A schematic flowchart illustrating the KEY burning method provided in this application embodiment;
[0045] Figure 3 This is a schematic diagram illustrating the structure for obtaining the starting address of multiple keys to be programmed, provided in an embodiment of this application.
[0046] Figure 4 A schematic flowchart illustrating the KEY burning method provided in this application embodiment;
[0047] Figure 5 This is a schematic diagram of the KEY programming device provided in the embodiments of this application;
[0048] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0049] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.
[0050] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0051] Understandably, with the rapid development of display technology and increasingly demanding functional requirements, the amount of data that needs to be transmitted is growing. Current technologies necessitate the use of High Definition Multimedia Interface (HDMI) and Digital Visual Interface (DVI) for data transmission. HDMI is a high-definition digital interface standard that provides high bandwidth and lossless transmission of digital video and audio signals. When using HDMI and DVI for data transmission, High Bandwidth Digital Content Protection (HDCP) is required. HDCP technology, developed by Intel, ensures that HDMI is not subject to signal encryption restrictions and can accept high-definition signals of all formats. HDCP is an encryption technology that prevents digital content piracy; if neither the software nor the hardware supports HDCP, the transmitted digital content cannot be read.
[0052] Each HDCP-enabled device has a unique key set, typically consisting of 40 keys, each 56 bits long. Every HDCP device must have a unique device key. Manufacturers must purchase these keys from the Digital-CP organization before producing display devices, and must ensure that each device uses a unique key; a single key cannot be used by multiple devices. Manufacturers then need to burn the purchased key into the display terminal's interface memory to enable HDCP functionality.
[0053] It's worth noting that during the development of HDCP, the initial HDCP key was version 1.4, which supported 1080p high-definition video protection. However, with the advancement of electrical technology and the increasing prevalence of 4K signals, the next-generation protection protocol, HDCP 2.2, emerged to protect 4K content from direct copying. Furthermore, the European digital television signal DVB-S2 requires payment for certain programs, necessitating encryption via CI cards. Therefore, CI and keys have become indispensable tools.
[0054] HDCP 1.4 / 2.2 and CI+KEY require each TV to use a unique key due to copyright restrictions. For TVs without an operating system, the key can only be burned to the corresponding bank in the Flash memory via USB flash drive. The Flash memory is erased by page erasure, meaning one page is one bank, and each bank is 64kB.
[0055] In related technologies, each digital signal is stored in a separate bank during the burning process. For example, a 4K TV exported to Europe needs to burn three keys: HDCP1.4, HDCP2.2, and CI+, which are stored in three separate banks. However, this solution uses 8MB of Flash because the 4K solution itself has a large bin file compiled from the code. In addition, the number of DVBS channels stored in the data area, as well as the increase in customer languages and UI images, makes the 8MB Flash space insufficient. The Flash is not enough to provide three free banks. If 16MB of Flash is used, it will require additional memory costs, and the key storage space is not efficient enough.
[0056] To address the aforementioned shortcomings, this application provides a key programming method. Compared with existing technologies, this solution eliminates the need to store multiple keys to be programmed in a separate memory bank. During the key writing process, an array corresponding to the other keys is created, and the programming start address corresponding to each key is obtained. Based on the array and the programming start address, a single memory bank can simultaneously store multiple different keys to be programmed, saving memory storage costs, solving the problem of insufficient Flash storage space, and making the storage space for each key more streamlined.
[0057] The solution provided in this application can be applied to all Flash storage TV solutions that do not have an operating system and require key burning.
[0058] Figure 1 This is an implementation environment architecture diagram of a KEY burning method provided in an embodiment of this application. For example... Figure 1 As shown, the implementation environment architecture includes: a burning device 100 and a terminal device 200.
[0059] The burning device 100 has storage space, such as a USB flash drive. The burning device is used to store the key file corresponding to the key to be burned. The key file includes key data that needs to be burned into the terminal device, such as the HDCP key, MAC address, Netflix key, serial number and other binary codes used for security authentication.
[0060] The terminal device 200 is a terminal capable of writing key codes and can be a display device. The type of terminal device 200 may include, but is not limited to, smart TVs, smartphones, tablets, laptops, and desktop computers; this embodiment does not specifically limit this. The terminal device includes memory, which includes a memory bank, for example, Flash memory and a Bank memory bank.
[0061] Optionally, the burning device 100 and the terminal device 200 establish a communication connection via a wired or wireless network.
[0062] For ease of understanding and explanation, the following will use... Figures 2 to 6 This application provides a detailed description of the KEY burning method, apparatus, device, and storage medium provided in its embodiments.
[0063] Figure 2 The diagram shown is a schematic flowchart of a key programming method according to an embodiment of this application. This method can be executed by a key programming device. Figure 2 As shown, the method includes:
[0064] S101, Detect the key burning trigger operation and determine the target key from multiple keys to be burned.
[0065] Specifically, the programming device can be connected to the programming interface of the memory in the terminal device via an interface converter. When the programming device uses a USB interface, the interface converter can achieve a matching connection between the programming device's interface and the memory's programming interface. The programming device can be, for example, a USB flash drive.
[0066] Optionally, the aforementioned interface converter can be an interface converter from the FT2232 series, such as the FT2232D interface converter which converts a USB interface to an I2C interface. The aforementioned memory can be an erasable and rewritable memory, such as a memory of model AT24XX, or it can be Flash memory.
[0067] It should be noted that in order to achieve secure communication between the digital TV and the burning device, the digital TV needs to use a key for verification. For example, it needs to use binary codes such as the HDCP key, MAC address, Netflix key, and serial number for security authentication.
[0068] After the programming device connects to the programming interface of the memory in the terminal device via the interface converter, it detects the key programming trigger operation and determines the target key from multiple keys to be programmed. The number of multiple keys to be programmed can be three, for example, including HDCP1.4, HDCP2.2, CI+KEY, etc. The target key refers to any one of the multiple keys to be programmed that needs to be programmed.
[0069] Understandably, since a memory bank has 64kB of memory space, it can store multiple keys to be programmed simultaneously. Therefore, the starting address for programming each key can be obtained by dividing the memory space according to the size of each key in the memory bank.
[0070] For example, please see Figure 3 As shown, for example, if there are three keys to be programmed: HDCP1.4, HDCP2.2, and CI+KEY, a Bank is used to assign different starting addresses to the corresponding keys according to their size requirements. Specifically, the starting address for programming HDCP1.4 can be determined as Bank 0, meaning programming begins at Bank 0; the starting address for programming HDCP2.2 can be determined as Bank 1024, meaning programming begins at Bank 1024; and the starting address for programming CI+KEY can be determined as Bank 3072, meaning programming begins at Bank 3072.
[0071] S102. Detect the target key file corresponding to the target key.
[0072] In this step, after determining the target key from multiple keys to be burned, the corresponding target key file can be detected. For example, from three keys to be burned: HDCP1.4, HDCP2.2, and CI+KEY, the target key can be determined to be HDCP2.2, HDCP1.4, or CI+KEY. Specifically, when the target key is determined to be HDCP2.2, the corresponding HDCP2.2 key file in the USB drive is detected.
[0073] S103. Create arrays corresponding to the remaining keys and store them in the stack area. The remaining keys are the keys other than the target key among the multiple keys to be burned.
[0074] It should be noted that since Bank uses page erasure, the entire page must be erased before data can be written. Therefore, when burning one of the keys, the already burned keys cannot be erased.
[0075] Specifically, after the target key is determined, the remaining keys other than the target key are then identified from the multiple keys to be programmed. Arrays corresponding to these remaining keys are created and stored in the stack area. The number of arrays created is the total number of the remaining keys other than the target key among the multiple keys to be programmed. The number of these remaining keys can be multiple. For example, if the multiple keys to be programmed are HDCP1.4, HDCP2.2, and CI+KEY, and the target key is HDCP2.2, then two arrays are created, which can be HDCPKEY_14[] and CI_KEY[].
[0076] In this step, by creating a separate array to store the remaining keys, it is possible to store the remaining keys in the array of remaining keys when burning one of the target keys. This prevents the burned keys from being erased during the whole page erase process when writing data.
[0077] S104. Obtain the starting address for each key to be burned. Based on the array of other keys and the starting address for burning, write the target key file and the other keys into memory. The starting address for burning is obtained by dividing the memory library according to the size of the memory occupied by each key to be burned.
[0078] Specifically, the size of the memory occupied by the other keys in the memory bank can be obtained. Based on the burning start address and memory size of the other keys, the other keys are read and stored in the array corresponding to the other keys in the stack area. Then, the write protection operation of the memory bank is removed, all data in the memory bank is erased, and the target key is written into memory based on the burning start address of the target key. According to the burning start addresses of the other keys, the data in the array corresponding to the other keys in the stack area is written into memory.
[0079] In this embodiment, during the process of reading the remaining keys and storing them in the array corresponding to the remaining keys in the stack area based on the burning start address and memory size of the remaining keys, the memory size occupied by each remaining key in the memory bank can be determined. Starting from the burning start address of each remaining key, regardless of whether the key has been burned before, all remaining keys are read and stored in the array corresponding to the remaining keys in the stack area.
[0080] For example, please see Figure 4 As shown, when the key burning operation is triggered, the target key is determined from multiple keys to be burned. For example, the multiple keys to be burned are HDCP1.4, HDCP2.2, and CI+KEY, and the target key is HDCP2.2. Then, the HDCP2.2 key file corresponding to HDCP2.2 in the USB flash drive is detected. During the burning of the HDCP2.2 key, the HDCP2.2 function can be used, and two additional arrays are created to store the corresponding other keys. These two arrays can be HDCPKEY_14[] and CI_KEY[]. At this time, the arrays are stored in the stack area and are automatically released after the function is used.
[0081] Then, based on the starting address and memory size of HDCP1.4 and CI+KEY, regardless of whether HDCP1.4 and CI+KEY have been programmed before, HDCP1.4 and CI+KEY are read out and stored in the stack area as two arrays HDCPKEY_14[] and CI_KEY[] corresponding to HDCP1.4 and CI+KEY. That is, starting from the programming start address of Bank 0, 304 bytes are read and HDCP1.4 is stored in array HDCPKEY_14[], and starting from the programming start address of Bank 3072, 5490 bytes are read and CI+KEY is stored in array CI_KEY[].
[0082] Further, the write protection of the Bank is removed, and the Bank is erased, meaning all data in the entire Bank is completely deleted, including the HDCP1.4 and CI+KEY previously written to the memory Flash. Then, the HDCP2.2 key file corresponding to the target key HDCP2.2 key is read from the USB drive, and based on the HDCP2.2 key's burning start address, starting from the burning start address of Bank1024, the HDCP2.2 key file is written to the memory bank Bank corresponding to the memory Flash. Then, the data in one of the two arrays in the stack area, HDCPKEY_14[], is written to the memory bank Bank corresponding to the memory Flash, starting from the burning start address of Bank 0, and the data in the other array, CI_KEY[], is written to the memory bank Bank corresponding to the memory Flash, starting from the burning start address of Bank 3072. Then, the memory write protection operation is performed.
[0083] In this embodiment, memory write protection is enabled to prevent other programs from tampering with the Bank data.
[0084] It should be noted that when the target key is determined to be HDCP1.4 or CI+KEY from multiple keys to be programmed, the same process as with keyHDCP2.2 can be used. This involves creating two arrays corresponding to the other keys, then reading the data of the other two keys and storing them in the two arrays based on the programming start address and memory size of the other two keys, and programming the target key to be programmed, i.e., programming HDCP1.4 or CI+KEY. Then, the corresponding data in the two arrays is written to the corresponding address in the memory bank to complete the programming operation.
[0085] When the terminal device is powered on and in use, the read address can be modified, and the stored key data can be correctly read and retrieved according to the key addresses of the new modification method.
[0086] The KEY programming method provided in this application detects the programming trigger operation of a key, determines the target key from multiple keys to be programmed, detects the target key file corresponding to the target key, then creates an array corresponding to the remaining keys and stores it in the stack area. The remaining keys are the keys other than the target key among the multiple keys to be programmed. The programming start address corresponding to each key to be programmed is obtained. Based on the array corresponding to the remaining keys and the programming start address, the target key file and the remaining keys are written into memory. The programming start address is obtained by dividing the memory bank according to the memory size occupied by each key to be programmed. This technical solution eliminates the need to store multiple keys to be programmed in a separate memory bank. During the key writing process, because an array corresponding to the remaining keys is created and the programming start address corresponding to each key to be programmed is obtained, a single memory bank can store multiple different keys to be programmed simultaneously, saving memory storage costs, solving the problem of insufficient Flash storage space, and making the space storage of each key more concise.
[0087] Furthermore, after performing the memory enable write protection operation, the method also includes: detecting and verifying multiple keys to be programmed to determine whether all multiple keys to be programmed have been programmed into memory.
[0088] As one possible approach, during the process of detecting and verifying multiple keys to be programmed to determine whether all keys have been programmed into memory, the following specified operations can be executed repeatedly until the serial numbers corresponding to each key are correct, thus determining that all keys have been programmed into memory; if any key has an incorrect serial number, it is determined that not all keys have been programmed into memory.
[0089] The specified operations include: obtaining the serial number corresponding to the already burned key among multiple keys to be burned; when the specified operation is executed for the first time, the already burned keys are the first two keys among the multiple keys to be burned; when the specified operation is not executed for the first time, the already burned keys are the serial numbers of the already burned keys determined in the previous execution of the specified operation, which are correct, and obtained after the next key has been burned; checking whether the serial number corresponding to the already burned key is correct; when the serial number corresponding to the already burned key is correct, executing the burning operation for the next key, and controlling the entry into the next specified operation; when the serial number corresponding to the already burned key is incorrect, controlling the entry into the next specified operation.
[0090] For example, when there are four keys to be programmed and two keys have already been programmed, the serial numbers corresponding to the two programmed keys can be obtained, and it can be checked whether the serial numbers corresponding to the two programmed keys are correct. The serial numbers can be compared with the serial numbers corresponding to the two keys in the original data. If the comparison is consistent, it is determined that the serial numbers corresponding to the two programmed keys are correct; if the comparison is inconsistent, it is determined that the serial numbers corresponding to the two programmed keys are incorrect.
[0091] Furthermore, once the serial numbers corresponding to the two burned keys are confirmed to be correct, the burning operation for the third key is performed and completed. Then, the serial numbers corresponding to the three burned keys are obtained, and their correctness is checked. This serial number is compared with the serial numbers corresponding to the three keys in the original data. If they match, the serial numbers corresponding to the three burned keys are determined to be correct; if they do not match, the serial numbers corresponding to the three burned keys are determined to be incorrect. This process continues until the serial numbers corresponding to the three burned keys are confirmed to be correct, the burning operation for the fourth key is performed, and completed. Then, the serial numbers corresponding to the four burned keys are obtained, and their correctness is checked, until the verification of each of the multiple keys to be burned is completed.
[0092] In the process of obtaining the serial number corresponding to the already burned key among multiple keys to be burned, the storage rule of the serial number corresponding to the already burned key can be determined, and the serial number corresponding to the already burned key can be obtained according to the serial number storage rule.
[0093] For example, when multiple keys to be programmed are HDCP1.4, HDCP2.2, and CI+KEY, the HDCP1.4 key's serial number is stored by reading 4 bytes starting from bit 296. HDCP2.2 itself does not store a serial number; during programming, the serial number is written to the end of the key, and 4 bytes are added to an array before writing to Flash. The CI+KEY's serial number is stored by reading 4 bytes starting from bit 4. Furthermore, the serial numbers corresponding to HDCP1.4, HDCP2.2, and CI+KEY can be obtained through the factory menu display.
[0094] As another possible approach, during the process of testing and verifying multiple keys to be programmed to determine whether all keys have been programmed into memory, a programming tool can be used to export the stored data of multiple keys to be programmed from the memory library in memory, and compare the stored data with the original data of the multiple keys to be programmed. If the comparison matches, it is determined that all multiple keys to be programmed have been programmed into memory; if the comparison does not match, it is determined that not all multiple keys to be programmed have been programmed into memory.
[0095] For example, after burning three keys to be burned via USB flash drive, a computer-based burning tool (ISP) can be used to export the storage data of the three keys to be burned from the Flash memory and compare the stored data with the original data. When the storage data of the three keys to be burned matches the original data, it is determined that all three keys to be burned have been burned into memory, indicating that the burning was successful. When the comparison does not match, it is determined that multiple keys to be burned have not been burned into memory, indicating that the burning was unsuccessful.
[0096] In this embodiment, after the burning process is completed, the multiple keys to be burned are detected and verified. This can accurately determine whether all the multiple keys to be burned have been burned into memory, and verify the burning results. This allows for timely inspection of the burning results and execution of corresponding operations based on the burning results, thereby further improving the quality of the products leaving the factory.
[0097] It should be noted that although the operations of the method of the present invention are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. On the contrary, the steps depicted in the flowchart may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0098] on the other hand, Figure 5 This is a schematic diagram of a key burning device provided in an embodiment of this application. This device can be a component within a terminal device, such as... Figure 5 As shown, the device 400 includes:
[0099] The determination module 410 is used to detect the triggering operation of the key and determine the target key from multiple keys to be determined;
[0100] Detection module 420 is used to detect the target key file corresponding to the target key;
[0101] The creation module 430 is used to create arrays corresponding to the remaining keys and store them in the stack area. The remaining keys are the keys other than the target key among the plurality of keys to be used.
[0102] Module 440 is used to obtain the starting address corresponding to each key to be tested, and write the target key file and the remaining keys into memory based on the array corresponding to the remaining keys and the starting address. The starting address is obtained by dividing the memory library according to the size of the memory occupied by each key to be tested.
[0103] Optionally, the above module 440 is specifically used for:
[0104] Obtain the memory size occupied by the remaining keys in the memory library;
[0105] Based on the starting address and memory size of the remaining keys, the remaining keys are read and stored in the array corresponding to the remaining keys in the stack area;
[0106] Remove the write protection operation from the memory bank and erase all data in the memory bank;
[0107] Write the target key into memory based on the starting address corresponding to the target key;
[0108] According to the starting address corresponding to the remaining keys, the data in the array corresponding to the remaining keys in the stack area is written into memory.
[0109] Optionally, the above-mentioned device is also used for:
[0110] Perform a write protection operation to enable memory.
[0111] Optionally, the above-mentioned device is also used for:
[0112] The multiple keys to be submitted are detected and verified to determine whether all of the multiple keys to be submitted are in the memory.
[0113] Optionally, the above-mentioned device is specifically used for:
[0114] The specified operation is executed repeatedly until the serial number corresponding to each of the multiple keys is correct, thus determining that all the multiple keys have been loaded into the memory.
[0115] The specified operation includes:
[0116] Obtain the sequence number corresponding to the existing key among the plurality of keys to be executed; when the specified operation is executed for the first time, the existing key is the first two keys among the plurality of keys to be executed; when the specified operation is not executed for the first time, the existing key is the one obtained when the sequence number of the existing key determined in the previous execution of the specified operation is correct and the next key is completed.
[0117] Check if the serial number corresponding to the key is correct;
[0118] When the serial number corresponding to the key is correct, the operation is performed on the next key, and the control proceeds to the next specified operation.
[0119] If the serial number corresponding to the key is incorrect, the control will not proceed to the next specified operation.
[0120] Optionally, the above-mentioned device is also used for:
[0121] Using tools, the stored data of multiple keys stored in the memory library in the memory is exported;
[0122] The stored data is compared with the original data of multiple keys;
[0123] When the comparison matches, it is determined that all of the multiple keys to be added have been stored in the memory.
[0124] Optionally, the above-mentioned device is also used for:
[0125] Determine the storage rules for the serial numbers corresponding to the keys;
[0126] Based on the serial number storage rules, retrieve the serial number corresponding to the key.
[0127] The KEY programming device provided in this application embodiment determines the target key from multiple keys to be programmed by detecting the key programming trigger operation through a determination module, and then detects the target key file corresponding to the target key through a detection module. Next, an array corresponding to the remaining keys is created and stored in the stack area through a creation module. The remaining keys are the keys other than the target key among the multiple keys to be programmed. Then, the programming module obtains the programming start address corresponding to each key to be programmed. Based on the array corresponding to the remaining keys and the programming start address, the target key file and the remaining keys are written into memory. The programming start address is obtained by dividing the memory bank according to the memory size occupied by each key to be programmed. This technical solution eliminates the need to store multiple keys to be programmed in a separate memory bank. During the key writing process, because an array corresponding to the remaining keys is created and the programming start address corresponding to each key is obtained, a single memory bank can simultaneously store multiple different keys to be programmed, saving memory storage costs, solving the problem of insufficient Flash storage space, and making the space storage for each key more concise.
[0128] On the other hand, the terminal device provided in the embodiments of this application includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the KEY burning method as described above.
[0129] The following is for reference. Figure 6 , Figure 6 This is a schematic diagram of the computer system structure of the terminal device according to an embodiment of this application.
[0130] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage portion 603 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the system 600. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0131] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.
[0132] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a machine-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 603, and / or installed from removable medium 611. When the computer program is executed by central processing unit (CPU) 601, it performs the functions defined above in the system of this application.
[0133] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0134] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0135] The units or modules described in the embodiments of this application can be implemented in software or hardware. The described units or modules can also be located in a processor; for example, they can be described as: a processor including: a determining module, a detecting module, a creating module, and a programming module. The names of these units or modules do not necessarily limit the unit or module itself; for example, the determining module can also be described as "used to detect the programming trigger operation of the key, and to determine the target key from multiple keys to be programmed."
[0136] In another aspect, this application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable storage medium stores one or more programs, which, when used by one or more processors, execute the KEY burning method described in this application:
[0137] The key is detected to trigger the burning operation, and the target key is determined from multiple keys to be burned.
[0138] Detect the target key file corresponding to the target key;
[0139] Create an array corresponding to the remaining keys and store it in the stack area. The remaining keys are the keys other than the target key among the multiple keys to be burned.
[0140] Obtain the starting address for each key to be programmed. Based on the array of the remaining keys and the starting address, write the target key file and the remaining keys into memory. The starting address is obtained by dividing the memory library according to the size of the memory occupied by each key to be programmed.
[0141] In summary, the KEY burning method, apparatus, device, and storage medium provided in this application determine the target key from multiple keys to be burned by detecting the key burning trigger operation, and detect the target key file corresponding to the target key. Then, an array corresponding to the remaining keys is created and stored in the stack area. The remaining keys are the keys other than the target key among the multiple keys to be burned. The burning start address corresponding to each key to be burned is obtained. Based on the array corresponding to the remaining keys and the burning start address, the target key file and the remaining keys are written into memory. The burning start address is obtained by dividing the memory bank according to the memory size occupied by each key to be burned. This technical solution eliminates the need to store multiple keys to be burned in a separate memory bank. During the key writing process, because an array corresponding to the remaining keys is created and the burning start address corresponding to each key to be burned is obtained, a single memory bank can store multiple different keys to be burned simultaneously based on the array and the burning start address. This saves memory storage costs, solves the problem of insufficient Flash storage space, and makes the space storage of each key more concise.
[0142] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.
Claims
1. A key burning method, characterized in that, The method includes: The key is detected to trigger the burning operation, and the target key is determined from multiple keys to be burned. Detect the target key file corresponding to the target key; Create an array corresponding to the remaining keys and store it in the stack area. The remaining keys are the keys other than the target key among the multiple keys to be burned. Obtain the starting address for each of the keys to be programmed. The starting address is obtained by dividing the same memory library according to the size of the memory occupied by each key to be programmed. Based on the array corresponding to the remaining keys and the starting address for programming, write the target key file and the remaining keys into the same memory.
2. The method according to claim 1, characterized in that, Based on the array corresponding to the remaining keys and the burning start address, the target key file and the remaining keys are written into memory, including: Obtain the memory size occupied by the remaining keys in the memory library; Based on the burning start address and memory size corresponding to the remaining keys, the remaining keys are read and stored in the array corresponding to the remaining keys in the stack area; Remove the write protection of the memory bank and erase all data in the memory bank; Based on the starting address of the programming corresponding to the target key, the target key is written into memory; According to the burning start address corresponding to the remaining keys, the data in the array corresponding to the remaining keys in the stack area is written into memory.
3. The method according to claim 2, characterized in that, After writing the data from the arrays corresponding to the remaining keys in the stack area into memory, the method further includes: Perform a write protection operation to enable memory.
4. The method according to claim 3, characterized in that, After performing the memory write protection enable operation, the method further includes: The multiple keys to be programmed are detected and verified to determine whether all of them have been programmed into the memory.
5. The method according to claim 4, characterized in that, The plurality of keys to be programmed are detected and verified to determine whether all of the plurality of keys to be programmed have been programmed into the memory, including: The specified operation is executed repeatedly until the serial number corresponding to each of the multiple keys to be burned is correct, thus determining that all of the multiple keys to be burned have been burned into the memory; The specified operation includes: Obtain the serial number corresponding to the already burned key among the plurality of keys to be burned; when the specified operation is executed for the first time, the already burned key is the first two keys among the plurality of keys to be burned; when the specified operation is not executed for the first time, the already burned key is the one obtained when the serial number of the already burned key determined in the previous execution of the specified operation is correct and the next key has been burned. Check if the serial number corresponding to the burned key is correct; When the serial number corresponding to the burned key is correct, execute the burning operation for the next key and control the entry into the next specified operation; If the serial number corresponding to the burned key is incorrect, the control will not proceed to the next specified operation.
6. The method according to claim 4, characterized in that, The plurality of keys to be programmed are detected and verified to determine whether all of the plurality of keys to be programmed have been programmed into the memory, including: Using a programming tool, the stored data of multiple keys to be programmed in the memory library stored in the memory is exported; The stored data is compared with the original data of multiple keys to be burned; When the comparison is consistent, it is determined that all of the multiple keys to be burned have been burned into the memory.
7. The method according to claim 5, characterized in that, Obtain the serial number corresponding to the already programmed key among the multiple keys to be programmed, including: Determine the storage rules for the serial numbers corresponding to the burned keys; According to the serial number storage rules, obtain the serial number corresponding to the burned key.
8. A key programming device, characterized in that, The device includes: The determination module is used to detect the key burning trigger operation and determine the target key from multiple keys to be burned; The detection module is used to detect the target key file corresponding to the target key; A creation module is used to create arrays corresponding to the remaining keys and store them in the stack area. The remaining keys are the keys other than the target key among the multiple keys to be burned. The programming module is used to obtain the programming start address corresponding to each of the keys to be programmed. The programming start address is obtained by dividing the same memory library according to the size of the memory occupied by each key to be programmed. Based on the array corresponding to the remaining keys and the programming start address, the target key file and the remaining keys are written into the same memory.
9. A terminal 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, it implements the KEY burning method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, the computer program being used to implement the KEY burning method as described in any one of claims 1-7.
Citation Information
Patent Citations
Program burning method and device
CN109656584A
Data burning method and device, electronic equipment and storage medium
CN110928559A