Important code protection method, system, storage medium and electronic device

By storing placeholder function codes in the target random access memory of the embedded system, and using hash algorithms and preset algorithms for security authentication, it ensures that only the target function code provided by the trusted server can be replaced and executed, solving important problems in embedded systems. The problem of code being easily leaked when stored in non-volatile memory is achieved to achieve code security and leakage prevention during transmission.

CN118350065BActive Publication Date: 2024-09-03FENGFAN BEIJING TECHONOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410775281.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-09-03
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

In embedded systems, important codes are stored in non-volatile memory and are easily leaked after the non-volatile memory is stolen.

Method used

By storing the placeholder function code in the target random access memory and using preset algorithms and hash algorithms for security authentication, it is ensured that only the target function code provided by the trusted server can replace the placeholder function code for execution, and the target function code is stored on the trusted server. , even if the hardware is stolen, it cannot be leaked.

Benefits of technology

It effectively prevents important codes from being leaked after the non-volatile memory is stolen. Through the characteristics of secure authentication transmission and volatile random access memory, the security of the code during transmission and storage is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118350065B
    Figure CN118350065B
Patent Text Reader

Abstract

The present invention provides an important code protection method, system, storage medium and electronic device, the method comprising: receiving request information, and accessing the target position of the target random access memory according to the request information, a placeholder function code is set in the target position of the target random access memory, and judging whether the value returned by the placeholder function is a preset value; if so, determining the download request information according to the preset value through a preset algorithm, and transmitting the download request information to a trusted server, so that the trusted server confirms whether the download request end is credible through a preset method; receiving reply data of the trusted server confirming the download request information, determining the target function code according to the reply data, then replacing the placeholder function code with the target function code, and executing the target function code. The present invention solves the problem in the prior art that the code is stored on a non-volatile memory, and the important code is easily leaked after the non-volatile memory is stolen.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer software technology, and in particular to an important code protection method, system, storage medium and electronic equipment. Background Art

[0002] An embedded system consists of hardware and software. It is a device that can operate independently. Its software content only includes the software operating environment and its operating system. The hardware content includes many aspects such as signal processors, memory, communication modules, etc. Compared with general computer processing systems, embedded systems are quite different. It cannot realize large-capacity storage functions because there is no large-capacity medium that matches it. Most of the storage media used are E-PROM, EEPROM, etc. The software part uses the API programming interface as the core of the development platform.

[0003] Usually, the software of embedded systems is stored in non-volatile memory NVM (Non Volatile Memory), and general non-volatile memory includes FLASH, ROM, eFuse, etc. The source code of embedded systems is compiled to generate the target code on a specific machine and stored in the non-volatile memory, that is, the machine language code. However, in this storage method, after using specific technical means to read all the binary target codes from the non-volatile memory, after disassembly, the implementation method of the source code can be inferred, resulting in the theft of important codes. Summary of the invention

[0004] Based on this, the purpose of the present invention is to provide an important code protection method, system, storage medium and electronic device, aiming to solve the problem in the prior art that the code is stored in a non-volatile memory and the important code is easily leaked after the non-volatile memory is stolen.

[0005] An important code protection method according to an embodiment of the present invention comprises:

[0006] Receive request information, and access a target location of a target random access memory according to the request information, wherein a placeholder function code is provided in the target location of the target random access memory, and determine whether a value returned by the placeholder function is a preset value;

[0007] If yes, determining the download request information by a preset algorithm according to the preset value, and transmitting the download request information to the trusted server, so that the trusted server confirms whether the download request end is credible by a preset method;

[0008] Receive reply data of the trusted server confirming completion of the download request information, determine the target function code according to the reply data, replace the placeholder function code with the target function code, and execute the target function code.

[0009] In addition, an important code protection method according to the above embodiment of the present invention may also have the following additional technical features:

[0010] Further, replacing the placeholder function code with the target function code and executing the target function code comprises:

[0011] The operating status of the debugger is determined according to a preset sensor device, and if the debugger is running, the target random access memory is controlled to be in a power-off state.

[0012] Further, replacing the placeholder function code with the target function code and executing the target function code comprises:

[0013] The number and time of this call of the target function code are determined according to the request information. When the real-time call of the target function code and the time are consistent with the request information, the placeholder function code is obtained through a preset non-volatile memory, and the target function code is replaced with the placeholder function code.

[0014] Further, the step of determining the download request information by a preset algorithm according to the preset value includes:

[0015] Generate a random number and determine a first hash value through a hash algorithm according to the preset value;

[0016] A second Hash value is determined by the Hash algorithm according to the first Hash value and the random number, and the first Hash value, the random number and the second Hash value are the download request information.

[0017] Furthermore, the preset method is:

[0018] Determine a third Hash value by using the Hash algorithm according to the first Hash value and the random number, and determine whether the second Hash value is consistent with the third Hash value;

[0019] If so, the download request end is credible, and the reply data is determined according to the download information, and then the reply data is returned to the download request end.

[0020] Further, the step of determining the reply data according to the download information includes:

[0021] Determine the target function code according to the comparison between the first hash value and a preset hash library, sum the numbers at each position of the random number to determine a sum value, and determine the target public key according to the unit digit value of the sum value;

[0022] The encrypted information is determined by the target public key according to the target function code, and a verification hash value is determined by a hash algorithm according to the sum value, and the verification hash value and the encrypted information constitute the reply data.

[0023] Further, the step of determining the target function code according to the reply data includes:

[0024] Summing the random numbers to obtain the sum value, determining a verification hash value through the hash algorithm according to the sum value, and judging whether the verification hash value is consistent with the verification hash value;

[0025] If so, determine the target private key according to the unit digit value of the summation value, and determine the target function code through the target private key according to the encrypted information.

[0026] Another object of the present invention is a critical code protection system, the system comprising:

[0027] A request determination module, configured to receive request information, access a target location of a target random access memory according to the request information, wherein a placeholder function code is provided in the target location of the target random access memory, and determine whether a value returned by the placeholder function is a preset value;

[0028] A download request module, configured to determine download request information by a preset algorithm according to the preset value when the value returned by the target random access memory is a preset value, and transmit the download request information to a trusted server, so that the trusted server confirms whether the download request end is credible by a preset method;

[0029] The code replacement module is used to receive the reply data of the trusted server confirming the completion of the download request information, determine the target function code according to the reply data, replace the placeholder function code with the target function code, and execute the target function code.

[0030] Another object of an embodiment of the present invention is to provide a storage medium having a computer program stored thereon, wherein the program implements the steps of the above-mentioned important code protection method when executed by a processor.

[0031] Another object of an embodiment of the present invention is to provide an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned important code protection method when executing the program.

[0032] The present invention stores the placeholder function on the target random access memory, that is, on the RAM, so that when the target function needs to be called, the target random access memory is first accessed to obtain the value replied by the placeholder function, so that it is known that the target function is not in the hardware, and then the trusted server is requested to provide the target function for downloading. After the trusted server confirms that the requesting end is a safe end, the download data is replied, the target function code is obtained according to the download data, and the placeholder function is replaced, so as to realize the calling of the target function. Since the target function, that is, the important function code, is stored on the trusted server, even if the hardware of the embedded system is stolen, the important code will not be leaked. In addition, the security of the server and the requesting end is guaranteed through the secure authentication transmission, and the leakage of the important code in the data transmission is avoided. In addition, by setting the target function in the random access memory for calling and running, due to the volatility of the random access memory, when the target function is called, if the outside world steals and reads the target function code, by cutting off the power of the random access memory, all the codes in the random access memory are lost and cannot be retrieved, further preventing the situation of the target function being stolen when called. Therefore, the present invention solves the problem in the prior art that the code is stored in a non-volatile memory and important codes are easily leaked after the non-volatile memory is stolen. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 is a flow chart of an important code protection method in a first embodiment of the present invention;

[0034] Figure 2 A schematic diagram of the result of the important code protection system in the second embodiment of the present invention;

[0035] Figure 3 is a schematic structural diagram of an electronic device in a third embodiment of the present invention;

[0036] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0037] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0038] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.

[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0040] Embodiment 1

[0041] See also Figure 1 , which shows an important code protection method in the first embodiment of the present invention, and the method specifically includes steps S01 to S03.

[0042] S01, receiving request information, and accessing a target position of a target random access memory according to the request information, wherein a placeholder function code is provided in the target position of the target random access memory, and determining whether a value returned by the placeholder function is a preset value;

[0043] In specific implementation, by setting a placeholder function code in the target position of the target random access memory, the compiler will allocate a section of memory in the RAM for program running, so that after downloading the target function code, the placeholder code can be directly replaced to realize the running and calling of the target function code. In addition, by setting a specific placeholder function code, when accessing the target position of the target random access memory according to the request information, the placeholder function will return a specific value to the terminal to remind the terminal that it needs to download the target function code from the trusted server before executing the call, and the special value is used for the subsequent security authentication of the trusted server and confirming the corresponding target function code.

[0044] S02: If yes, determine the download request information by using a preset algorithm according to the preset value, and transmit the download request information to the trusted server, so that the trusted server confirms whether the download request end is credible by using a preset method;

[0045] Specifically, the step of determining the download request information according to the preset value through the preset algorithm includes: generating a random number and determining a first hash value through the hash algorithm according to the preset value; determining a second hash value through the hash algorithm according to the first hash value and the random number, and the first hash value, the random number and the second hash value are the download request information. In addition, the preset method includes: determining a third hash value through the hash algorithm according to the first hash value and the random number, and judging whether the second hash value and the third hash value are consistent; if so, the download request end is credible, and the reply data is determined according to the download information, and then the reply data is returned to the download request end. In addition, the step of determining the reply data according to the download information includes: determining the target function code according to the comparison of the first hash value with the preset hash library, summing the numbers at each position of the random number to determine the sum value, and determining the target public key according to the unit digit value of the sum value; determining the encryption information through the target public key according to the target function code, and determining the verification hash value through the hash algorithm according to the sum value, and the verification hash value and the encryption information constitute the reply data.

[0046] In the specific implementation, after determining that the return value is a preset value, it is necessary to download the target function code to the server, generate a random number, perform a hash operation on the preset value to obtain a first hash value, and perform a hash operation on the random number and the first hash value to obtain a second hash value, and send the first hash value, the random number and the second hash value to the trusted server, so that the trusted server can obtain a third hash value according to the hash operation. When the second hash value and the third hash value are consistent, it means that the hash operation methods of the trusted server and the requesting terminal are consistent, and the identity of the requesting terminal can be confirmed. Since the verification of this method includes the existence of a random number, replay attacks are avoided, making the verification method safer. In addition, when the target function code is determined by comparing the first hash value with the hash library, since the corresponding relationship between each target function code in the trusted server is determined by the hash value, after the trusted server is invaded and the requesting terminal is stolen, even if the target function code is stolen, due to the lack of a logical relationship between the target function code and each running code of the requesting terminal, the code is meaningless to the thief. In addition, by setting up multiple independent trusted servers and storing a different part of the target function code on each server, the requesting end can download different parts of the target function code from different trusted servers, thereby further protecting the target function code. Even if the data in one of the trusted servers or multiple trusted servers is stolen, since the correspondence of the target function code is associated with the hash value, and the hash value itself does not have any information, the thief cannot piece together the complete target function code.

[0047] In addition, the random numbers are summed to obtain the sum value, and the public key for this data transmission is determined based on the mantissa of the sum value. The random numbers are further combined to improve the security of data transmission and ensure that the target function code will not be leaked. In addition, the sum value is hashed to obtain the verification hash value, so that after the requesting terminal receives the reply data, it will be verified based on the verification hash value to ensure that the reply data is sent by the trusted terminal and avoid receiving and reading external virus information.

[0048] S03, receiving reply data of the trusted server confirming completion of the download request information, determining the target function code according to the reply data, replacing the placeholder function code with the target function code, and executing the target function code;

[0049] Specifically, the step of determining the target function code according to the reply data includes: summing the random numbers to obtain the sum value, determining the verification hash value through the hash algorithm according to the sum value, and judging whether the verification hash value is consistent with the verification hash value; if so, determining the target private key according to the units digit value of the sum value, and determining the target function code according to the encrypted information through the target private key.

[0050] By summing the random numbers to obtain the sum value, and performing a hash operation on the sum value to obtain the verification hash value, the verification hash value and the verification hash value can be compared to verify that the received reply data is sent by the trusted server, thereby avoiding receiving and reading external virus information. In addition, the target private key is determined according to the unit digit value of the sum value to decrypt the encrypted information, thereby improving the security of the data.

[0051] In addition, when the target function is called, the operation status of the debugger is determined according to the preset sensor device. If the debugger is running, the target random access memory is controlled to be in a power-off state. Since the target function code is stored in the target random access memory, due to the volatility of the target random access memory, when it is found that there is an external device that wants to read it, the target random access memory is powered off, so that the target function code in the target random access memory is lost, thereby preventing the target function code from being stored on the hardware and being obtained by others by stealing the hardware device.

[0052] In addition, after the target function call is completed, the placeholder function code stored in the preset non-volatile memory is obtained to replace the target function code, so that the state at that location is reset to prevent the target function code from being leaked.

[0053] In summary, the important code protection method in the above embodiment of the present invention stores the placeholder function on the target random access memory, that is, on the RAM, so that when the target function needs to be called, the target random access memory is first accessed to obtain the value of the placeholder function reply, so that it is known that the target function is not in the hardware, and then the trusted server is requested to provide the target function for downloading. After the trusted server confirms that the requesting end is a safe end, the download data is replied, the target function code is obtained according to the download data, and the placeholder function is replaced, so as to realize the call of the target function. Since the target function, that is, the important function code, is stored on the trusted server, even if the hardware of the embedded system is stolen, the important code will not be leaked. In addition, the security of the server and the requesting end is guaranteed through the secure authentication transmission, and the leakage of the important code in the data transmission is avoided. In addition, by setting the target function in the random access memory for calling and running, due to the volatility of the random access memory, when the target function is called, if the outside world steals and reads the target function code, by powering off the random access memory, all the codes in the random access memory are lost and cannot be retrieved, further preventing the target function from being stolen when it is called. Therefore, the present invention solves the problem in the prior art that the code is stored in a non-volatile memory and important codes are easily leaked after the non-volatile memory is stolen.

[0054] Embodiment 2

[0055] See also Figure 2 , which is a structural block diagram of an important code protection system proposed in the second embodiment of the present invention, the important code protection system 200 comprises: a request judgment module 21, a download request module 22 and a code replacement module 23, wherein:

[0056] A request determination module 21 is used to receive request information, access a target location of a target random access memory according to the request information, a placeholder function code is set in the target location of the target random access memory, and determine whether a value returned by the placeholder function is a preset value;

[0057] A download request module 22, configured to determine download request information by a preset algorithm according to the preset value when the value returned by the target random access memory is a preset value, and transmit the download request information to a trusted server, so that the trusted server confirms whether the download request end is credible by a preset method;

[0058] The code replacement module 23 is used to receive the reply data of the trusted server completing the confirmation according to the download request information, determine the target function code according to the reply data, replace the placeholder function code with the target function code, and execute the target function code.

[0059] Furthermore, in other embodiments of the present invention, the important code protection system 200 includes:

[0060] The calling judgment module is used to determine the running status of the debugger according to the preset sensor device, and if the debugger is running, the target random access memory is controlled to be in a power-off state.

[0061] A code replacement module is used to determine the number and time of the current call of the target function code according to the request information. When the real-time call number and time of the target function code are consistent with the request information, the placeholder function code is obtained through a preset non-volatile memory, and the target function code is replaced with the placeholder function code.

[0062] Further, in other embodiments of the present invention, the download request module 22 includes:

[0063] An initial request information determining unit, configured to generate a random number and determine a first hash value through a hash algorithm according to the preset value;

[0064] The download request information determining unit is used to determine a second Hash value through the Hash algorithm according to the first Hash value and the random number, and the first Hash value, the random number and the second Hash value are the download request information.

[0065] a request verification unit, configured to determine a third hash value by using the hash algorithm according to the first hash value and the random number, and determine whether the second hash value is consistent with the third hash value;

[0066] The download reply unit is used to determine whether the second hash value and the third hash value are consistent, that the download request end is credible, and determine the reply data according to the download information, and then return the reply data to the download request end.

[0067] Further, in other embodiments of the present invention, the code replacement module 23 includes:

[0068] an encryption public key determination unit, configured to determine the target function code by comparing the first hash value with a preset hash library, summing the numbers at each position of the random number to determine a sum value, and determining a target public key according to the unit digit value of the sum value;

[0069] A reply data determination unit is used to determine the encryption information according to the target function code through the target public key, and determine the verification hash value through a hash algorithm according to the sum value, and the verification hash value and the encryption information constitute the reply data.

[0070] A reply data verification unit is used to sum the random numbers to obtain the sum value, determine the verification hash value through the hash algorithm according to the sum value, and judge whether the verification hash value is consistent with the verification hash value;

[0071] The decryption calling unit is used to determine the target private key according to the unit digit value of the sum value when the check hash value is consistent with the verification hash value, and determine the target function code according to the encrypted information through the target private key.

[0072] The functions or operation steps implemented when the above modules are executed are substantially the same as those in the above method embodiments, and will not be repeated here.

[0073] Embodiment 3

[0074] Another aspect of the present invention provides an electronic device, see Figure 3 , shown is a schematic diagram of an electronic device in the third embodiment of the present invention, including a memory 20, a processor 10, and a computer program 30 stored in the memory and executable on the processor, wherein the processor 10 implements the important code protection method as described above when executing the computer program 30.

[0075] In some embodiments, the processor 10 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 20, such as executing access restriction programs.

[0076] Among them, the memory 20 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 20 can be an internal storage unit of an electronic device, such as a hard disk of the electronic device. In other embodiments, the memory 20 can also be an external storage device of an electronic device, such as a plug-in hard disk equipped on the electronic device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Further, the memory 20 can also include both an internal storage unit of the electronic device and an external storage device. The memory 20 can not only be used to store application software and various types of data of the electronic device, but also can be used to temporarily store data that has been output or is to be output.

[0077] It should be pointed out that Figure 3The structure shown does not constitute a limitation on the electronic device. In other embodiments, the electronic device may include fewer or more components than those shown in the figure, or combine certain components, or arrange the components differently.

[0078] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the important code protection method as described above is implemented.

[0079] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0080] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0081] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0082] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0083] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention patent shall be subject to the attached claims.

Claims

1. An important code protection method, It is characterized in that The method comprises: Receive request information, and access a target location of a target random access memory according to the request information, wherein a placeholder function code is provided in the target location of the target random access memory, and determine whether a value returned by the placeholder function is a preset value; If yes, determining the download request information by a preset algorithm according to the preset value, and transmitting the download request information to the trusted server, so that the trusted server confirms whether the download request end is credible by a preset method; receiving reply data of the trusted server confirming completion of the download request information, determining a target function code according to the reply data, replacing the placeholder function code with the target function code, and executing the target function code; The step of determining the download request information by using a preset algorithm according to the preset value comprises: Generate a random number and determine a first hash value through a hash algorithm according to the preset value; A second Hash value is determined by the Hash algorithm according to the first Hash value and the random number, and the first Hash value, the random number and the second Hash value are the download request information.

2. The important code protection method according to claim 1, It is characterized in that After the step of replacing the placeholder function code with the target function code and executing the target function code, the method further comprises: The operating status of the debugger is determined according to a preset sensor device, and if the debugger is running, the target random access memory is controlled to be in a power-off state.

3. The important code protection method according to claim 1, It is characterized in that After the step of replacing the placeholder function code with the target function code and executing the target function code, the method further comprises: The number and time of this call of the target function code are determined according to the request information. When the real-time call of the target function code and the time are consistent with the request information, the placeholder function code is obtained through a preset non-volatile memory, and the target function code is replaced with the placeholder function code.

4. The important code protection method according to claim 1, It is characterized in that The preset method is: Determine a third Hash value by using the Hash algorithm according to the first Hash value and the random number, and determine whether the second Hash value is consistent with the third Hash value; If so, the download request end is credible, and the reply data is determined according to the download information, and then the reply data is returned to the download request end.

5. The important code protection method according to claim 4, It is characterized in that The step of determining the reply data according to the download information comprises: Determine the target function code according to the comparison between the first hash value and a preset hash library, sum the numbers at each position of the random number to determine a sum value, and determine the target public key according to the unit digit value of the sum value; The encrypted information is determined by the target public key according to the target function code, and a verification hash value is determined by a hash algorithm according to the sum value, and the verification hash value and the encrypted information constitute the reply data.

6. The important code protection method according to claim 5, It is characterized in that The step of determining the target function code according to the response data comprises: Summing the random numbers to obtain the sum value, determining a verification hash value through the hash algorithm according to the sum value, and judging whether the verification hash value is consistent with the verification hash value; If so, determine the target private key according to the unit digit value of the summation value, and determine the target function code through the target private key according to the encrypted information.

7. An important code protection system, It is characterized in that For implementing the important code protection method as claimed in any one of claims 1 to 6, the system comprises: A request determination module, configured to receive request information, access a target location of a target random access memory according to the request information, wherein a placeholder function code is provided in the target location of the target random access memory, and determine whether a value returned by the placeholder function is a preset value; A download request module, configured to determine download request information by a preset algorithm according to the preset value when the value returned by the target random access memory is a preset value, and transmit the download request information to a trusted server, so that the trusted server confirms whether the download request end is credible by a preset method; The code replacement module is used to receive the reply data of the trusted server confirming the completion of the download request information, determine the target function code according to the reply data, replace the placeholder function code with the target function code, and execute the target function code.

8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the steps of the important code protection method according to any one of claims 1 to 6 are implemented.

9. An electronic device, It is characterized in that The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the important code protection method as claimed in any one of claims 1 to 6 is implemented.