Method, apparatus and embedded system for data write for embedded systems

CN117744160BActive Publication Date: 2026-10-30BEIJING TONGFANG MICROELECTRONICS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311861418.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2026-10-30
Estimated Expiration
2043-12-29

AI Technical Summary

Technical Problem

这样,需要嵌入式系统执行多条写入指令才能将个性数据写入安全单元,导致个性数据的写入效率依旧较低

Benefits of technology

[0017]通过一条写入指令就能实现将个性数据写入空闲数据区。同时,由于第一校验数据表示预设格式的个性数据,因此,在将个性数据写入空闲数据区前,还通过确定第一校验数据的有效性以确定个性数据的有效性,以将有效的个性数据写入空闲数据区,避免写入无效数据,提高了个性数据的写入效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117744160B_ABST
    Figure CN117744160B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of embedded development, and discloses a data writing method of an embedded system, the embedded system comprising a security unit, the security unit comprising a free data area configured to store data; the method comprises the following steps: obtaining first check data corresponding to individual data, wherein the first check data represents individual data in a preset format; writing the first check data into the free data area; in response to a write instruction for writing the individual data, determining the validity of the first check data; and in the case that the first check data is valid data, writing the individual data into the free data area. The effective individual data can be written into the free data area through one write instruction, and the writing efficiency of the individual data is improved. The application further discloses a data writing device for the embedded system and an embedded system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of embedded development technology, and for example to a method, apparatus and embedded system for writing data to an embedded system. Background Technology

[0002] Currently, the large variety and quantity of personalized data in embedded software leads to low efficiency in writing this data. Related technologies write personalized data one line at a time using multiple standard instructions, or one line at a time using multiple custom proprietary instructions. However, regardless of whether multiple standard or proprietary instructions are used, the writing of personalized data is achieved through multiple write instructions. Multiple write instructions require the embedded system to continuously receive write instructions and then write the personalized data according to those instructions. Thus, the embedded system needs to execute multiple write instructions to write the personalized data to the secure cell, resulting in persistently low efficiency in writing personalized data.

[0003] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0004] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or describe the scope of protection of these embodiments, but rather as a prelude to the detailed description that follows.

[0005] This disclosure provides a method, apparatus, and embedded system for writing data to an embedded system. Personalized data can be written to a free data area using a single write instruction. Furthermore, since the first verification data represents personalized data in a preset format, the validity of the personalized data is determined before writing it to the free data area, thus improving the efficiency of personalized data writing.

[0006] In some embodiments, the embedded system includes a security element, the security element including a free data area configured to store data; a method for writing data to the embedded system includes: obtaining first verification data corresponding to personalized data, wherein the first verification data represents personalized data in a preset format; writing the first verification data to the free data area; determining the validity of the first verification data in response to a write instruction for writing personalized data; and writing the personalized data to the free data area if the first verification data is valid.

[0007] Optionally, determining the validity of the first verification data includes: parsing the first verification data to obtain second verification data; and determining the validity of the first verification data based on the second verification data.

[0008] Optionally, parsing the first verification data to obtain the second verification data includes: obtaining the address of the first verification data; and parsing the first verification data according to the address of the first verification data to obtain the second verification data.

[0009] Optionally, determining the validity of the first verification data based on the second verification data includes: determining the first verification data as valid data if the second verification data includes integrity verification data, personal data, correctness verification data, and an end marker; wherein the integrity verification data is used to verify the integrity of the personal data, the correctness verification data is used to verify the correctness of the personal data, and the end marker is used to indicate the end position of the personal data; and / or determining the first verification data as invalid data if the second verification data lacks one or more of the integrity verification data, personal data, correctness verification data, and an end marker.

[0010] Optionally, the method for writing data to an embedded system further includes: if the first verification data is invalid, determining not to write the individual data to the free data area.

[0011] Optionally, after writing the personalized data into the free data area, the method further includes: in response to a verification instruction for verifying the personalized data, verifying the personalized data based on the first verification data to determine the correctness of the personalized data.

[0012] Optionally, after verifying the personalized data based on the first verification data, the method further includes: clearing the first verification data in the free area.

[0013] In some embodiments, an apparatus for writing data to an embedded system includes: an acquisition module configured to acquire first verification data corresponding to personalized data, wherein the first verification data represents personalized data in a preset format; a first writing module configured to write the first verification data to a free data area; a determination module configured to determine the validity of the first verification data in response to a write instruction for writing personalized data; and a second writing module configured to write the personalized data to the free data area if the first verification data is valid.

[0014] In some embodiments, the means for writing data to an embedded system includes a processor and a memory storing program instructions, the processor being configured to execute the method for writing data to an embedded system as described above when the program instructions are executed.

[0015] In some embodiments, the embedded system includes: a chip body including a security element, the security element including a free data area configured to store data; and, as described above, means for writing data to an embedded system, mounted on the chip body.

[0016] The method, apparatus, and embedded system for writing data to an embedded system provided in this disclosure can achieve the following technical effects:

[0017] Personalized data can be written to the free data area with a single write command. Furthermore, since the first verification data represents personalized data in a preset format, the validity of the personalized data is determined before writing it to the free data area. This ensures that only valid personalized data is written to the free data area, avoiding the writing of invalid data and improving the efficiency of personalized data writing.

[0018] The above general description and the description below are exemplary and illustrative only and are not intended to limit this application. Attached Figure Description

[0019] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations and drawings do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are shown as similar elements. The drawings are not to be scaled. And wherein:

[0020] Figure 1 This is a schematic diagram of an embedded system provided in an embodiment of this disclosure;

[0021] Figure 2 This is a schematic diagram of a method for writing data to an embedded system provided in an embodiment of this disclosure;

[0022] Figure 3 This is a schematic diagram of another method for writing data to an embedded system provided in an embodiment of this disclosure;

[0023] Figure 4 This is a schematic diagram of another method for writing data to an embedded system provided in an embodiment of this disclosure;

[0024] Figure 5 This is a schematic diagram of another method for writing data to an embedded system provided in an embodiment of this disclosure;

[0025] Figure 6 This is a schematic diagram of a data writing device for an embedded system provided in an embodiment of this disclosure;

[0026] Figure 7 This is a schematic diagram of another device for writing data to an embedded system provided in an embodiment of this disclosure. Detailed Implementation

[0027] To provide a more detailed understanding of the features and technical content of the embodiments of this disclosure, the implementation of the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for illustrative purposes only and are not intended to limit the embodiments of this disclosure. In the following technical description, for ease of explanation, several details are used to provide a full understanding of the disclosed embodiments. However, one or more embodiments may still be implemented without these details. In other cases, well-known structures and devices may be simplified in their depiction to simplify the drawings.

[0028] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this disclosure described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.

[0029] Unless otherwise stated, the term "multiple" means two or more.

[0030] In this embodiment of the disclosure, the character " / " indicates that the objects before and after it are in an "or" relationship. For example, A / B means: A or B.

[0031] The term "and / or" describes an association between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or A and B.

[0032] The term "correspondence" can refer to an association or binding relationship. The correspondence between A and B means that there is an association or binding relationship between A and B.

[0033] It should be noted that, unless otherwise specified, the embodiments and features described in the present disclosure can be combined with each other.

[0034] Related technologies typically write personalized data one line at a time using multiple standard instructions, or one line at a time using multiple custom proprietary instructions. However, regardless of whether multiple standard or proprietary instructions are used, the writing of personalized data is achieved through multiple write instructions. Multiple write instructions require the embedded system to continuously receive write instructions and then write the personalized data according to those instructions. This means the embedded system needs to execute multiple write instructions to write the personalized data to the secure cell, resulting in relatively low efficiency in writing personalized data.

[0035] In view of this, the present disclosure provides a method for writing data to an embedded system. This method can write personalized data to a free data area with a single write instruction. Furthermore, since the first verification data represents personalized data in a preset format, the validity of the personalized data is determined by verifying the validity of the first verification data before writing the personalized data to the free data area, thereby improving the efficiency of personalized data writing.

[0036] For example, the method for writing data to an embedded system can be applied to the process of embedded chip manufacturing.

[0037] Figure 1 This disclosure provides an embedded system 1. The embedded system 1 includes a chip body 10 and embedded software. The embedded software runs on the chip body 10, which is the core hardware component of the embedded system 1, providing the runtime environment for the embedded software. The chip body 10 includes a processor, which executes the instructions of the embedded software to implement various functions of the embedded system 1. A secure element (SE) 100 is embedded in a secure area of ​​the chip body 10. The secure element 100 includes a free data area 1001, which is configured to store data. Simultaneously, the secure element 100 provides security services and support for the embedded software, ensuring the security of sensitive information and operations. In the embedded system 1, the secure element 100 is commonly used to protect critical data (such as passwords, certificates, keys, etc.) and perform security-related operations, such as identity authentication and payment transactions.

[0038] For example, the chip body 10 is an embedded chip.

[0039] Optionally, the free data area 1001 includes erasable and writable storage space. It is understood that the stored data in the erasable and writable storage space can be erased.

[0040] Optionally, the security unit 100 also includes a code area and a valid data area. It is understood that personalized data and first check data cannot be written to the code area or the valid data area to avoid corrupting the valid data in either area.

[0041] Optionally, the security unit 100 also includes a security interface configured to write first verification data into the free data area 1001 via the security interface. Exemplarily, the processor security interface sends a write command or calls a corresponding API function to write the prepared first verification data into the free data area 1001.

[0042] Optionally, the embedded software includes a calling interface for writing and verifying personalized data. This enables the processor to execute write instructions to write personalized data to the free data area 1001, and / or execute verification instructions to verify the personalized data written to the free data area 1001, via this calling interface.

[0043] Combination Figure 1 The embedded system shown in this disclosure provides a method for writing data to an embedded system. The execution entity of this method can be a processor. For example... Figure 2 As shown, the method includes:

[0044] S201, the processor obtains the first verification data corresponding to the personalized data.

[0045] The first verification data represents personalized data in a preset format. For example, the preset format could be BerTLV format. Specifically, the first verification data represents personalized data in BerTLV format.

[0046] For example, the processor obtains the first verification data corresponding to the personalized data from the embedded system. It is understood that the step of generating the first verification data from the personalized data is completed outside the embedded system. In this embodiment of the present disclosure, the first verification data is directly obtained after it has been generated.

[0047] For example, personalized data includes, but is not limited to, one or more of the following: keys, event serial numbers, and passwords required by the embedded system.

[0048] S202, the processor writes the first check data into the free data area.

[0049] For example, the processor writes the first check data into the erasable memory space of the free data area. This allows the first check data to be cleared after it is used up, preventing it from occupying the free data area and improving the utilization rate of the free data area.

[0050] S203, the processor responds to the write instruction for writing personalized data and determines the validity of the first verification data.

[0051] It should be noted that the write command for writing personalized data is a single command.

[0052] It is understandable that, since the first verification data is personalized data in a preset format, i.e., it is converted from personalized data, the validity of the personalized data can be determined by determining the validity of the first verification data. For example, if the first verification data is valid, the personalized data is determined to be valid. If the first verification data is invalid, the personalized data is determined to be invalid.

[0053] S204, if the processor finds the first verification data to be valid, it writes the individual data into the free data area.

[0054] The data writing method for embedded systems provided in this disclosure allows personalized data to be written to the free data area with a single write instruction. Furthermore, since the first verification data represents personalized data in a preset format, the validity of the personalized data is determined before writing it to the free data area. This ensures that only valid personalized data is written to the free data area, avoiding the writing of invalid data and improving the efficiency of personalized data writing.

[0055] Optionally, the processor determines the validity of the first verification data by: parsing the first verification data to obtain second verification data; and then determining the validity of the first verification data based on the second verification data.

[0056] In this disclosed embodiment, since personalized data may be tampered with, damaged, or experience problems during transmission, resulting in inconsistencies between the personalized data and the expected personalized data, the validity of the personalized data must be determined before writing it. This avoids writing invalid personalized data to the idle data area, which would lead to low efficiency in writing personalized data or render the written personalized data unusable. This further improves the efficiency of writing personalized data and initially increases the utilization rate of the written personalized data.

[0057] Optionally, the processor parses the first check data to obtain the second check data, including: the processor obtaining the address of the first check data; and the processor parsing the first check data based on the address of the first check data to obtain the second check data.

[0058] For example, obtaining the address of the first verification data includes: obtaining the memory address of the first verification data through a pointer to a variable or an index of an array.

[0059] For example, parsing the first check data based on its address to obtain the second check data includes: accessing the first check data at that memory address via a memory access instruction; and parsing the first check data using a corresponding parsing algorithm or library function based on its format and structure to obtain the second check data.

[0060] In this disclosed embodiment, the address of the first verification data is obtained, the first verification data is parsed, and then the second verification data is generated. This can determine the validity of the personalized data, that is, whether it has been tampered with, damaged or otherwise problematic during transmission or conversion, so that the valid personalized data can be written into the free data area in the future, thereby improving the writing efficiency of the personalized data.

[0061] Optionally, the processor determines the validity of the first verification data based on the second verification data by: determining the first verification data as valid data if the second verification data includes integrity verification data, individual data, correctness verification data, and an end marker; and / or determining the first verification data as invalid data if the second verification data lacks one or more of the following: integrity verification data, individual data, correctness verification data, and an end marker.

[0062] Among them, integrity verification data is used to verify the integrity of personalized data, correctness verification data is used to verify the correctness of personalized data, and end indicator is used to indicate the end position of personalized data.

[0063] In this disclosed embodiment, the validity of the first verification data can be comprehensively verified by using integrity verification data, personal data, correctness verification data, and an end marker, thereby determining that the personal data has not been tampered with or lost during transmission or conversion, and thus determining the validity of the given data.

[0064] Optionally, the method for writing data to an embedded system further includes: if the processor determines that the individual data will not be written to the free data area if the first verification data is invalid.

[0065] Combination Figure 3 As shown, this disclosure provides another method for writing data to an embedded system, including:

[0066] S301, the processor obtains the first verification data corresponding to the personalized data.

[0067] S302, the processor writes the first check data into the free data area.

[0068] S303, the processor responds to the write instruction that writes personalized data and determines the validity of the first verification data.

[0069] S304: If the first verification data is valid, the processor writes the individual data into the free data area.

[0070] S305, if the processor determines that the individual data will not be written to the free data area if the first verification data is invalid.

[0071] In this disclosed embodiment, if the first verification data is invalid, it indicates that the first verification data is invalid, meaning that the personalized data has been tampered with, lost, or otherwise damaged during transmission or conversion, resulting in invalid personalized data. Therefore, this invalid personalized data does not need to be written to the free data area, thus improving the writing efficiency of valid personalized data.

[0072] Optionally, after the processor writes the personalized data into the free data area, the processor further includes: responding to a verification instruction for verifying the personalized data, verifying the personalized data based on the first verification data to determine the correctness of the personalized data.

[0073] Combination Figure 4 As shown, this disclosure provides another method for writing data to an embedded system, including:

[0074] S401, the processor obtains the first verification data corresponding to the personalized data.

[0075] S402, the processor writes the first check data into the free data area.

[0076] S403, in response to the write instruction for writing personalized data, the processor determines the validity of the first verification data.

[0077] S404: If the first verification data is valid, the processor writes the individual data into the free data area.

[0078] S405, the processor responds to the verification instruction for verifying the personalized data, and verifies the personalized data according to the first verification data to determine the correctness of the personalized data.

[0079] It should be noted that the verification command for personal data is a single command.

[0080] Optionally, the processor verifies the personalized data based on the first verification data by: parsing the first verification data to obtain second verification data; and then verifying the personalized data based on the second verification data.

[0081] For example, the processor verifies the personalized data based on the second verification data by: the processor verifies the personalized data based on the correctness verification data in the second verification data.

[0082] For example, the processor verifies the personalized data based on the correctness verification data in the second verification data, which includes: the processor verifies the personalized data based on the correctness verification data in the second verification data using a correctness verification algorithm. The correctness verification algorithm includes CRC (Cyclic Redundancy Check), checksum, hash function (such as MD5, SHA-1, etc.), or digital signature algorithm (such as RSA, ECDSA).

[0083] For example, the processor verifies the personalized data based on the correctness check data in the second verification data by: the processor calculating a check value based on the personalized data using a CRC algorithm; the processor comparing the check value calculated based on the personalized data with the correctness check data from the second verification data; and the processor determining that the personalized data is correct if the check value and the correctness check data match, and / or determining that the personalized data is incorrect if the check value and the correctness check data do not match.

[0084] In this disclosed embodiment, the correctness of personalized data can be verified using first verification data, thereby improving the correctness of personalized data written to the free data area. This prevents embedded system anomalies or security risks caused by errors or tampering with personalized data, enabling timely detection and repair of potential personalized data problems, and improving the stability and reliability of the embedded system. Furthermore, related technologies verify personalized data through multiple standard instructions required by specifications or platform-defined private instructions. In this disclosed embodiment, the verification instruction is a single instruction, thus significantly improving the efficiency of personalized data verification.

[0085] Optionally, after the processor verifies the individual data based on the first verification data, the process further includes: the processor clearing the first verification data in the free area.

[0086] Combination Figure 5 As shown, this disclosure provides another method for writing data to an embedded system, including:

[0087] S501, the processor obtains the first verification data corresponding to the personalized data.

[0088] S502, the processor writes the first check data into the free data area.

[0089] S503, in response to a write command that writes personal data, the processor determines the validity of the first verification data.

[0090] S504: If the first verification data is valid, the processor writes the individual data into the free data area.

[0091] S505, the processor responds to the verification instruction for verifying the personalized data, and verifies the personalized data according to the first verification data to determine the correctness of the personalized data.

[0092] S506, the processor clears the first parity data in the free area.

[0093] In this disclosed embodiment, after verifying the personalized data using the first verification data, the embedded system no longer needs the first verification data. Therefore, clearing the no longer needed first verification data can free up storage space and improve the resource utilization and efficiency of the embedded system. Furthermore, clearing the first verification data can reduce potential security risks, such as preventing malicious users from obtaining sensitive information or tampering with data through the first verification data.

[0094] Combination Figure 6 As shown, this embodiment of the present disclosure provides a data writing apparatus 200 for an embedded system, including an acquisition module 21, a first writing module 22, a determination module 23, and a second writing module 24. The acquisition module 21 is configured to acquire first verification data corresponding to personalized data, wherein the first verification data represents personalized data in a preset format; the first writing module 22 is configured to write the first verification data into a free data area; the determination module 23 is configured to determine the validity of the first verification data in response to a write command for writing personalized data; and the second writing module 24 is configured to write the personalized data into the free data area if the first verification data is valid.

[0095] Using the data writing apparatus 200 for embedded systems provided in this disclosure, personalized data can be written to the free data area with a single write instruction. Furthermore, since the first verification data represents personalized data in a preset format, the validity of the personalized data is determined by verifying the validity of the first verification data before writing the personalized data to the free data area. This ensures that valid personalized data is written to the free data area, avoids writing invalid data, and improves the efficiency of personalized data writing.

[0096] Combination Figure 7 As shown, this disclosure provides a data writing apparatus 300 for an embedded system, including a processor 700 and a memory 701. Optionally, the apparatus may further include a communication interface 702 and a bus 703. The processor 700, communication interface 702, and memory 701 can communicate with each other via the bus 703. The communication interface 702 can be used for information transmission. The processor 700 can invoke logical instructions in the memory 701 to execute the data writing method for an embedded system described in the above embodiment.

[0097] Furthermore, the logic instructions in the aforementioned memory 701 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.

[0098] The memory 701, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this disclosure. The processor 700 executes functional applications and data processing by running the program instructions / modules stored in the memory 701, that is, it implements the data writing method for embedded systems described in the above embodiments.

[0099] The memory 701 may include a program storage area and a data storage area. The program storage area may store the operating system and application programs required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 701 may include high-speed random access memory and may also include non-volatile memory.

[0100] Combination Figure 1 As shown, this disclosure provides an embedded system 1, including a chip body 10 and the aforementioned data writing device 200 (300) for the embedded system. The data writing device 200 (300) for the embedded system is mounted on the chip body 10. The mounting relationship described herein is not limited to placement inside the chip body 10, but also includes mounting connections with other components of the chip body 10, including but not limited to physical connections, electrical connections, or signal transmission connections. Those skilled in the art will understand that the data writing device 200 (300) for the embedded system can be adapted to any feasible chip body 10, thereby implementing other feasible embodiments. The chip body 10 includes a security unit 100, which includes a free data area 1001 configured to store data.

[0101] This disclosure provides a computer-readable storage medium storing computer-executable instructions configured to perform the above-described method for writing data to an embedded system.

[0102] The technical solutions of this disclosure can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in this disclosure. The aforementioned storage medium can be a non-transitory storage medium, such as a USB flash drive, external hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc., and other media capable of storing program code.

[0103] The foregoing description and accompanying drawings fully illustrate embodiments of this disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the terminology used in this application is for describing embodiments only and is not intended to limit the claims. As used in the description of embodiments and claims, the singular forms “a,” “an,” and “the” are intended to equally include the plural forms unless the context clearly indicates otherwise. Similarly, the term “and / or” as used in this application means including one or more of the associated listed items and all possible combinations thereof. Additionally, when used in this application, the term "comprise" and its variations "comprises" and / or "comprising" refer to the presence of stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase "comprises a..." does not exclude the presence of other identical elements in the process, method, or apparatus that includes said element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, the relevant parts can be referred to the description of the method section.

[0104] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this disclosure. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0105] The methods and products (including but not limited to devices and equipment) disclosed in the embodiments herein can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units may be merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed units may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms. 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 units may be selected to implement this embodiment according to actual needs. Furthermore, the functional units in the embodiments of this disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0106] 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 embodiments of this disclosure. 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. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in a block diagram and / or flowchart, and combinations of blocks in a block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

Claims

1. A method for writing data to an embedded system, characterized in that, The embedded system includes a security element, which includes a free data area configured to store data; the method includes: Obtain the first verification data corresponding to the personalized data, wherein the first verification data represents personalized data in a preset format; Write the first verification data into the free data area; In response to a write command to write personalized data, the validity of the first verification data is determined; wherein, the write command to write personalized data is a single command. If the first verification data is valid, the personalized data is written to the free data area.

2. The method according to claim 1, characterized in that, Determining the validity of the first verification data includes: The first verification data is parsed to obtain the second verification data; The validity of the first verification data is determined based on the second verification data.

3. The method according to claim 2, characterized in that, The first verification data is parsed to obtain the second verification data, including: Obtain the address of the first verification data; The first check data is parsed based on its address to obtain the second check data.

4. The method according to claim 2, characterized in that, Determining the validity of the first verification data based on the second verification data includes: If the second verification data includes integrity verification data, individual data, correctness verification data, and an end marker, the first verification data is determined to be valid data; wherein, the integrity verification data is used to verify the integrity of the individual data, the correctness verification data is used to verify the correctness of the individual data, and the end marker is used to indicate the end position of the individual data; And / or, If the second verification data lacks one or more of the following: integrity verification data, individual data, correctness verification data, and end marker, the first verification data is determined to be invalid data.

5. The method according to any one of claims 1 to 4, characterized in that, Also includes: If the first verification data is invalid, it is determined not to write the personalized data to the free data area.

6. The method according to any one of claims 1 to 4, characterized in that, After writing the personalized data to the free data area, the following is also included: In response to a verification command for verifying personalized data, the personalized data is verified based on the first verification data to determine the correctness of the personalized data.

7. The method according to claim 6, characterized in that, After verifying the individual data based on the first verification data, the following steps are also included: Clear the first checksum data in the free area.

8. A device for writing data to an embedded system, characterized in that, include: The acquisition module is configured to obtain the first verification data corresponding to the personalized data, wherein the first verification data represents personalized data in a preset format; The first write module is configured to write the first verification data to the free data area; The determination module is configured to determine the validity of the first verification data in response to a write command that writes personalized data; wherein the write command that writes personalized data is a single command. The second write module is configured to write the personalized data to the free data area if the first verification data is valid.

9. A device for writing data to an embedded system, comprising a processor and a memory storing program instructions, characterized in that, The processor is configured to perform, when executing the program instructions, a method for writing data to an embedded system as described in any one of claims 1 to 7.

10. An embedded system, characterized in that, include: The chip body includes a security unit, which includes a free data area configured to store data. and, The data writing apparatus for an embedded system as described in claim 8 or 9 is mounted on the chip body.

Citation Information

Patent Citations

  • Personalized digital data processing system

    US20040044867A1

  • Secure booting method, apparatus, device for embedded program, and storage medium

    US20200117805A1