Burning method and device, electronic equipment and storage medium
By combining cloud and local hardware interfaces, keys are dynamically distributed and automatically corrected when writing fails, solving the automation and security problems of existing key burning methods and realizing an efficient and secure key burning process.
Patent Information
- Application Number
- CN202511133996.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-13
- Publication Date
- 2025-12-23
AI Technical Summary
Existing key burning methods rely on physical media transmission, which carries the risk of hardware loss, cannot be automated, and the production cycle is limited by the efficiency of physical interface connections.
The key burning is achieved by combining cloud and local hardware interfaces. The target key is dynamically distributed by the cloud server and automatic correction is performed when the writing fails. The bidirectional communication mechanism of TLS1.3 encrypted transmission protocol and MQTT protocol is adopted to support the TV terminal to actively initiate key verification request during the power-on stage.
It automates the key burning process, reduces labor costs, improves the accuracy and security of burning, and ensures the validity of the keys and the stability of production.
Smart Images

Figure CN121194022A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a burning method, apparatus, electronic device and storage medium. Background Technology
[0002] With the popularization of smart TVs and the widespread application of high-definition and ultra-high-definition digital signals, there is also the risk of illegal copying and piracy. To ensure the copyright security of digital content, the binding of unique device identifiers and encryption keys ensures that protected content can only be decrypted and played on authorized devices.
[0003] However, existing key burning methods rely on physical media transmission, which has many limitations. For example, repeated plugging and unplugging of USB flash drives can easily cause hardware damage, while serial port burning requires a separate workstation and manual operation. The production cycle is limited by the efficiency of physical interface connections, making it impossible to automate the burning process.
[0004] Therefore, there is an urgent need to develop a programming method, device, electronic equipment, and storage medium to solve one or more of the aforementioned problems. Summary of the Invention
[0005] In view of this, in order to solve the above-mentioned technical problems or some of the technical problems, the present invention provides a programming method, apparatus, electronic device and storage medium.
[0006] In a first aspect, this application provides a programming method, the method comprising:
[0007] Receive a programming request, wherein the programming request carries the identification information of the device to be written;
[0008] The burning request is sent to the cloud server, so that the cloud server responds to the burning request and returns the target key corresponding to the identification information;
[0009] Write the target key to the device to be written, and detect the writing status of the target key after writing;
[0010] If the write operation fails, the target key is corrected to obtain a corrected key. The corrected key is then used as the new target key, and the step of writing the target key to the device to be written is repeated to complete the writing of the target key.
[0011] In one possible implementation, writing the target key to the device to be written includes:
[0012] Obtain the hardware attribute information of the device to be written;
[0013] The writing strategy for the target key is determined based on the hardware attribute information;
[0014] When the writing strategy is the first writing strategy, the first interface is invoked, and the target key is written to the device to be written through the first interface;
[0015] When the writing strategy is the second writing strategy, the second interface is invoked, and the target key is written to the device to be written through the second interface.
[0016] In one possible implementation, the first interface is a cloud interface, and the step of writing the target key to the device to be written through the first interface includes:
[0017] The first interface sends a write request for the target key to the cloud server, so that the cloud server responds to the write request and returns the verification result of the target key;
[0018] If the verification result is successful, a key writing command is sent to the device to be written through the first interface, so that the device to be written responds to the key writing command and writes the target key into the preset storage partition.
[0019] In one possible implementation, the second interface is a local hardware interface, and the step of writing the target key to the device to be written through the second interface includes:
[0020] The target key is stored in a preset storage medium, which is a hardware medium adapted to the second interface, and the preset storage medium is connected to the device to be written.
[0021] The second interface sends a key writing command to the device to be written, so that the device to be written responds to the key writing command, reads the target key in the preset storage medium, and writes the target key into the preset storage partition.
[0022] In one possible implementation, the key writing instruction carries the storage path of the target key in the preset storage medium. Sending the key writing instruction to the device to be written via the second interface, so that the device to be written responds to the key writing instruction, reads the target key from the preset storage medium, and writes the target key to the preset storage partition, includes:
[0023] The second interface sends a key writing command to the device to be written, so that the device to be written responds to the key writing command, reads the target key of the corresponding storage path in the preset storage medium through the second interface, and writes the target key into the preset storage partition.
[0024] In one possible implementation, before sending the burning request to the cloud server, the method further includes:
[0025] Upload the candidate key to the cloud server, and check the upload result of the candidate key after uploading;
[0026] If the upload result is an upload failure, obtain the reason for the upload failure of the candidate key, update the candidate key according to the reason for the upload failure, obtain the updated candidate key, and use the updated candidate key as the new candidate key to re-execute the step of uploading the candidate key to the cloud server;
[0027] If the upload result is successful, the candidate key is added to the key store so that the cloud server can select the target key corresponding to the identification information from the key store.
[0028] In one possible implementation, before writing the target key to the device to be written, the method further includes:
[0029] Invoke the key verification mechanism to verify the validity of the target key and obtain the verification result;
[0030] If the verification result is a verification failure, the step of sending the burning request to the cloud server is re-executed to obtain a new target key;
[0031] If the verification result is successful, the step of writing the target key to the device to be written is performed.
[0032] Secondly, this application provides a programming apparatus, comprising:
[0033] A receiving module is used to receive a programming request, wherein the programming request carries the identification information of the device to be written;
[0034] The response module is used to send the burning request to the cloud server, so that the cloud server responds to the burning request and returns the target key corresponding to the identification information;
[0035] A writing module is used to write the target key to the device to be written, and to detect the writing status of the target key after writing;
[0036] The correction module is used to perform correction processing on the target key when the write state fails, obtain the corrected key, and use the corrected key as the new target key to re-execute the step of writing the target key to the device to be written, so as to complete the writing of the target key.
[0037] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the burning method described in any embodiment of the first aspect.
[0038] Fourthly, this application also provides a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the burning method described in any embodiment of the first aspect.
[0039] Compared with the prior art, the above-mentioned technical solutions provided in this application have the following advantages: The method provided in this application combines cloud and local hardware interfaces to realize the key burning of the device to be written, avoiding the limitations of physical media transmission and reducing labor costs; and through the writing verification of the target key, it can automatically perform correction processing when the key writing fails, improving the automation of burning and ensuring the validity and security of the target key. Attached Figure Description
[0040] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0042] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0043] Figure 1 A schematic flowchart of a programming method provided in an embodiment of this application;
[0044] Figure 2 This is a schematic diagram of a target key writing process provided in an embodiment of this application;
[0045] Figure 3 A schematic diagram illustrating another process for writing the target key, provided in an embodiment of this application;
[0046] Figure 4 A schematic diagram illustrating another method for writing a target key, as provided in an embodiment of this application;
[0047] Figure 5 A schematic diagram illustrating a key upload process provided in an embodiment of this application;
[0048] Figure 6 This is a schematic diagram illustrating the steps of a programming method provided in an embodiment of this application;
[0049] Figure 7 This is a schematic diagram of a programming device provided in an embodiment of this application;
[0050] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0052] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0053] To address the limitations of existing key burning methods that rely on physical media transmission—such as the risk of hardware damage and data loss due to poor contact caused by repeated USB flash drive insertion and removal, and the requirement for dedicated workstations and manual operation for serial port burning, which limits production speed due to physical interface connection efficiency and hinders automation—this application provides a burning method, apparatus, electronic device, and storage medium. This system automates key burning and testing in the background through an automated production process, reducing manual intervention and enabling key burning to the device to be written, thus avoiding the limitations of physical media transmission. Furthermore, through target key writing verification, it automatically performs correction processing in case of key writing failure, improving the automation level of burning and ensuring the validity and security of the target key.
[0054] The programming method provided in this application is used to automate key programming and detection during the production process of televisions or display devices.
[0055] Before burning, a cloud platform is built that includes a key code (key) management subsystem, a communication protocol subsystem, and a log auditing subsystem. The TLS 1.3 encrypted transmission protocol is used to realize the distributed storage and dynamic distribution of key codes. Furthermore, based on the bidirectional communication mechanism of the MQTT protocol, the TV terminal can actively initiate a key verification request during the power-on phase.
[0056] The programming method provided in this application is implemented by a programming module integrated into a TV main control chip. An exemplary programming module includes the following units:
[0057] Production mode control unit: Distinguishes between production mode and user mode by setting flags;
[0058] Network connection unit: By listening to the network connection status, it initiates requests using okhttp and saves files using Okio (Sink);
[0059] Protocol parsing engine unit: Cloud-based command parsing that supports JSON Schema validation;
[0060] The programming control unit: implements production mode detection and key code verification mechanism to control the start of key code programming;
[0061] Status monitoring unit: Monitors the burning process through a watchdog timer and triggers an automatic rollback mechanism when an abnormality occurs.
[0062] Figure 1 This is a flowchart illustrating a programming method provided in an embodiment of this application. The method includes:
[0063] S101. Receive a burning request, wherein the burning request carries the identification information of the device to be written.
[0064] A burning request is an operation command that requests the burning of a key onto the device to be written. The identification information of the device to be written refers to the identity information used to uniquely identify the device, such as the device's serial number, MAC address, or other codes that can uniquely identify the device.
[0065] In this embodiment, the burning request contains explicit identification information of the device to be written, so that after the cloud server receives the burning request, it can accurately select the target key that matches the identification information from the key library, ensuring the correct correspondence between the key and the device, thereby ensuring the effectiveness and security of subsequent key burning and obtaining accurate key burning.
[0066] S102. Send the burning request to the cloud server so that the cloud server responds to the burning request and returns the target key corresponding to the identification information.
[0067] A cloud server is a remote server that is connected to the Internet and is capable of storing, processing, and distributing data.
[0068] In this embodiment, the target key is a pre-set access password, i.e., the key code; the cloud server, as the core of key management, is responsible for receiving the burning request from the burning device, retrieving the corresponding target key from the key library according to the device identification information to be written in the request, and then returning it to the burning device, thereby realizing dynamic distribution of the key and ensuring the real-time nature and security of the key.
[0069] S103. Write the target key to the device to be written, and detect the writing status of the target key after writing.
[0070] The target key write status is used to assess whether the key burning process was successfully completed and to ensure that the device can correctly recognize and use the key for encryption or decryption operations. It also allows for the timely detection and correction of potential errors during the burning process, thereby improving production efficiency and product quality. During the testing process, a successful write status indicates that the key burning process was completed smoothly, and the device can proceed to subsequent normal use or delivery stages. A failed write status may be due to various reasons, such as device malfunction, key mismatch, or communication errors during the burning process.
[0071] In this embodiment, after the target key is written to the device to be written by the writing module, a detection mechanism is immediately activated to conduct a comprehensive check on the key writing status, ensuring the accuracy and reliability of the key burning.
[0072] S104. If the writing status fails, perform a correction process on the target key to obtain a corrected key, and use the corrected key as the new target key to re-execute the step of writing the target key to the device to be written, so as to complete the writing of the target key.
[0073] Key correction processing includes operations such as key regeneration, format adjustment, or error correction, which are designed to resolve key writing failures.
[0074] In this embodiment, in the event of a key writing failure, the system can automatically identify and trigger a correction process. First, it analyzes the cause of the failure, which may be an incorrect key format, a device compatibility issue, or a communication failure. Then, based on the analysis results, it takes corresponding corrective measures, such as regenerating the key, adjusting the key format, or repairing the communication failure, thereby obtaining a corrected key. Finally, it uses the corrected key as the new target key, re-executes the key writing operation, and checks the writing status again until the key is successfully written to the device, ensuring smooth production and stable product quality.
[0075] Specifically, the specific method of key correction may vary depending on the reason for failure. For example, if the failure is due to the key format not meeting the device requirements, the correction process may involve adjusting the key format; if the failure is due to an error in the key itself, it may be necessary to regenerate a new key for replacement.
[0076] The programming method provided in this application can quickly identify and automatically trigger a correction process if a writing failure occurs during the programming process, without the need for manual intervention, thus reducing labor costs and improving programming efficiency. Furthermore, by combining cloud and local hardware interfaces, it not only realizes the programming of keys for the device to be written, but also greatly improves the accuracy of programming.
[0077] Figure 2 This is a schematic diagram of a target key writing process provided in an embodiment of this application, as shown below. Figure 2 As shown, writing the target key to the device to be written includes:
[0078] S201. Obtain the hardware attribute information of the device to be written.
[0079] Hardware attribute information refers to the physical characteristics and configuration parameters of a device. By obtaining the hardware attribute information of a hardware device, including but not limited to key parameters such as processor model and configuration parameters, it is possible to determine the specific writing method required by the device to be written when performing a key writing operation.
[0080] S202. Determine the writing strategy of the target key based on the hardware attribute information.
[0081] A write strategy refers to the specific method used to securely and efficiently write the target key into the device to be written.
[0082] In this embodiment, the writing strategy is selected based on the hardware attribute information of the device to be written, so as to ensure that the key writing method matches the hardware characteristics of the device and improve the compatibility and success rate of key writing.
[0083] For example, when the device can access the Internet normally, the target key will be written and stored in real time through the cloud server; when the network connection is unavailable or the signal is weak, the key will be written or stored on a local storage medium (such as a USB flash drive, external hard drive, etc.), and the data in the storage medium will be uploaded to the cloud server in real time after the network is restored.
[0084] S203. When the writing strategy is the first writing strategy, the first interface is invoked to write the target key to the device to be written through the first interface.
[0085] The first writing strategy is a cloud-based writing strategy, which uses a two-way communication mechanism between the cloud server and the device to be written to write the target key, and transmits the corresponding target key securely and efficiently to the device to be written through the first interface (which can be an interface based on the MQTT protocol or other secure communication protocols).
[0086] In this embodiment, when the writing strategy is determined to be a cloud-based writing strategy, the first interface is first invoked to establish a secure communication protocol, and then the target key is transmitted to the device to be written through the first interface.
[0087] S204. If the writing strategy is the second writing strategy, call the second interface and write the target key to the device to be written through the second interface.
[0088] The second writing strategy is the local writing strategy, which means that when the device to be written cannot be connected to the network or the network connection is unstable, the key is written using a local storage medium (such as a USB flash drive or serial port).
[0089] In this embodiment, when the write policy is determined to be a local write policy, the second interface is first called, and then the target key is securely written to the local storage medium through the second interface.
[0090] The target key writing method provided in this application embodiment not only meets the hardware requirements of different devices by flexibly selecting cloud or local writing strategies, but also improves the flexibility and adaptability of key writing. Under the cloud writing strategy, the powerful computing power and storage resources of the cloud server can be used to efficiently process the key writing requests of the device, while ensuring the security and real-time performance of the key. Under the local writing strategy, even when the network is unstable or unable to connect, the key can be written through the local storage medium, ensuring the continuity and stability of production. This method not only ensures the security of key writing, but also improves the flexibility of key writing, and can adapt to the production needs of different network environments.
[0091] Figure 3 This is a schematic diagram of another target key writing process provided in an embodiment of this application, as shown below. Figure 3 As shown, writing the target key to the device to be written through the first interface includes:
[0092] S301. Send a write request for the target key to the cloud server through the first interface, so that the cloud server responds to the write request and returns the verification result of the target key.
[0093] The verification result of the target key is used to verify the correctness and validity of the target key, ensuring that the key has not been tampered with or damaged before being written to the device, thereby ensuring the security and stability of the device.
[0094] In this embodiment, after receiving a write request, the cloud server verifies the validity of the target key, including key format verification, permission verification, and interaction verification with other components, and returns the verification result.
[0095] S302. If the verification result is successful, a key writing instruction is sent to the device to be written through the first interface, so that the device to be written responds to the key writing instruction and writes the target key into the preset storage partition.
[0096] A preset storage partition refers to a secure area within the device used to store keys. Writing the target key to the preset storage partition ensures the security and confidentiality of the key, preventing unauthorized access or tampering.
[0097] In this embodiment, when the verification result returned by the cloud server indicates that the target key is correct and valid, a key writing instruction is sent to the device to be written through the first interface. After receiving the instruction, the device writes it to the preset storage partition, thus completing the key burning process.
[0098] In addition, if the verification result is unsuccessful, a new target key will be generated or obtained and verified again until the verification is successful, so as to ensure the accuracy and reliability of the key burned into the device.
[0099] For example, taking the target key as the key, when entering the "cloud key burning" operation, the device to be processed needs to be accurately placed on the designated detection station. After the device is placed in place, it is checked and confirmed that the device has successfully connected to the network and maintains a stable network connection. When the device is under normal network conditions, the key burning program is automatically started, and the entire key burning process is completed through intelligent cloud services. This automated operation mode completely avoids the cumbersome steps of manual intervention in the burning process in the traditional method, which not only significantly improves work efficiency, but also effectively reduces the risk of various errors that may be caused by human operation, ensuring the security and reliability of the key burning process.
[0100] The target key writing method provided in this application embodiment first submits the key to the cloud server for verification when writing the key through the first interface. After the verification is successful, the key writing command is securely sent to the device to be written. The device then responds to this command and writes the key to the preset storage partition. This not only ensures the accuracy and reliability of the key, but also avoids the device from malfunctioning or security vulnerabilities caused by incorrect keys, thus providing a strong guarantee for the normal operation of the device.
[0101] Figure 4 This is a schematic diagram illustrating another method for writing a target key, as provided in the embodiments of this application. Figure 4As shown, the second interface is a local hardware interface. The step of writing the target key to the device to be written via the second interface includes:
[0102] S401. Store the target key in a preset storage medium, wherein the preset storage medium is a hardware medium adapted to the second interface, and the preset storage medium is connected to the device to be written.
[0103] Preset storage media refers to hardware media used to store the target key, such as USB flash drives, SD cards, or serial ports. These storage media have a physical connection with the device to be written to or are connected through a specific communication protocol, enabling data transmission and storage.
[0104] In this embodiment, when the writing strategy is determined to be a local writing strategy, the target key is first stored in a preset storage medium through the second interface to ensure that the data can be written correctly and efficiently.
[0105] S402. Send a key writing instruction to the device to be written through the second interface, so that the device to be written responds to the key writing instruction, reads the target key in the preset storage medium, and writes the target key into the preset storage partition.
[0106] In this embodiment, after receiving the key writing instruction, the device to be written will read the target key in the preset storage medium through the second interface, and then write the target key into the preset storage partition to ensure the reliability and stability of key burning.
[0107] For example, first, perform the "Export key code from server" operation step, and completely export the encrypted key code stored on the server through a dedicated interface or USB flash drive. During the export process, ensure the integrity and security of the key code data to avoid data loss or corruption during transmission. After export, properly save the obtained key code file to a specified storage medium. These media can be mobile storage devices such as USB flash drives or SD cards, or dedicated burning tools that support serial communication. When storing, pay attention to selecting an appropriate data format to ensure that subsequent devices can correctly recognize it. After storage, connect the storage device containing the key code to the target device through a standard interface, select the "Burning Key Station" function module on the device, and follow the detailed operating specifications provided by the device manufacturer to complete the key code writing and verification process step by step to ensure that the burning operation is accurate and error-free.
[0108] It should be noted that special attention should be paid to the order of operations and the setting of key parameters throughout the entire burning process to avoid burning failure or device damage due to operational errors.
[0109] The target key writing method provided in this application embodiment, under a local writing strategy, achieves secure key transmission and storage through a physical connection between a preset storage medium and the target device or a specific communication protocol. The preset storage medium acts as a relay station for key transmission, which not only improves the flexibility of key transmission but also ensures the continuity and stability of the key writing process in the event of network instability or inability to connect to the network. At the same time, a key writing command is sent to the device to be written through a second interface. The device can respond to the command, accurately read the target key in the preset storage medium, and write it into the preset storage partition, thereby completing the key burning process. This not only improves the efficiency and success rate of key writing but also ensures the security and confidentiality of the key, providing a strong guarantee for the normal operation of the device.
[0110] In an optional embodiment of the present invention, the key writing instruction carries the storage path of the target key in the preset storage medium. The step of sending the key writing instruction to the device to be written via the second interface, so that the device to be written responds to the key writing instruction, reads the target key from the preset storage medium, and writes the target key to the preset storage partition, includes:
[0111] The second interface sends a key writing command to the device to be written, so that the device to be written responds to the key writing command, reads the target key of the corresponding storage path in the preset storage medium through the second interface, and writes the target key into the preset storage partition.
[0112] In this embodiment, the key writing instruction carries the specific storage path of the target key in the preset storage medium. After receiving the key writing instruction, the device to be written will directly locate the target key stored in the preset storage medium according to the storage path provided in the instruction, and then read the target key through the second interface and write it into the preset storage partition of the device to be written, thereby completing the entire key burning process.
[0113] Because the key writing instruction contains detailed storage path information, the device does not need to perform additional search or identification operations when reading the key, thereby speeding up the key writing process and improving production efficiency.
[0114] Figure 5 This is a schematic diagram of a key upload process provided in an embodiment of this application, such as... Figure 5 As shown, before sending the burning request to the cloud server, the method further includes:
[0115] S501. Upload the candidate key to the cloud server, and check the upload result of the candidate key after uploading.
[0116] Candidate keys are keys to be uploaded. They can be the original keys provided by the device manufacturer or keys that have been encrypted or processed using a specific algorithm.
[0117] In this embodiment, the candidate key first needs to be uploaded to the cloud server for subsequent key verification, allocation and management operations; and after the upload is completed, the upload result of the candidate key is checked to ensure that the key has been successfully uploaded to the cloud server and the data is complete and undamaged.
[0118] S502. If the upload result is an upload failure, obtain the reason for the upload failure of the candidate key, update the candidate key according to the reason for the upload failure, obtain the updated candidate key, and use the updated candidate key as the new candidate key to re-execute the step of uploading the candidate key to the cloud server.
[0119] In this embodiment, if the candidate key upload fails, it may be due to reasons such as network instability, incorrect key format, or cloud server failure. In this case, the specific reason for the upload failure is obtained, and corresponding measures are taken. The updated candidate key is used as the new candidate key, and the upload operation is re-executed until the upload is successful. This ensures that the candidate key can be successfully uploaded to the cloud server, providing a foundation for subsequent key verification, allocation, and management operations. Simultaneously, it improves the reliability and stability of the entire key management process.
[0120] For example, if the upload fails, the server will display a message with common reasons for failure and how to resolve them:
[0121] If you receive the message "The compressed file is empty": Prepare a new compressed file containing valid candidate keys and upload it again.
[0122] The message "File name is not compliant" appears: Modify the file name according to the specified format and re-upload.
[0123] The message "Incorrect file format" appears: Adjust the file format to meet the requirements and upload again.
[0124] If the message "File already uploaded" appears, please check if it is a duplicate operation. If an update is needed, prepare and upload the file again following the correct procedure.
[0125] For example, if an upload fails, the server will display a message with common reasons for failure and solutions. Below are some common upload failure scenarios and corresponding handling suggestions:
[0126] 1. When the system prompts "The compressed file is empty": This usually means that the uploaded compressed file does not contain any valid data files. Check the contents of the compressed file again to ensure that it contains a candidate key file that meets the requirements, then prepare a complete compressed file again and try the upload operation again.
[0127] 2. When the system prompts "File name is not compliant": This usually means that the file name currently being used does not conform to the system's naming conventions. It is necessary to modify and adjust the file name to ensure that it fully complies with the format requirements before re-uploading.
[0128] 3. When the system prompts "Incorrect upload format": This usually means that the submitted file format is inconsistent with the system's required format standard. You need to convert the current file to a format that meets the requirements, or regenerate the file in the correct format and try uploading it again.
[0129] 4. When the system prompts "File has been uploaded": This usually means that the upload was caused by a duplicate upload operation. You need to perform the file update process, prepare a complete update file package again, and complete the upload operation through the correct update channel.
[0130] S503. If the upload result is successful, the candidate key is added to the key library so that the cloud server can select the target key corresponding to the identification information from the key library.
[0131] A key store is a secure area that centrally stores and manages keys. It contains a large number of candidate keys and target keys. The keys in the key store are classified and identified according to specific rules so that the cloud server can quickly and accurately select the target key for the corresponding device or application. In addition, each key in the key store is associated with a unique identifier, which can be the device's serial number, model, manufacturer information, or other identifiers that can uniquely identify the device.
[0132] In this embodiment, after a candidate key is successfully uploaded to the cloud server, it is added to the key store. When the cloud server needs to assign a key to a device, it searches for the corresponding target key in the key store based on the device's identification information and sends it to the device for programming.
[0133] It should be noted that during the key management process, the candidate key selection mechanism can perform the key selection operation by establishing a correspondence between the unique identifier of the candidate key and the device identifier. This correspondence can be stored in the database of the key management system for easy querying and matching.
[0134] Furthermore, if there is no candidate key identifier matching the target device identifier in the currently available candidate key pool, a suitable target key will be randomly selected from the unallocated candidate key set or selected according to a specific algorithm. After selecting the key, the identification information corresponding to the target device will be added to the key to establish a new correspondence. This ensures both the efficiency of key allocation and the integrity and traceability of the correspondence between the key and the device.
[0135] The key upload method provided in this application uploads candidate keys to a cloud server and adds them to a key repository after successful upload, achieving centralized key management and efficient key allocation. During the key upload process, if an upload fails, the reason for the failure can be quickly obtained, and the candidate keys can be updated until the upload is successful, ensuring the continuity and stability of key management. Furthermore, by establishing a correspondence between candidate keys and device identifiers, accurate key selection and allocation are achieved, improving the efficiency of key allocation and ensuring the accuracy and traceability of the correspondence between keys and devices.
[0136] In an optional embodiment of the present invention, before writing the target key to the device to be written, the method further includes: calling a key verification mechanism to verify the validity of the target key and obtaining a verification result; if the verification result is a verification failure, re-executing the step of sending the burning request to the cloud server to obtain a new target key; and if the verification result is a verification success, performing the step of writing the target key to the device to be written.
[0137] Key verification mechanisms are verification processes used to ensure the accuracy and security of keys. They can perform a comprehensive and rigorous check on the key before it is written to the device, thereby effectively preventing incorrect or corrupted keys from being written and thus affecting the normal operation or security of the device.
[0138] In this embodiment, before writing the target key to the device, a key verification mechanism is invoked to verify the target key, ensuring its accuracy, validity, and security, thereby avoiding any potential security risks or device malfunctions. If the key verification mechanism returns a failure result, indicating that the target key has some defect or does not meet the expected requirements, the key writing operation is paused, and a process to reacquire the target key is automatically triggered. The burning request is sent to the cloud server again, requesting the cloud server to regenerate or allocate a new target key, until a target key that fully meets the requirements is obtained. If the key verification mechanism passes the verification, the subsequent steps of key writing continue, and the verified target key is securely written to the preset storage partition of the device. This not only enhances the rigor of key management but also further improves the security and reliability of key writing, ensuring the smooth progress of the entire burning process.
[0139] Figure 6 This is a schematic diagram illustrating the steps of a programming method provided in an embodiment of this application, as shown below. Figure 6 As shown, taking a key code as an example, the burning method mainly includes the following steps:
[0140] Step 1: Preliminary Preparations
[0141] Prepare mass production order key codes, ensuring the key code information is accurate and complete, to lay the foundation for subsequent uploading and production processes.
[0142] Step 2: Upload key code
[0143] Perform the "Upload key code to server" operation to upload the prepared key code file.
[0144] If the upload fails, the server will display a message with common reasons for failure and solutions:
[0145] If you receive the message "The compressed file is empty": Prepare a new compressed file with a valid key and upload it again.
[0146] The message "File name is not compliant" appears: Modify the file name according to the specified format and re-upload.
[0147] The message "Incorrect file format" appears: Adjust the file format to meet the requirements and upload again.
[0148] If the message "File already uploaded" appears, please check if it is a duplicate operation. If an update is needed, prepare and upload the file again following the correct procedure.
[0149] If the upload is successful, the server will load and display the key code information, and simultaneously trigger an email notification. Relevant personnel can view the key code upload result and basic information via email.
[0150] Step 3: Production Preparation and Selection of Programming Method
[0151] After the key code is uploaded and a notification is received, the process enters the "Prepare for Production" stage. Select the burning method based on actual needs:
[0152] (I) Cloud-based key burning (select "Yes" path)
[0153] Entering the "cloud-based key burning" stage, place the device in the testing station and ensure it is connected to the internet. With the network connected, the background process automatically completes the key burning operation, requiring no manual intervention, making it highly efficient and reducing human error.
[0154] (II) Burning key via USB flash drive / serial port (select "No" path)
[0155] First, perform the "Export key code from server" operation to export the key code from the server and save it to a storage medium that can be used for USB flash drive or serial port programming.
[0156] Connect the carrier containing the key code to the corresponding device, and burn the key at the "key burning station" according to the device operation specifications to complete the burning process.
[0157] Step 4: Production Inspection and Anomaly Handling
[0158] After the key burning operation is completed, proceed to the "Production Inspection Key Code Status" stage:
[0159] If the detection status is "OK", the key burning process is successfully completed, and the product can enter the subsequent normal production or delivery stage.
[0160] If the detection status is "NG", perform the "Manually burn key code in factory menu" operation. Manual intervention is required to re-burn the key code, correct the abnormality, and then test again until the status is normal.
[0161] Figure 7 This is a schematic diagram of a programming device provided in an embodiment of this application, as shown below. Figure 7 As shown, the device specifically includes:
[0162] The receiving module 701 is used to receive a burning request, wherein the burning request carries the identification information of the device to be written;
[0163] Response module 702 is used to send the burning request to the cloud server, so that the cloud server responds to the burning request and returns the target key corresponding to the identification information;
[0164] The writing module 703 is used to write the target key to the device to be written, and to detect the writing status of the target key after writing;
[0165] The correction module 704 is used to perform correction processing on the target key when the write state fails, obtain the corrected key, and use the corrected key as the new target key to re-execute the step of writing the target key to the device to be written, so as to complete the writing of the target key.
[0166] In one possible implementation, the writing module 703 is further configured to acquire hardware attribute information of the device to be written; determine the writing strategy of the target key based on the hardware attribute information; if the writing strategy is a first writing strategy, call a first interface to write the target key to the device to be written through the first interface; if the writing strategy is a second writing strategy, call a second interface to write the target key to the device to be written through the second interface.
[0167] In one possible implementation, the writing module 703 is further configured to send a write request for the target key to the cloud server through the first interface, so that the cloud server responds to the write request and returns a verification result of the target key; if the verification result is successful, the module sends a key write instruction to the device to be written through the first interface, so that the device to be written responds to the key write instruction and writes the target key to a preset storage partition.
[0168] In one possible implementation, the writing module 703 is further configured to store the target key to a preset storage medium, the preset storage medium being a hardware medium adapted to the second interface, the preset storage medium being connected to the device to be written; and to send a key writing instruction to the device to be written through the second interface, so that the device to be written responds to the key writing instruction, reads the target key in the preset storage medium, and writes the target key to a preset storage partition.
[0169] In one possible implementation, the writing module 703 is further configured to send a key writing instruction to the device to be written through the second interface, so that the device to be written responds to the key writing instruction, reads the target key of the corresponding storage path in the preset storage carrier through the second interface, and writes the target key into the preset storage partition.
[0170] In one possible implementation, the response module 702 is further configured to upload the candidate key to the cloud server and detect the upload result of the candidate key after uploading; if the upload result is an upload failure, obtain the reason for the upload failure of the candidate key, update the candidate key according to the reason for the upload failure, obtain the updated candidate key, and use the updated candidate key as the new candidate key to re-execute the step of uploading the candidate key to the cloud server; if the upload result is a successful upload, add the candidate key to the key library, so that the cloud server selects the target key corresponding to the identification information from the key library.
[0171] In one possible implementation, the device includes a verification module 705 (not shown in the figure) for invoking a key verification mechanism to verify the validity of the target key and obtain a verification result; if the verification result is a verification failure, the step of sending the burning request to the cloud server is re-executed to obtain a new target key; if the verification result is a verification success, the step of writing the target key to the device to be written is executed.
[0172] The programming device provided in this embodiment can be as follows: Figure 7 The programming device shown can perform the following: Figure 1-6 All steps of the programming process are completed, thereby achieving... Figure 1-6 For details on the technical effects of the burning process, please refer to [the documentation / reference]. Figure 1-6 The relevant descriptions are presented concisely and will not be elaborated upon here.
[0173] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0174] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 8 As shown, this application provides an electronic device including a processor 801, a communication interface 802, a memory 803, and a communication bus 804. The processor 801, communication interface 802, and memory 803 communicate with each other via the communication bus 804. The memory 803 stores computer programs. When the processor 801 executes the program stored in the memory 803, it implements the burning steps provided in any of the aforementioned method embodiments.
[0175] A programming request is received, the programming request carrying the identification information of the device to be written; the programming request is sent to the cloud server, so that the cloud server responds to the programming request and returns the target key corresponding to the identification information; the target key is written to the device to be written, and the writing status of the target key is detected after writing; if the writing status fails, the target key is corrected to obtain a corrected key, and the corrected key is used as the new target key, and the step of writing the target key to the device to be written is re-executed to complete the writing of the target key.
[0176] In one possible implementation, hardware attribute information of the device to be written is obtained; a writing strategy for the target key is determined based on the hardware attribute information; if the writing strategy is a first writing strategy, a first interface is invoked to write the target key to the device to be written through the first interface; if the writing strategy is a second writing strategy, a second interface is invoked to write the target key to the device to be written through the second interface.
[0177] In one possible implementation, a write request for the target key is sent to the cloud server through the first interface, so that the cloud server responds to the write request and returns a verification result for the target key; if the verification result is successful, a key write instruction is sent to the device to be written through the first interface, so that the device to be written responds to the key write instruction and writes the target key to a preset storage partition.
[0178] In one possible implementation, the target key is stored in a preset storage medium, which is a hardware medium adapted to the second interface, and the preset storage medium is connected to the device to be written to; a key writing command is sent to the device to be written to through the second interface, so that the device to be written to respond to the key writing command, read the target key in the preset storage medium, and write the target key into a preset storage partition.
[0179] In one possible implementation, a key writing instruction is sent to the device to be written through the second interface, so that the device to be written responds to the key writing instruction, reads the target key corresponding to the storage path in the preset storage carrier through the second interface, and writes the target key into the preset storage partition.
[0180] In one possible implementation, the candidate key is uploaded to a cloud server, and the upload result is detected after the upload. If the upload result is a failure, the reason for the upload failure is obtained, and the candidate key is updated according to the reason for the upload failure to obtain an updated candidate key. The updated candidate key is then used as the new candidate key, and the step of uploading the candidate key to the cloud server is executed again. If the upload result is a success, the candidate key is added to the key store, so that the cloud server can select the target key corresponding to the identification information from the key store.
[0181] In one possible implementation, a key verification mechanism is invoked to verify the validity of the target key and obtain a verification result; if the verification result is a verification failure, the step of sending the burning request to the cloud server is re-executed to obtain a new target key; if the verification result is a verification success, the step of writing the target key to the device to be written is executed.
[0182] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0183] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.
[0184] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A programming method, characterized in that, include: Receive a programming request, wherein the programming request carries the identification information of the device to be written; The burning request is sent to the cloud server, so that the cloud server responds to the burning request and returns the target key corresponding to the identification information; Write the target key to the device to be written, and detect the writing status of the target key after writing; If the write operation fails, the target key is corrected to obtain a corrected key. The corrected key is then used as the new target key, and the step of writing the target key to the device to be written is repeated to complete the writing of the target key.
2. The method according to claim 1, characterized in that, The step of writing the target key to the device to be written includes: Obtain the hardware attribute information of the device to be written; The writing strategy for the target key is determined based on the hardware attribute information; When the writing strategy is the first writing strategy, the first interface is invoked, and the target key is written to the device to be written through the first interface; When the writing strategy is the second writing strategy, the second interface is invoked, and the target key is written to the device to be written through the second interface.
3. The method according to claim 2, characterized in that, The first interface is a cloud interface, and the step of writing the target key to the device to be written through the first interface includes: The first interface sends a write request for the target key to the cloud server, so that the cloud server responds to the write request and returns the verification result of the target key; If the verification result is successful, a key writing command is sent to the device to be written through the first interface, so that the device to be written responds to the key writing command and writes the target key into the preset storage partition.
4. The method according to claim 2, characterized in that, The second interface is a local hardware interface. Writing the target key to the device to be written via the second interface includes: The target key is stored in a preset storage medium, which is a hardware medium adapted to the second interface, and the preset storage medium is connected to the device to be written. The second interface sends a key writing command to the device to be written, so that the device to be written responds to the key writing command, reads the target key in the preset storage medium, and writes the target key into the preset storage partition.
5. The method according to claim 4, characterized in that, The key writing instruction carries the storage path of the target key in the preset storage medium. Sending the key writing instruction to the device to be written via the second interface, so that the device to be written responds to the key writing instruction, reads the target key from the preset storage medium, and writes the target key to the preset storage partition, includes: The second interface sends a key writing command to the device to be written, so that the device to be written responds to the key writing command, reads the target key of the corresponding storage path in the preset storage medium through the second interface, and writes the target key into the preset storage partition.
6. The method according to claim 1, characterized in that, Before sending the burning request to the cloud server, the method further includes: Upload the candidate key to the cloud server, and check the upload result of the candidate key after uploading; If the upload result is an upload failure, obtain the reason for the upload failure of the candidate key, update the candidate key according to the reason for the upload failure, obtain the updated candidate key, and use the updated candidate key as the new candidate key to re-execute the step of uploading the candidate key to the cloud server; If the upload result is successful, the candidate key is added to the key store so that the cloud server can select the target key corresponding to the identification information from the key store.
7. The method according to claim 1, characterized in that, Before writing the target key to the device to be written, the method further includes: Invoke the key verification mechanism to verify the validity of the target key and obtain the verification result; If the verification result is a verification failure, the step of sending the burning request to the cloud server is re-executed to obtain a new target key; If the verification result is successful, the step of writing the target key to the device to be written is performed.
8. A programming device, characterized in that, include: A receiving module is used to receive a programming request, wherein the programming request carries the identification information of the device to be written; The response module is used to send the burning request to the cloud server, so that the cloud server responds to the burning request and returns the target key corresponding to the identification information; A writing module is used to write the target key to the device to be written, and to detect the writing status of the target key after writing; The correction module is used to perform correction processing on the target key when the write state fails, obtain the corrected key, and use the corrected key as the new target key to re-execute the step of writing the target key to the device to be written, so as to complete the writing of the target key.
9. An electronic 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 steps of the burning method according to any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the burning method according to any one of claims 1 to 7.