WO2017050110A1 - 一种嵌入式系统的软件代码防盗方法及装置 - Google Patents

一种嵌入式系统的软件代码防盗方法及装置 Download PDF

Info

Publication number
WO2017050110A1
WO2017050110A1 PCT/CN2016/097747 CN2016097747W WO2017050110A1 WO 2017050110 A1 WO2017050110 A1 WO 2017050110A1 CN 2016097747 W CN2016097747 W CN 2016097747W WO 2017050110 A1 WO2017050110 A1 WO 2017050110A1
Authority
WO
WIPO (PCT)
Prior art keywords
code
embedded system
memory
reading
embedded
Prior art date
Application number
PCT/CN2016/097747
Other languages
English (en)
French (fr)
Inventor
裴志刚
Original Assignee
上海斐讯数据通信技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海斐讯数据通信技术有限公司 filed Critical 上海斐讯数据通信技术有限公司
Publication of WO2017050110A1 publication Critical patent/WO2017050110A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/121Restricting unauthorised execution of programs

Definitions

  • the present invention relates to the field of embedded system technologies, and in particular, to a software code anti-theft method and device for an embedded system.
  • the main object of the present invention is to solve the problem of anti-theft processing of software code in the prior art, designing the encryption information to be complicated, and the problem that the pure software encryption information is easily cracked.
  • the present invention provides a software code anti-theft method and apparatus for an embedded system.
  • the software code anti-theft method of the embedded system comprises the following steps:
  • the preset segment is not stolen when the underlying driver code is stolen;
  • the embedded system is restarted.
  • the method further includes: writing a data link layer address of each embedded circuit board into the peripheral memory to ensure that two embedded circuit boards having the same data link layer address cannot Establish a communication connection.
  • restarting the embedded system includes the following steps:
  • the reading the preset segment code of the electro-migration in the peripheral memory is completed by a software interface function; the reading the kernel code in the flash memory and the application code is completed by a software interface return function of.
  • peripheral memory is an electrically erasable programmable read only memory.
  • the present invention further provides a software code anti-theft device for an embedded system, the device comprising: a system startup module, a peripheral memory, a code migration module, and a system restart module;
  • the system startup module is configured to electrically initialize the embedded system and read an underlying driver code in the flash memory
  • the peripheral memory is externally placed in the embedded system
  • the code migration module is configured to automatically migrate a preset segment of the underlying driver code into the peripheral memory, and delete a code corresponding to the preset segment in the flash memory;
  • the segment is electrically transplanted into the peripheral memory to prevent the preset segment from being stolen when the underlying driver code is stolen;
  • the system restart module is configured to restart the embedded system.
  • peripheral memory further stores a data link layer address of each embedded circuit board to ensure that two embedded circuit boards having the same data link layer address cannot establish a communication connection.
  • system restart module is specifically configured to:
  • reading a preset segment code of the electro-migration in the peripheral memory is completed by a software interface function; reading a kernel code and an application in the flash memory
  • the program code is completed by a software interface return function.
  • peripheral memory is an electrically erasable programmable read only memory.
  • the software code anti-theft method of the embedded system adopts the ingenious combination of software and hardware, and only needs to add a low-cost, small-capacity electrically erasable programmable read only memory (EEPROM) in the embedded system, and the bottom layer
  • EEPROM electrically erasable programmable read only memory
  • the driver code is split into two parts for storage, subverting the traditional design scheme of an embedded system with only one external FLASH. Only stealing the code in FLASH can not complete the normal startup of the system, and compared with the anti-theft scheme using FPGA in the background technology.
  • the solution occupies a small area of PCB, low power consumption, and no power-on timing requirement for single-channel power supply.
  • each embedded circuit board needs to write different data link layer addresses.
  • the anti-theft method provided by the invention writes the data link layer address into the EEPROM, ensures that two embedded products having the same data link layer address will have conflicts, cannot establish communication, and further strengthens the anti-theft function of the software
  • FIG. 1 is a flow chart of steps of a software code anti-theft method for an embedded system according to an embodiment of the present invention.
  • FIG. 2 is a flow chart of hardware, software design, and production automation test according to an embodiment of the present invention.
  • FIG. 3 is a flow chart of performing a preliminary anti-theft function by using the anti-theft method provided by the embodiment of the present invention.
  • FIG. 4 is a flow chart of the anti-theft function performed by the anti-theft method provided by the embodiment of the present invention.
  • FIG. 5 is a structural block diagram of a software code anti-theft device of an embedded system according to an embodiment of the present invention.
  • the present invention provides a software code anti-theft method and apparatus for an embedded system.
  • FIG. 1 is a flow chart showing the steps of a software code anti-theft method for an embedded system according to an embodiment of the present invention.
  • the software code anti-theft method of the embedded system provided by the invention comprises the following steps:
  • S101 electrically initialize the embedded system, and read an underlying driver code in the FLASH;
  • the peripheral memory provided by the embodiment of the present invention is an EEPROM (Electrically Erasable Programmable Read Only Memory), and the EEPROM has low cost, small capacity, and plug and play. advantage.
  • EEPROM Electrically Erasable Programmable Read Only Memory
  • the preset segment of the underlying driver code is electrically transplanted into the EEPROM, and the code corresponding to the preset segment is deleted in the FLASH; the preset segment code is electrically transplanted into the EEPROM to be used when the underlying driver code is stolen.
  • the segment is not stolen, and the initial anti-theft function is performed.
  • the preset segment length of the underlying driver code is not required, and the actual operation is subject to the embodiment.
  • the embodiment of the present invention aims to distinguish the underlying driver code from the conventional solution.
  • the storage in the FLASH is stored in the FLASH and the EEPROM in two parts. Therefore, the preset segment length is not the focus of the embodiment of the present invention, and therefore will not be described herein. as well as
  • step S104 restarts the embedded system, and specifically includes the steps of:
  • step S103 the remaining underlying driver code after the FLASH power migration is started; then the preset segment code that is electrically transplanted in the EEPROM is read; after the reading is completed, the kernel code that continues to read the FLASH is read and The application code, and thus the entire embedded system is in normal operation.
  • the operation of reading the preset segment code of the electro-transplant in the EEPROM is performed by a software interface function; the kernel code and the application code in the reading FLASH are completed by a software interface return function.
  • the method further includes: when the embedded system performs production automation testing, writing a data link layer address (MAC address) of each embedded circuit board into the EEPROM to ensure that the same data link layer address is provided.
  • MAC address data link layer address
  • the two embedded boards cannot establish a communication connection and provide further anti-theft functions. Even with the embedded system of the same platform, it is impossible to steal the code in the original FLASH by changing the MAC address for production and shipment, because the MAC address of the solution is not placed in the FLASH.
  • the production automation test is different from the conventional scheme of placing the MAC address in the FLASH, and changing the MAC address to the EEPROM.
  • FIG. 2 a hardware, software design, and production automation test flow chart provided by an embodiment of the present invention.
  • the embodiment of the invention subtly combines software and hardware to perform software code anti-theft of the embedded system. The specific steps are as follows:
  • S201 the embedded system is powered on for the first time, and reads the underlying driver code in the FLASH;
  • S203 The embedded system restarts after completing the code migration, and starts to read the reservation in the FLASH.
  • the underlying driver code and then read the code for the first power-on migration in the EEPROM;
  • FIG. 3 a flowchart of performing a preliminary anti-theft function by using the anti-theft method provided by the embodiment of the present invention. If the embedded system code is stolen, the specific steps of the anti-theft function provided by the embodiment of the present invention are:
  • S301 The embedded system code is stolen, reads the code in the FLASH on the circuit board and burns it into a new circuit board;
  • driver code is split into two parts for storage, subverting the traditional design scheme of an embedded system with only one external FLASH. Only stealing the code in FLASH can not complete the normal startup of the system, and compared with the background technology.
  • Anti-theft scheme using FPGA This scheme occupies a small area of PCB, low power consumption, and no power-on timing requirement for single-channel power supply.
  • FIG. 4 a flowchart for enhancing the anti-theft function by using the anti-theft method provided by the embodiment of the present invention. If the embedded system code is stolen, the specific steps of the anti-theft method provided by the embodiment of the present invention to strengthen the anti-theft function are:
  • S402 The new circuit board is electrically initialized, and the startup is normal, but the two embedded circuit boards cannot communicate;
  • the anti-theft method provided by the present invention writes the data link layer address into the EEPROM to ensure that the same data is present.
  • the two embedded products at the link layer address will conflict and cannot establish communication, which further enhances the anti-theft function of the software code.
  • FIG. 5 it is a structural block diagram of a software code anti-theft device of an embedded system according to an embodiment of the present invention.
  • the software code anti-theft device of the embedded system includes: a system startup module 501, a peripheral memory 502, a code migration module 503, and a system restart module 504;
  • the system startup module 501 is configured to electrically initialize the embedded system and read the FLASH Underlying driver code
  • the peripheral memory 502 adopts an EEPROM, which is different from the traditional embedded system in that only one FLASH is externally connected, and the peripheral memory 502 and the FLASH share the software code together;
  • the code migration module 503 is configured to automatically migrate the preset segment of the underlying driver code into the peripheral memory 502, and delete the code corresponding to the preset segment in the corresponding location of the FLASH;
  • the system restart module 504 is configured to restart the embedded system.
  • system restarting module 504 is specifically configured to: start reading the retained underlying driver code after the FLASH power migration; and then read the preset segment code that is electrically transplanted in the EEPROM; after the reading is completed, go to continue reading.
  • the kernel code in FLASH and the application code, and then the entire embedded system is in normal operation.
  • the operation of reading the preset segment code of the electro-migration in the EEPROM is performed by a software interface function; the kernel code and the application code in the FLASH are returned through a software interface. Completed.
  • the peripheral memory 502 also stores the data link layer address of each embedded circuit board to ensure that two embedded circuit boards having the same data link layer address cannot Establish a communication connection. Even with the embedded system of the same platform, it is impossible to steal the code in the original FLASH by changing the MAC address for production and shipment, because the MAC address of the solution is not placed in the FLASH.
  • the production automation test is different from the conventional scheme of placing the MAC address in the FLASH, and changing the MAC address to the EEPROM. Even when some people illegally steal our FLASH and EEPROM code, they still can't mass-produce and ship, making it impossible for illegal stealers to judge the MAC address according to what type of writing and what kind of storage scheme. Therefore, the anti-theft solution has better effects than the traditional software code anti-theft.
  • the hardware uses two storage devices to store code, and only needs to burn a single storage period, reducing production programming work and adding a small capacity EEPROM in the original embedded system standardized configuration. For storing the code to be ported and the data link address, that is, the MAC address; even if the embedded system of the same platform, it is impossible to steal the code in the original FLASH by changing the MAC address for production and shipment, because the MAC of the solution The address is not placed in the FLASH.
  • the software code anti-theft method of the embedded system provided by the invention adopts the ingenious combination of software and hardware, and only needs to add a low-cost, small-capacity (EEPROM) in the embedded system, and splits the underlying driver code into two parts.
  • EEPROM electrically erasable programmable read-only memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)
  • Read Only Memory (AREA)

Abstract

一种嵌入式系统的软件代码防盗方法,包括:将所述嵌入式系统进行电初始化,读取闪存中的底层驱动代码(S101);在所述嵌入式系统中外置一外设存储器(S102);将所述底层驱动代码的预设段电移植到所述外设存储器中,并将所述预设段对应的代码在所述闪存中删除;将所述预设段电移植到所述外设存储器中,用以当所述底层驱动代码被窃取时所述预设段不会被窃取(S103);以及将所述嵌入式系统进行重新启动(S104)。该防盗方法采用软件与硬件的巧妙结合,将底层驱动代码拆分成两部分进行存储,颠覆只有一个外置FLASH的嵌入式系统的传统设计方案,占用PCB的面积小、功耗低、单路电源供电无上电时序要求;同时,保证拥有相同数据链路层地址的两台嵌入式产品不能建立通信,进一步地加强防盗功能。

Description

一种嵌入式系统的软件代码防盗方法及装置
本申请要求2015年9月22日提交的申请号为:201510607321.2、发明名称为“一种嵌入式系统的软件代码防盗方法及装置”的中国专利申请的优先权,其全部内容合并在此。
技术领域
本发明涉及嵌入式系统技术领域,尤其涉及一种嵌入式系统的软件代码防盗方法及装置。
背景技术
通信市场很多厂家为了降低研发成本,经常采用在市场中购买成品板,通过PCB抄板,再进行软件反编译的方式来抄袭其他公司的产品,严重损害被抄袭公司的利益。
为了防止软件产品被拷贝,常规的防盗处理方式有三类:软件加密、硬件加密、加密芯片加密。软件加密处理方式过程中需要耗用一定得中央处理器的处理资源,硬件加密处理方式保密性不是很好,加密芯片加密处理方式成本较高且加密芯片不易量产控制。
目前市场中有的厂家采用通过在中央处理器和闪存(FLASH)总线上增加一个FPGA加密系统的方式来实现整个嵌入式系统的加密运行。在这种加密处理设计中所有程序在运行的过程中均需加密程序的运行,当产品在意外断电时,对产品中运行的加密程序没有加密完成,可能会造成产品不能再次启动。同时,采用FPGA加密系统成本较高,PCB占用面积大,需要多路电源并且有上电时序要求,功耗高。
发明内容
本发明的主要目的在于解决现有技术中对软件代码防盗的处理,设计加密信息比较复杂,以及纯软件加密信息容易被破解的问题。
为实现上述目的,本发明提供的一种嵌入式系统的软件代码防盗方法及装置。
本发明所提供的嵌入式系统的软件代码防盗方法,包括以下步骤:
将所述嵌入式系统进行电初始化,读取闪存中的底层驱动代码;
在所述嵌入式系统中外置一外设存储器;
将所述底层驱动代码的预设段电移植到所述外设存储器中,并将所述预设段对应的代码在所述闪存中删除;将所述预设段电移植到所述外设存储器中,用以当所述底层驱动代码被窃取时所述预设段不会被窃取;以及
将所述嵌入式系统进行重新启动。
进一步地,所述方法还包括:将每一个嵌入式电路板的数据链路层地址写入所述外设存储器中,以确保具有相同所述数据链路层地址的两个嵌入式电路板不能建立通讯连接。
进一步地,所述将所述嵌入式系统进行重新启动,具体包括步骤:
读取所述闪存中电移植后的底层驱动代码;读取所述外设存储器中电移植的预设段代码;读取所述闪存中的内核代码以及应用程序代码。
进一步地,所述读取所述外设存储器中电移植的预设段代码是通过软件接口函数完成的;所述读取所述闪存中的内核代码以及应用程序代码是通过软件接口返回函数完成的。
进一步地,所述外设存储器为电可擦可编程只读存储器。
进一步地,本发明还提供了一种嵌入式系统的软件代码防盗装置,所述装置包括:系统启动模块、外设存储器、代码移植模块以及系统重启模块;
所述系统启动模块,用于将所述嵌入式系统进行电初始化,读取闪存中的底层驱动代码;
所述外设存储器外置于所述嵌入式系统中;
所述代码移植模块,用于将所述底层驱动代码的预设段电移植到所述外设存储器中,并将所述预设段对应的代码在所述闪存中删除;将所述预设段电移植到所述外设存储器中,用以当所述底层驱动代码被窃取时所述预设段不会被窃取;
所述系统重启模块,用于将所述嵌入式系统进行重新启动。
进一步地,所述外设存储器还存储有每一个嵌入式电路板的数据链路层地址,以确保具有相同所述数据链路层地址的两个嵌入式电路板不能建立通讯连接。
进一步地,所述系统重启模块具体用于:
读取所述闪存中电移植后的底层驱动代码;读取所述外设存储器中电移植的预设段代码;读取所述闪存中的内核代码以及应用程序代码。
进一步地,在所述系统重启模块中,读取所述外设存储器中电移植的预设段代码是通过软件接口函数完成的;读取所述闪存中的内核代码以及应用 程序代码是通过软件接口返回函数完成的。
进一步地,所述外设存储器为电可擦可编程只读存储器。
本发明提供的嵌入式系统的软件代码防盗方法采用软件与硬件的巧妙结合,只需在嵌入式系统中增加一颗低成本、小容量的电可擦可编程只读存储器(EEPROM),将底层驱动代码拆分成两部分进行存储,颠覆只有一个外置FLASH的嵌入式系统的传统设计方案,仅盗取FLASH中的代码并不能完成系统正常启动,且相比背景技术中使用FPGA的防盗方案本方案占用PCB的面积小、功耗低、单路电源供电无上电时序要求;同时,嵌入式系统的生产自动化测试,每一台嵌入式电路板要写入不同的数据链路层地址,本发明提供的防盗方法将数据链路层地址写入EEPROM中,保证拥有相同数据链路层地址的两台嵌入式产品会有冲突,不能建立通信,进一步地加强了软件代码的防盗功能。
附图说明
图1为本发明实施例提供的嵌入系统的软件代码防盗方法的步骤流程图。
图2为本发明实施例提供的硬件、软件设计和生产自动化测试流程图。
图3为采用本发明实施例提供的防盗方法进行初步防盗功能的流程图。
图4为采用本发明实施例提供的防盗方法进行加强防盗功能的流程图。
图5为本发明实施例提供的嵌入系统的软件代码防盗装置的结构框图。
本发明的实现、功能特点及优点将结合实施例,参照附图作进一步说明。
具体实施方式
以下结合说明书附图对本发明的优选实施例进行说明,应当理解,此处所描述的优选实施例仅用于说明和解释本发明,并不用于限定本发明,并且在不冲突的情况下,本发明中的实施例及实施例中的特征可以相互组合。
为实现上述目的,本发明提供的一种嵌入式系统的软件代码防盗方法及装置。
如图1所示,为本发明实施例提供的嵌入系统的软件代码防盗方法的步骤流程图。本发明所提供的嵌入式系统的软件代码防盗方法,包括以下步骤:
S101:将嵌入式系统进行电初始化,读取FLASH中的底层驱动代码;
S102:在嵌入式系统中外置一外设存储器;其中,本发明实施例提供的外设存储器为EEPROM(电可擦可编程只读存储器),EEPROM具有低成本、小容量、即插即用等优点。
S103:将底层驱动代码的预设段电移植到EEPROM中,并将预设段对应的代码在FLASH中删除;将预设段代码电移植到EEPROM中,用以当底层驱动代码被窃取时预设段不会被窃取,起到初步防盗功能;其中,底层驱动代码的预设段长度不做要求,以实际操作为准,本发明实施例旨在将底层驱动代码区别于传统方案只放入FLASH中存储,而是分两部分分别存储在FLASH与EEPROM中,因此预设段长度并不是本发明实施例的重点,故不在此进行赘述。以及
S104:将嵌入式系统进行重新启动。
进一步地,步骤S104将嵌入式系统进行重新启动,具体包括步骤:
完成步骤S103之后,开始读取FLASH中电移植后的保留下来的底层驱动代码;接着读取EEPROM中被电移植的预设段代码;读取完成后转到继续读取FLASH中的内核代码以及应用程序代码,进而整个嵌入式系统进行正常运行状态。
进一步地,上述读取EEPROM中电移植的预设段代码的操作是通过软件接口函数完成的;上述读取FLASH中的内核代码以及应用程序代码是通过软件接口返回函数完成的。
进一步地,所述方法还包括:当嵌入式系统进行生产自动化测试时,将每一个嵌入式电路板的数据链路层地址(MAC地址)写入EEPROM中,以确保具有相同数据链路层地址的两个嵌入式电路板不能建立通讯连接,起到进一步防盗功能。就算相同平台的嵌入式系统,也无法在原FLASH中通过更改MAC地址的方式进行盗取代码进行生产出货,因为本方案的MAC地址不放在FLASH中。生产自动化测试有别于常规的将MAC地址放在FLASH中的方案,改成将MAC地址放在EEPROM中。即便当某些人非法盗取我们的FLASH和EEPROM代码时,仍然无法量产出货,使得非法盗取者无法判断MAC地址是依何种写入方式、何种存储方案设计。因此,本防盗方案较传统的软件代码防盗有更佳的效果。
进一步地,如图2所示,为本发明实施例提供的硬件、软件设计和生产自动化测试流程图。本发明实施例巧妙地将软件、硬件相结合的方式进行嵌入式系统的软件代码防盗,具体步骤为:
S201:嵌入式系统第一次上电初始化,读取FLASH中的底层驱动代码;
S202:嵌入式系统底层启动成功,将FLASH中的部分驱动代码移植到外置EEPROM中,并将FLASH中被移植的代码删除;
S203:嵌入式系统完成代码移植后重新启动,开始读取FLASH中的保留 底层驱动代码,接着读取EEPROM中第一次上电移植的代码;
S204:嵌入式系统成功读取EEPROM移植的代码,转到读取FLASH中的内核代码和应用程度代码,整个嵌入式系统正常运行;
S205:嵌入式系统的生产自动化测试,每一台嵌入式PCB要写入不同的数据链路层地址,将数据链路层地址写入EEPROM中,不会有冲突,然而拥有相同数据链路层地址的两台嵌入式产品不能建立通信,会有冲突。
进一步地,如图3所示,为采用本发明实施例提供的防盗方法进行初步防盗功能的流程图。如果嵌入式系统代码被窃取,本发明实施例提供的防盗方法进行初步防盗功能的具体步骤为:
S301:嵌入式系统代码被窃取,读取电路板上的FLASH中的代码并烧录到新的电路板中;
S302:新的电路板上电初始化,读取FLASH中的底层缺失驱动代码;
S303:新的电路板上电初始化失败,系统被挂起。
进而证明了将底层驱动代码拆分成两部分进行存储,颠覆只有一个外置FLASH的嵌入式系统的传统设计方案,仅盗取FLASH中的代码并不能完成系统正常启动,且相比背景技术中使用FPGA的防盗方案本方案占用PCB的面积小、功耗低、单路电源供电无上电时序要求。
进一步地,如图4所示,为采用本发明实施例提供的防盗方法进行加强防盗功能的流程图。如果嵌入式系统代码被窃取,本发明实施例提供的防盗方法进行加强防盗功能的具体步骤为:
S401:嵌入式系统代码被窃取,读取电路板上的FLASH和EEPROM中的代码并分别烧录到新的电路板中;
S402:新的电路板上电初始化,启动正常,但两台嵌入式电路板不能通信;
S403:新的电路板有相同的数据链路层地址,但通信仍失败。
进而证明了嵌入式系统的生产自动化测试,每一台嵌入式电路板要写入不同的数据链路层地址,本发明提供的防盗方法将数据链路层地址写入EEPROM中,保证拥有相同数据链路层地址的两台嵌入式产品会有冲突,不能建立通信,进一步地加强了软件代码的防盗功能
进一步地,如图5所示,为本发明实施例提供的嵌入式系统的软件代码防盗装置的结构框图。嵌入式系统的软件代码防盗装置包括:系统启动模块501、外设存储器502、代码移植模块503以及系统重启模块504;
系统启动模块501,用于将嵌入式系统进行电初始化,读取FLASH中的 底层驱动代码;
外设存储器502采用EEPROM,区别于传统嵌入式系统仅外挂一个FLASH,而是外设存储器502与FLASH共同存储软件代码;
代码移植模块503,用于将底层驱动代码的预设段电移植到外设存储器502中,并将预设段对应的代码在FLASH相应位置中删除;
系统重启模块504,用于将嵌入式系统进行重新启动。
进一步地,系统重启模块504具体用于:开始读取FLASH中电移植后的保留下来的底层驱动代码;接着读取EEPROM中被电移植的预设段代码;读取完成后转到继续读取FLASH中的内核代码以及应用程序代码,进而整个嵌入式系统进行正常运行状态。
进一步地,在系统重启模块504中,上述读取EEPROM中电移植的预设段代码的操作是通过软件接口函数完成的;上述读取FLASH中的内核代码以及应用程序代码是通过软件接口返回函数完成的。
进一步地,当嵌入式系统进行生产自动化测试时,外设存储器502还存储有每一个嵌入式电路板的数据链路层地址,以确保具有相同数据链路层地址的两个嵌入式电路板不能建立通讯连接。就算相同平台的嵌入式系统,也无法在原FLASH中通过更改MAC地址的方式进行盗取代码进行生产出货,因为本方案的MAC地址不放在FLASH中。生产自动化测试有别于常规的将MAC地址放在FLASH中的方案,改成将MAC地址放在EEPROM中。即便当某些人非法盗取我们的FLASH和EEPROM代码时,仍然无法量产出货,使得非法盗取者无法判断MAC地址是依何种写入方式、何种存储方案设计。因此,本防盗方案较传统的软件代码防盗有更佳的效果。
通常嵌入式系统的产品生产前都需要烧录代码到FLASH中,贴片和插件等生产完成后上电,此时嵌入式系统会依FLASH中的代码程序进行运行,并在出货前烧录不同的MAC地址,以确保每一台产品都能相互正常通信。而本发明采用硬件与软件的巧妙结合的方式,硬件是使用两颗存储器件存储代码,并且仅需要烧录单颗存储期间,减少生产烧录工作在原嵌入式系统标准化配置中增加一个小容量EEPROM,用于存储待移植代码及数据链路地址,即MAC地址;就算相同平台的嵌入式系统,也无法在原FLASH中通过更改MAC地址的方式进行盗取代码进行生产出货,因为本方案的MAC地址不放在FLASH中。软件针对防盗应用,进行部分底层驱动代码移植,并通过软件接口函数读取外部EEPROM的底层代码,完成后,再通过软件接口返回函数,接着加载FLASH中的内核代码以及应用软件代码,继而完成整个嵌入式系统 正常运行。
本发明提供的嵌入式系统的软件代码防盗方法采用软件与硬件的巧妙结合,只需在嵌入式系统中增加一颗低成本、小容量的(EEPROM),将底层驱动代码拆分成两部分进行存储,颠覆只有一个外置FLASH的嵌入式系统的传统设计方案,仅盗取FLASH中的代码并不能完成系统正常启动,且相比背景技术中使用FPGA的防盗方案本方案占用PCB的面积小、功耗低、单路电源供电无上电时序要求;同时,嵌入式系统的生产自动化测试,每一台嵌入式电路板要写入不同的数据链路层地址,本发明提供的防盗方法将数据链路层地址写入EEPROM中,保证拥有相同数据链路层地址的两台嵌入式产品会有冲突,不能建立通信,进一步地加强了软件代码的防盗功能。
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。

Claims (10)

  1. 一种嵌入式系统的软件代码防盗方法,其特征在于,所述方法包括以下步骤:
    将所述嵌入式系统进行电初始化,读取闪存中的底层驱动代码;
    在所述嵌入式系统中外置一外设存储器;
    将所述底层驱动代码的预设段电移植到所述外设存储器中,并将所述预设段对应的代码在所述闪存中删除;
    将所述预设段电移植到所述外设存储器中,用以当所述底层驱动代码被窃取时所述预设段不会被窃取;以及
    将所述嵌入式系统进行重新启动。
  2. 如权利要求1所述的方法,其特征在于,所述方法还包括:将每一个嵌入式电路板的数据链路层地址写入所述外设存储器中,以确保具有相同所述数据链路层地址的两个嵌入式电路板不能建立通讯连接。
  3. 如权利要求1所述的方法,其特征在于,所述将所述嵌入式系统进行重新启动,具体包括步骤:
    读取所述闪存中电移植后的底层驱动代码;读取所述外设存储器中电移植的预设段代码;读取所述闪存中的内核代码以及应用程序代码。
  4. 如权利要求3所述的方法,其特征在于,所述读取所述外设存储器中电移植的预设段代码是通过软件接口函数完成的;所述读取所述闪存中的内核代码以及应用程序代码是通过软件接口返回函数完成的。
  5. 如权利要求1-4任一项所述的方法,其特征在于,所述外设存储器为电可擦可编程只读存储器。
  6. 一种嵌入式系统的软件代码防盗装置,其特征在于,所述装置包括:系统启动模块、外设存储器、代码移植模块以及系统重启模块;
    所述系统启动模块,用于将所述嵌入式系统进行电初始化,读取闪存中的底层驱动代码;
    所述外设存储器外置于所述嵌入式系统中;
    所述代码移植模块,用于将所述底层驱动代码的预设段电移植到所述外设存储器中,并将所述预设段对应的代码在所述闪存中删除;将所述预设段电移植到所述外设存储器中,用以当所述底层驱动代码被窃取时所述预设段不会被窃取;
    所述系统重启模块,用于将所述嵌入式系统进行重新启动。
  7. 如权利要求6所述的装置,其特征在于,所述外设存储器还存储有每一个嵌入式电路板的数据链路层地址,以确保具有相同所述数据链路层地址的两个嵌入式电路板不能建立通讯连接。
  8. 如权利要求1所述的装置,其特征在于,所述系统重启模块具体用于:
    读取所述闪存中电移植后的底层驱动代码;读取所述外设存储器中电移植的预设段代码;读取所述闪存中的内核代码以及应用程序代码。
  9. 如权利要求8所述的装置,其特征在于,在所述系统重启模块中,读取所述外设存储器中电移植的预设段代码是通过软件接口函数完成的;读取所述闪存中的内核代码以及应用程序代码是通过软件接口返回函数完成的。
  10. 如权利要求6-9任一项所述的装置,其特征在于,所述外设存储器为电可擦可编程只读存储器。
PCT/CN2016/097747 2015-09-22 2016-08-31 一种嵌入式系统的软件代码防盗方法及装置 WO2017050110A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510607321.2 2015-09-22
CN201510607321.2A CN105205357B (zh) 2015-09-22 2015-09-22 一种嵌入式系统的软件代码防盗方法及装置

Publications (1)

Publication Number Publication Date
WO2017050110A1 true WO2017050110A1 (zh) 2017-03-30

Family

ID=54953033

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/097747 WO2017050110A1 (zh) 2015-09-22 2016-08-31 一种嵌入式系统的软件代码防盗方法及装置

Country Status (2)

Country Link
CN (1) CN105205357B (zh)
WO (1) WO2017050110A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111240726A (zh) * 2018-11-29 2020-06-05 株洲中车时代电气股份有限公司 一种嵌入式数据处理系统

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105205357B (zh) * 2015-09-22 2018-07-31 上海斐讯数据通信技术有限公司 一种嵌入式系统的软件代码防盗方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101038615A (zh) * 2007-03-12 2007-09-19 吴晓栋 一种直接从软件中任意分离代码到加密锁实现软件版权保护的方法
US20080212419A1 (en) * 2004-08-11 2008-09-04 Intelligentdisc, Inc. Disk Contents Management Method and Disk
CN102982264A (zh) * 2012-12-24 2013-03-20 上海斐讯数据通信技术有限公司 一种嵌入式设备软件保护方法
CN103020495A (zh) * 2012-12-17 2013-04-03 马驹 一种嵌入式软件防盗版加密方法
CN105205357A (zh) * 2015-09-22 2015-12-30 上海斐讯数据通信技术有限公司 一种嵌入式系统的软件代码防盗方法及装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6871192B2 (en) * 2001-12-20 2005-03-22 Pace Anti-Piracy System and method for preventing unauthorized use of protected software utilizing a portable security device
CN101635019B (zh) * 2009-08-25 2011-07-20 中国华录集团有限公司 基于安全mcu的嵌入式软件程序的加密系统
CN103106091A (zh) * 2013-01-31 2013-05-15 深圳市开立科技有限公司 一种基于可移动存储介质的操作系统的启动系统和方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080212419A1 (en) * 2004-08-11 2008-09-04 Intelligentdisc, Inc. Disk Contents Management Method and Disk
CN101038615A (zh) * 2007-03-12 2007-09-19 吴晓栋 一种直接从软件中任意分离代码到加密锁实现软件版权保护的方法
CN103020495A (zh) * 2012-12-17 2013-04-03 马驹 一种嵌入式软件防盗版加密方法
CN102982264A (zh) * 2012-12-24 2013-03-20 上海斐讯数据通信技术有限公司 一种嵌入式设备软件保护方法
CN105205357A (zh) * 2015-09-22 2015-12-30 上海斐讯数据通信技术有限公司 一种嵌入式系统的软件代码防盗方法及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111240726A (zh) * 2018-11-29 2020-06-05 株洲中车时代电气股份有限公司 一种嵌入式数据处理系统
CN111240726B (zh) * 2018-11-29 2024-02-20 株洲中车时代电气股份有限公司 一种嵌入式数据处理系统

Also Published As

Publication number Publication date
CN105205357B (zh) 2018-07-31
CN105205357A (zh) 2015-12-30

Similar Documents

Publication Publication Date Title
CN110032405B (zh) 系统开机码存储器管理方法、存储器装置与应用其的电子系统
TWI493460B (zh) 電子裝置以及開機方法
US9239725B2 (en) System and method for installing an OS via a network card supporting PXE
WO2012079301A1 (zh) 移动终端的触摸屏固件升级方法及装置
JP2015049906A (ja) 安全なブートromパッチのためのシステム及び方法
US10810311B2 (en) Internet-of-things module
WO2017000567A1 (zh) 一种实现bootrom升级的方法及装置
US20130166893A1 (en) Auxiliary card initialization routine
CN105808978A (zh) 一种基于单片机固件的硬件防盗版方法及系统
US7970433B2 (en) SD switch box in a cellular handset
WO2017050110A1 (zh) 一种嵌入式系统的软件代码防盗方法及装置
WO2020158377A1 (ja) 電子制御装置、電子制御装置のセキュリティ検証方法
WO2018059565A1 (zh) 闪存数据的备份方法及系统
US10725845B2 (en) Methods of operating memory system
US20080235436A1 (en) Storage access control
KR101620349B1 (ko) 부팅가능한 휘발성 메모리 장치와 그를 구비한 메모리 모듈 및 프로세싱 시스템, 및 그를 이용한 프로세싱 시스템 부팅 방법
CN104679535A (zh) 伺服器以及识别码同步方法
JP2010277578A (ja) 電子装置及びそのブーティング方法
WO2017076034A1 (zh) 一种对移动终端的存储器进行格式化的方法和装置
US20190095219A1 (en) Method for intel platform detection of parameters in flash rom
CN111124462B (zh) 一种嵌入式多媒体卡更新方法、装置、服务器和存储介质
US10761834B2 (en) SSD firmware download dual boot
CN113646745A (zh) 禁用软件持久性
CN116028100B (zh) 软件版本升级方法和电子设备
TW201324155A (zh) 快閃記憶體儲存系統及其資料保護方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16847992

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16847992

Country of ref document: EP

Kind code of ref document: A1