Embedded chip data access method

文档序号:1186390 发布日期:2020-09-22 浏览:29次 中文

阅读说明:本技术 嵌入式芯片数据访问方法 (Embedded chip data access method ) 是由 隋强 于 2019-03-11 设计创作,主要内容包括:本发明提供一种嵌入式芯片数据访问方法,所述嵌入式芯片包括非易失性存储器,所述非易失性存储器至少包括加密区域和非加密区域,所述数据访问方法包括:根据访问的目标地址确定访问对象,所述访问对象包括:加密区域和非加密区域;在所述访问对象为加密区域时,执行对所述加密区域的操作。本发明的技术方案,避免了对非易失性存储器的加密区域和非加密区域进行操作的冲突,提高了对加密区域进行操作的时效性。(The invention provides an embedded chip data access method, wherein the embedded chip comprises a nonvolatile memory, the nonvolatile memory at least comprises an encryption area and a non-encryption area, and the data access method comprises the following steps: determining an access object according to an accessed target address, wherein the access object comprises: an encrypted area and an unencrypted area; and when the access object is an encryption area, executing the operation on the encryption area. The technical scheme of the invention avoids the conflict of operating the encryption area and the non-encryption area of the nonvolatile memory and improves the timeliness of operating the encryption area.)

1. An embedded chip data access method, the embedded chip includes a nonvolatile memory, the nonvolatile memory includes at least an encryption area and a non-encryption area, the data access method includes:

determining an access object according to an accessed target address, wherein the access object comprises: an encrypted area and an unencrypted area;

and when the access object is an encryption area, executing the operation on the encryption area.

2. The method of claim 1, wherein when the access object is an encryption area, performing the operation on the encryption area comprises:

judging whether the current operation is a non-encryption region operation or an encryption region operation;

if the operation is the operation in the non-encryption area, the current operation on the non-encryption area is suspended, and the operation on the encryption area is executed;

and if the operation is the encryption area operation, executing the operation with the higher priority on the encryption area according to the operation priority on the encryption area.

3. The method of claim 2, wherein the suspending execution of the current operation on the unencrypted region comprises: suspending the operation on the non-encryption area, canceling the operation on the non-encryption area or setting the current operation on the non-encryption area as failure.

4. The method of claim 2 or 3, further comprising storing information associated with the operation after suspending execution of the current operation on the unencrypted region.

5. The method according to claim 2 or 3, further comprising continuing to execute the operation on the non-encryption area suspended after executing the operation on the encryption area.

6. The method of claim 1, further comprising not receiving an instruction to operate on the non-encrypted region while performing the operation on the encrypted region.

7. The method of claim 1, wherein the data access method is performed by a processor.

8. An embedded chip data access method, the embedded chip includes a nonvolatile memory, the nonvolatile memory includes at least an encrypted area and a non-encrypted area, the data access method includes:

acquiring the current state of a processor;

if the processor executes the operation on the encryption area, sending an instruction for suspending the execution of the operation on the non-encryption area;

and if the processor does not receive the instruction for operating the encrypted area and is in the operation of suspending the non-encrypted area, continuing to execute the operation on the non-encrypted area.

9. The method of claim 8, further comprising:

and if the processor is idle, sending an instruction for operating the encryption area or the non-encryption area, and operating the encryption area or the non-encryption area by the processor according to the instruction.

Technical Field

The invention relates to the technical field of chips, in particular to an embedded chip data access method.

Background

Generally, the chip includes a general-purpose chip and an embedded chip, and the function of the embedded chip is relatively single compared to the general-purpose chip, however, the embedded chip is now widely used in electrical products. For the embedded chip, the embedded chip generally has the characteristics of small system kernel, strong specificity, simplified system, high real-time performance, multitask operating system and the like.

As artificial intelligence evolves, automobile intelligence has become a trend, for example: driving assistance functions, etc., and accompanying implementation of these functions in automobiles, more and more embedded chips are being used in automobiles. However, in practical applications, when the encryption area and the non-encryption area of the embedded chip are operated, read-write collision occurs, and when the encryption area is operated, timeliness is poor.

Therefore, how to provide an embedded chip data access method, which avoids the conflict between the operations performed on the encrypted area and the non-encrypted area of the non-volatile memory of the embedded chip and improves the timeliness of the operations performed on the encrypted area becomes one of the problems to be solved at present.

Disclosure of Invention

The invention aims to provide an embedded chip data access method which can avoid the conflict of operation on an encryption area and a non-encryption area of a nonvolatile memory of an embedded chip and improve the timeliness of the operation on the encryption area.

In order to solve the above problems, a technical solution of the present invention provides an embedded chip data access method, where the embedded chip includes a nonvolatile memory, the nonvolatile memory includes at least an encryption area and a non-encryption area, and the data access method includes:

determining an access object according to an accessed target address, wherein the access object comprises: an encrypted area and an unencrypted area;

and when the access object is an encryption area, executing the operation on the encryption area.

Optionally, when the access object is an encrypted area, the performing the operation on the encrypted area includes:

judging whether the current operation is a non-encryption region operation or an encryption region operation;

if the operation is the operation in the non-encryption area, the current operation on the non-encryption area is suspended, and the operation on the encryption area is executed;

and if the operation is the encryption area operation, executing the operation with the higher priority on the encryption area according to the operation priority on the encryption area.

Optionally, the suspending the current operation on the non-encryption area includes: suspending the operation on the non-encryption area, canceling the operation on the non-encryption area or setting the current operation on the non-encryption area as failure.

Optionally, the method further includes storing information associated with the current operation on the non-encrypted area after the operation is suspended.

Optionally, the method further includes continuing to execute the operation of the non-encryption area that is suspended after executing the operation of the encryption area.

Optionally, the method further includes not receiving an instruction to operate on the non-encrypted area when performing the operation on the encrypted area.

Optionally, the data access method is executed by a processor.

The technical scheme of the invention also provides an embedded chip data access method, wherein the embedded chip comprises a nonvolatile memory, the nonvolatile memory at least comprises an encryption area and a non-encryption area, and the data access method comprises the following steps:

acquiring the current state of a processor;

if the processor executes the operation on the encryption area, sending an instruction for suspending the execution of the operation on the non-encryption area;

and if the processor does not receive the instruction for operating the encrypted area and is in the operation of suspending the non-encrypted area, continuing to execute the operation on the non-encrypted area.

Optionally, the method further includes:

and if the processor is idle, sending an instruction for operating the encryption area or the non-encryption area, and operating the encryption area or the non-encryption area by the processor according to the instruction.

Compared with the prior art, the technical scheme of the invention has the following advantages:

determining an access object according to an accessed target address, wherein the access object comprises: an encrypted area and an unencrypted area; and when the access object is an encryption area, executing the operation on the encryption area. When the encrypted area needs to be operated, the operation on the encrypted area is directly executed, and the conflict that the encrypted area cannot be operated if the non-encrypted area is currently operated when the encrypted area and the non-encrypted area of the embedded chip nonvolatile memory are accessed is avoided. And as long as the current operation object is determined to be the encryption area, corresponding operation is carried out on the encryption area, so that the timeliness of the operation on the encryption area is improved to a great extent.

Drawings

Fig. 1 is a schematic flowchart of an embedded chip data access method according to an embodiment of the present invention.

Detailed Description

In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below. In the following description, specific details are set forth in order to provide a thorough understanding of the present invention. The invention can be implemented in a number of ways different from those described herein and similar generalizations can be made by those skilled in the art without departing from the spirit of the invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

As described in the background art, currently, when an embedded chip having an encrypted area and a non-encrypted area is operated, there is a read-write conflict, and when the encrypted area is operated, the timeliness is poor. Therefore, the inventor proposes a method for accessing data of an encrypted area and an unencrypted area of a non-volatile memory of an embedded chip.

Fig. 1 is a schematic flowchart of an embedded chip data access method according to an embodiment of the present invention, and as shown in fig. 1, the embedded chip data access method according to the embodiment of the present invention includes:

s11: determining an access object according to an accessed target address, wherein the access object comprises: an encrypted area and an unencrypted area;

s12: and when the access object is an encryption area, executing the operation on the encryption area.

In this embodiment, specifically, the processor may directly access the data in the encrypted area and the unencrypted area, and execute S11, where the processor first determines, according to a target address that needs to be accessed by the external application, whether to access the data in the encrypted area (read or write) or the unencrypted area. Next, S12 is executed, and when the processor determines that access to the encrypted area is required, the access to the encrypted area is given a higher priority than the access to the unencrypted area, and the operation to the encrypted area is executed. Specifically, in this embodiment, step S12 may include:

the processor firstly judges whether the current operation is a non-encryption area operation or an encryption area operation, if the current operation is the non-encryption area operation, the current operation on the non-encryption area is suspended, and the operation on the encryption area is executed. In this embodiment, the suspending performing the current operation on the non-encryption area may include: suspending the operation on the non-encryption area, canceling the operation on the non-encryption area or setting the current operation on the non-encryption area as failure. That is, the priority of the operation on the encrypted area is higher than the priority of the operation on the non-encrypted area. In this embodiment, after the current operation on the non-encryption area is suspended, information associated with the operation needs to be stored, such as information of a requester provided by the operation, a type related to the operation, what data the operation relates to the non-encryption area is operated on, a size of the data needing to be operated on, and the like, so that the operation on the non-encryption area can be quickly continued after the operation on the encryption area is finished.

If the processor judges that the current operation is the operation on the encryption area, the operation on the encryption area needs to be executed according to the priority level of the operation on the encryption area. For example, if the current operation is writing to the encryption area, the processor receives an operation that needs to read the encryption area, if the priority of the operation of reading the encryption area is higher than that of the operation of writing to the encryption area, the operation of writing to the encryption area is suspended, the operation of reading to the encryption area is switched to be executed, and after the operation of reading to the encryption area is executed, the operation of writing to the encryption area is continued. In addition, in this embodiment, the processor may not receive the instruction for operating the non-encryption area when executing the operation on the encryption area. After the processor finishes executing the operation on the encryption area, the processor continues to execute the operation on the non-encryption area which is temporarily stopped.

In this embodiment, the access object is determined by the processor, and the processor determines to operate on different areas according to the priority of the access object. In other embodiments, a status query command may be sent to the processor by the upper application program, the current status of the processor is fed back by the processor, and a corresponding command is sent to the processor according to the status fed back by the processor, so as to control the operation of the processor on the encrypted area and the unencrypted area. As in other embodiments, the data access to the encrypted and unencrypted areas of the embedded chip non-volatile memory may include:

firstly, acquiring the current state of a processor; if the processor is executing the operation on the encryption area, the upper application program sends an instruction for suspending the execution of the operation on the non-encryption area to the processor, so that the processor suspends the execution of the current operation on the non-encryption area. If the processor does not receive the instruction sent by the upper layer application program to operate on the encryption area and the processor is in the operation of suspending the non-encryption area, the processor continues to execute the operation on the non-encryption area. In addition, if the processor feeds back that the upper layer application program is currently in an idle state, the upper layer application program may send an instruction for operating the encryption area or the non-encryption area, and after receiving the instruction, the processor may execute the operation on the encryption area or the non-encryption area.

In summary, the embedded chip data access method provided by the invention at least has the following beneficial effects:

determining an access object according to an accessed target address, wherein the access object comprises: an encrypted area and an unencrypted area; and when the access object is an encryption area, executing the operation on the encryption area. When the encrypted area needs to be operated, the operation on the encrypted area is directly executed, and the conflict that the encrypted area cannot be operated if the non-encrypted area is currently operated when the encrypted area and the non-encrypted area of the embedded chip nonvolatile memory are accessed is avoided. And as long as the current operation object is determined to be the encryption area, corresponding operation is carried out on the encryption area, so that the timeliness of the operation on the encryption area is improved to a great extent.

Although the present invention has been described with reference to the preferred embodiments, it is not intended to limit the present invention, and those skilled in the art can make variations and modifications of the present invention without departing from the spirit and scope of the present invention by using the methods and technical contents disclosed above.

7页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:非易失性存储器的数据读出方法、装置以及介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!