Memory module and control method thereof, and electronic system

By realizing key verification and decryption of startup loading files and application files in the memory module's storage controller, the security problem of the memory module during startup and operation is solved, and the security and reliability of the module are improved.

CN119357979BActive Publication Date: 2025-05-06XI AN UNIIC SEMICON CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411896008.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-05-06
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

With the improvement of memory module performance, module safety issues have gradually attracted attention, and the prior art is difficult to effectively solve the security issues of memory modules during startup and operation.

Method used

By implementing a control method in the memory controller of the memory module, it includes key verification and decryption of the startup load file and the application file during the module startup boot stage, ensuring the integrity and security of the file.

Benefits of technology

By performing key verification and decryption of startup loading files and application files, we ensure that the files are not tampered with or damaged during startup and operation, improving the security and reliability of the memory module.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357979B_ABST
    Figure CN119357979B_ABST
Patent Text Reader

Abstract

The present disclosure provides a memory module and a control method thereof, and an electronic system. The memory module includes a memory controller and a first memory, the first memory is used to store a boot loader file and an encrypted application file, and the method is executed in the memory controller. The method includes: in the module boot boot phase, reading the boot loader file from the first memory, verifying the boot loader file based on a preset first key, and if the verification passes, controlling the boot loader file to start; when the boot loader file is started, reading the application file from the first memory, verifying the application file based on a preset second key, and if the verification passes, decrypting the application file based on a preset third key, and controlling the application file to start after the application file is decrypted. The present application can realize the secure startup of the memory module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of memory technology, and in particular to a memory module and a control method thereof, and an electronic system. Background Art

[0002] With the development of electronic technology, various electronic products have increasing performance requirements for memory.

[0003] At present, in order to improve the performance of memory, some integrated memory modules have come into being. However, as the performance of memory modules improves, the module safety issues brought about should also be taken seriously. Summary of the invention

[0004] In view of the above problems, the present invention is proposed to provide a memory module and a control method thereof, and an electronic system that overcome the above problems or at least partially solve the above problems.

[0005] A first aspect of an embodiment of the present application provides a control method for a memory module, wherein the memory module includes a memory controller and a first memory connected to each other, wherein the first memory is used to store a boot loading file and an encrypted application file, and the method is executed by the memory controller, and the method includes:

[0006] In the module startup booting stage, the startup loading file is read from the first memory, the startup loading file is verified based on a preset first key, and if the verification passes, the startup loading file is controlled to start;

[0007] When the startup of the boot loader file is completed, the application file is read from the first memory, and the application file is verified based on the preset second key. If the verification passes, the application file is decrypted based on the preset third key. After the decryption of the application file is completed, the startup of the application file is controlled.

[0008] Optionally, the first key includes a first public key and a first private key, the first private key is used to sign the encrypted value of the boot loading file, the storage controller has a preset storage space, the storage space is used to store the encrypted value of the first public key, and the first memory is used to store the signed boot loading file; the verifying the boot loading file based on the preset first key includes:

[0009] Encrypting the first public key to obtain a first encrypted value to be verified;

[0010] Reading the encrypted value of the first public key from the storage space, and if the first encrypted value to be verified is consistent with the encrypted value of the first public key, decrypting the signed boot loader file based on the first public key to obtain a second encrypted value to be verified;

[0011] If the second encrypted value to be verified is consistent with the encrypted value of the startup loading file, the verification passes.

[0012] Optionally, the second key includes a second public key and a second private key, the second private key is used to sign the encrypted value of the application file, the storage controller has a preset storage space, the storage space is used to store the encrypted value of the second public key, and the first memory is used to store the signed application file; the verifying the application file based on the preset second key includes:

[0013] Encrypting the second public key to obtain a third encrypted value to be verified;

[0014] Reading the encrypted value of the second public key from the storage space, and if the third encrypted value to be verified is consistent with the encrypted value of the second public key, decrypting the signed application file based on the second public key to obtain a fourth encrypted value to be verified;

[0015] If the fourth encrypted value to be verified is consistent with the encryption value of the application file, the verification passes.

[0016] Optionally, the third key includes a first subkey and a second subkey, the first subkey is used to encrypt the second subkey, the second subkey is used to encrypt the application file, and the decrypting the application file based on the preset third key includes:

[0017] decrypting the encrypted second subkey based on the first subkey;

[0018] The encrypted application file is decrypted based on the second subkey.

[0019] Optionally, the boot loader file and the application file constitute a firmware file, there are multiple firmware files, and the multiple firmware files include a first firmware file and a second firmware file. The method further includes:

[0020] When the first firmware file fails to start, marking the event of the first firmware file failing to start in a preset marking area, and resetting the memory module;

[0021] When the memory module enters the booting phase again, the booting verification of the second firmware file is switched according to the mark information of the preset mark area.

[0022] Optionally, the memory module further includes a second memory, the second memory is used for persistently storing data, the storage controller includes a first interface and a second interface, the first interface is used to connect to an external main control component, and the second interface is connected to the second memory, and the method further includes:

[0023] The communication data with the main control component is persistently stored in the second memory.

[0024] Optionally, the storage controller further includes a cache module, the cache module is connected to the first interface and the second interface, and is used to cache communication data with the main control component, and the persistent storage of the communication data with the main control component in the second memory includes:

[0025] The communication data with the main control component is cached in the cache module, and when the cache data in the cache module meets a preset condition, the cache data is persistently stored in the second memory.

[0026] Optionally, the communication data includes first data and second data, the first data is data between the main control component and the storage controller, the second data is data inside the storage controller and between the storage controller and the second memory, and the persistently storing the communication data with the main control component in the second memory includes:

[0027] When receiving a trigger signal sent by the main control component, persistently storing the second data in the second memory;

[0028] When the main control component detects power failure, the main control component sends the first data to the storage controller so that the first data is converted into the second data, and then sends the trigger signal.

[0029] Optionally, the storage controller further includes an energy storage module, the energy storage module is used to provide backup power supply to the storage controller and the second memory, and the persistent storage of the communication data with the main control component in the second memory includes:

[0030] When it is detected that the storage controller is powered off, the communication data inside the storage controller and between the storage controller and the second memory are persistently stored in the second memory.

[0031] Optionally, the boot loading file and the application file constitute a firmware file, the storage controller includes a first interface, the first interface is used to connect to an external main control component, there are multiple first interfaces, and the communication protocols between each first interface and the main control component are different, and the method further includes:

[0032] The firmware file is upgraded based on one or more of the first interfaces.

[0033] A second aspect of an embodiment of the present application provides a memory module, comprising: a storage controller and a first memory connected to each other, the first memory being used to store a boot loading file and an encrypted application file, the storage controller being used to load and execute to implement operations performed by any of the methods described in the first aspect.

[0034] Optionally, the memory module also includes a second memory, which is used to persistently store data. The storage controller includes a first interface and a second interface, the first interface is used to connect to an external main control component, and the second interface is connected to the second memory.

[0035] Optionally, the storage controller further includes a third interface, and the third interface is used to connect to an external random access memory.

[0036] A third aspect of an embodiment of the present application provides an electronic system, including:

[0037] Main control components;

[0038] In the memory module as described in any one of the second aspects, the storage controller is connected to the main control component.

[0039] A fourth aspect of an embodiment of the present application provides a control device for a memory module, wherein the memory module includes a memory controller and a first memory connected to each other, the first memory is used to store a boot loading file and an encrypted application file, the method is executed in the memory controller, and the device includes:

[0040] A first control unit is used to read the startup loading file from the first memory during the module startup booting phase, verify the startup loading file based on a preset first key, and control the startup loading file to start if the verification passes;

[0041] The second control unit is used to read the application file from the first memory when the startup loading file is started, verify the application file based on a preset second key, and if the verification passes, decrypt the application file based on a preset third key, and control the startup of the application file after the decryption of the application file is completed.

[0042] The technical solution provided in the embodiments of the present application has at least the following technical effects or advantages:

[0043] The control method of the memory module provided in the embodiment of the present application, the memory module includes a memory controller and a first memory, the first memory is used to store a boot load file and an encrypted application file, the method is executed in the memory controller, and the method includes: in the boot boot phase of the module, the boot load file is read from the first memory, the boot load file is verified based on a preset first key, if the verification passes, the boot load file is controlled to start; when the boot load file is started, the application file is read from the first memory, the application file is verified based on a preset second key, if the verification passes, the application file is decrypted based on a preset third key, and after the application file is decrypted, the application file is controlled to start. Therefore, by verifying the boot load file and the application file when the module is started, it can be ensured that the boot load file and the application file have not been tampered with or damaged, thereby ensuring the safe operation of the memory module.

[0044] The above description is only an overview of the technical solution provided by the embodiment of the present application. In order to more clearly understand the technical means of the embodiment of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present application more obvious and easy to understand, the specific implementation method of the embodiment of the present application is listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present disclosure. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0046] Figure 1 A schematic diagram showing the structure of a memory module according to an embodiment of the present application is shown;

[0047] Figure 2 A flow chart showing a method for controlling a memory module according to an embodiment of the present application is shown;

[0048] Figure 3 A flowchart of starting loading file verification in an embodiment of the present application is shown;

[0049] Figure 4 A flowchart of application file verification in an embodiment of the present application is shown;

[0050] Figure 5 A flowchart of application file decryption in an embodiment of the present application is shown;

[0051] Figure 6 A rollback flowchart of a firmware file in an embodiment of the present application is shown;

[0052] Figure 7 A flowchart of data persistence storage according to an embodiment of the present application is shown;

[0053] Figure 8 A schematic diagram of the architecture of the firmware file version upgrade in an embodiment of the present application is shown;

[0054] Fig. 9 A structural diagram of a control device of a memory module according to an embodiment of the present application is shown;

[0055] Fig.10 A structural diagram of an electronic system according to an embodiment of the present application is shown.

[0056] Among them, 1-storage controller; 11-first interface; 12-second interface; 13-cache module; 14-energy storage module; 15-third interface; 16-data processing module; 2-first memory; 3-second memory; 4-main control component. DETAILED DESCRIPTION

[0057] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present disclosure and to be able to fully convey the scope of the present disclosure to those skilled in the art. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0058] Various structural schematic diagrams according to embodiments of the present disclosure are shown in the accompanying drawings. These figures are not drawn to scale, and some details are magnified and some details may be omitted for the purpose of clear expression. The shapes of various regions and layers shown in the figures and the relative sizes and positional relationships therebetween are only exemplary, and may deviate in practice due to manufacturing tolerances or technical limitations, and those skilled in the art may further design regions / layers with different shapes, sizes, and relative positions according to actual needs.

[0059] For ease of understanding, the memory module of the embodiment of the present application is first exemplarily described below.

[0060] See also Figure 1 , showing a schematic structural diagram of a memory module according to an embodiment of the present application.

[0061] like Figure 1As shown, the memory module includes a memory controller 1 and a first memory 2 which are connected to each other, and the first memory 2 is used to store a boot loading file and an encrypted application file.

[0062] It is understandable that in order to realize the operation of the memory module, it is necessary to set firmware, which includes the boot loading file and the application file, that is, the boot loading file includes the boot loading program that boots the module, and the application file includes the main program required for the module operation.

[0063] Exemplarily, the memory module in the embodiment of the present application may be a non-volatile memory module (PEME, Persist Memory) with a CXL (Compute ExpressLink, open industry standard) interface, wherein CXL can provide good data throughput and lower latency for the memory module. Thus, the memory module can communicate with an external main control component 4 based on the CXL interface, wherein the main control component 4 includes but is not limited to: a CPU (Central Processing Unit, central processing unit), such as a CPU on a server, or a CPU on a PC (Computer, computer).

[0064] It should be noted that the startup loading file can be a bootloader file, which is used to run before the operating system of the memory module runs, such as initializing the module's hardware devices, establishing a storage space mapping map, etc., so as to provide a prepared operating environment for the module's operating system.

[0065] It should be noted that the application file may be an application program (APP) inside the module. Under the control of the storage controller 1 , the application program may implement interaction between the storage controller 1 and other components (eg, various storage media) in the module.

[0066] See also Figure 2 , showing a flow chart of a control method for a memory module of an embodiment of the present application.

[0067] like Figure 2 As shown, a first aspect of an embodiment of the present application provides a control method for a memory module, the method being executed in the memory controller 1, the method comprising:

[0068] Step S10. In the module booting stage, the boot loading file is read from the first memory 2, and the boot loading file is verified based on a preset first key. If the verification passes, the boot loading file is controlled to start;

[0069] It should be noted that the module boot phase refers to the phase after the module is powered on and before the module's operating system starts running.

[0070] It is understandable that the first memory 2 may be a phase change memory PCM, a flash memory Flash, a resistive random access memory RRAM, etc., and the following description will be made taking the flash memory Flash as an example.

[0071] See also Figure 3 , showing a flowchart of starting loading file verification in an embodiment of the present application.

[0072] like Figure 3 As shown, in some embodiments, the first key includes a first public key and a first private key, the first private key is used to sign the encrypted value of the boot loading file, the storage controller has a preset storage space, the storage space is used to store the encrypted value of the first public key, and the first memory is used to store the signed boot loading file; the verifying the boot loading file based on the preset first key includes:

[0073] Step S11. Encrypt the first public key to obtain a first encrypted value to be verified;

[0074] Step S12: reading the encrypted value of the first public key from the storage space, and comparing the first encrypted value to be verified with the encrypted value of the first public key;

[0075] Step S13. If the first encrypted value to be verified is consistent with the encrypted value of the first public key, the signed boot loader file is decrypted based on the first public key to obtain a second encrypted value to be verified;

[0076] Step S14: If the second encrypted value to be verified is consistent with the encrypted value of the startup loading file, the verification passes.

[0077] It should be noted that before step S11, it can also be determined whether to verify the boot loading file based on the configuration items of the boot loading file, wherein the configuration items of the boot record file can be pre-stored in the first memory 2 and / or in a preset storage space of the storage controller 1, and the preset storage space can be OTP (One-Time Programmable, a one-time programmable memory) or EFUSE (Electronic Fuse, a solid-state memory that writes data once), and the configuration item can be, for example, "0" or "1", "0" indicates that there is no need to verify the boot loading file, and "1" indicates that the boot loading file needs to be verified.

[0078] It is understandable that the first key can be stored in the first memory 2 and / or the above-mentioned preset storage space, wherein the security level of the preset storage space is higher than that of the first memory 2, but the preset storage space generally supports one-time writing of data. Therefore, in the module testing phase, the first key can be read from the first memory 2 to improve the testing efficiency; and in the module application phase, the first key can be read from the preset storage space to ensure security.

[0079] It is understandable that there are a variety of encryption algorithms in the related technology, including but not limited to: symmetric encryption algorithms, asymmetric encryption algorithms and hash algorithms. Among them, the symmetric encryption algorithm has one key, and the same key is used for encryption and decryption, and the encryption and decryption speed is fast. Typical symmetric encryption algorithms include but are not limited to the DES algorithm, AES algorithm, RC4 algorithm, etc. The keys of the asymmetric encryption algorithm appear in pairs, namely public key and private key. The private key cannot be inferred from the public key, and vice versa, the public key cannot be inferred from the private key. Different keys are used for encryption and decryption. Public key encryption requires private key decryption, and vice versa, private key encryption requires public key decryption. Typical asymmetric encryption algorithms include but are not limited to RSA algorithm, DSA algorithm and DSS algorithm. Hash algorithm is an irreversible encryption algorithm, which is often used to verify the integrity of data.

[0080] In the embodiment of the present application, taking the combination of an asymmetric encryption algorithm and a hash algorithm as an example, the process of verifying the boot loading file based on a preset first key is described, and the exemplary description is as follows:

[0081] For each memory module, there is a unique first public key and a first private key. After the hash calculation of the boot loading file, the hash value of the boot loading file is obtained. The hash value of the boot loading file can be signed by the first private key, so that the boot loading file becomes ciphertext data. When verifying the boot loading file, the first public key is first hashed to obtain a first hash value to be verified, for example, the first hash value to be verified is calculated based on the SHA256 algorithm; then the first hash value to be verified is compared with the hash value of the first public key. If the two are consistent, it means that the first public key has not been tampered with or there is no abnormality. Then, the boot loading file signed by the first private key is decrypted based on the first public key to obtain a second hash value to be verified. If the second hash value to be verified is the same as the hash value of the boot loading file, it means that the first private key has not been tampered with or there is no abnormality, and the verification is passed. Among them, the RSA2048 algorithm or the RSA3072 algorithm can be used for calculation during the signature verification, for example, the RSA2048 algorithm is used; finally, after the verification is passed, the startup record file is controlled to start.

[0082] Step S20. When the startup of the boot loading file is completed, the application file is read from the first memory 2, and the application file is verified based on the preset second key. If the verification passes, the application file is decrypted based on the preset third key. After the decryption of the application file is completed, the startup of the application file is controlled.

[0083] See also Figure 4 , showing a flowchart of application file verification in an embodiment of the present application.

[0084] like Figure 4 As shown, in some embodiments, the second key includes a second public key and a second private key, the second private key is used to sign the encrypted value of the application file, the storage controller has a preset storage space, the storage space is used to store the encrypted value of the second public key, and the first memory is used to store the signed application file; the verification of the application file based on the preset second key includes:

[0085] Step S21: encrypt the second public key to obtain a third encrypted value to be verified;

[0086] Step S22. Read the encrypted value of the second public key from the storage space, and compare the third encrypted value to be verified with the encrypted value of the second public key;

[0087] Step S23. If the third encrypted value to be verified is consistent with the encrypted value of the second public key, decrypt the signed application file based on the second public key to obtain a fourth encrypted value to be verified;

[0088] Step S24: If the fourth encrypted value to be verified is consistent with the encryption value of the application file, the verification is successful.

[0089] It should be noted that before step S21, it can also be determined whether to verify the application file based on the configuration items of the application file, wherein the configuration items of the application file can be pre-stored in the first memory 2 and / or in a preset storage space of the storage controller 1, and the preset storage space can be OTP (One-Time Programmable) or EFUSE (Electronic Fuse, a solid-state memory that writes data once), and the configuration item can be, for example, "0" or "1", "0" indicates that there is no need to verify the application file, and "1" indicates that the application file needs to be verified.

[0090] It is understandable that the second key can be stored in the first memory 2 and / or the above-mentioned preset storage space, wherein the security level of the preset storage space is higher than that of the first memory 2, but the preset storage space generally supports one-time writing of data. Therefore, during the module testing phase, the second key can be read from the first memory 2 to improve the testing efficiency; and during the module application phase, the second key can be read from the preset storage space to ensure security.

[0091] In the embodiment of the present application, taking the combination of an asymmetric encryption algorithm and a hash algorithm as an example, the process of verifying the application file based on a preset second key is described, and the exemplary description is as follows:

[0092] For each memory module, there is a unique second public key and a second private key. After the hash calculation of the application file, the hash value of the application file is obtained. The hash value of the application file can be signed by the second private key, so that the application file becomes ciphertext data. When verifying the application file, the second public key is first hashed to obtain a third hash value to be verified, for example, the third hash value to be verified is calculated based on the SHA256 algorithm; then the third hash value to be verified is compared with the encrypted value of the second public key. If the two are consistent, it means that the first public key has not been tampered with or there is no abnormality. Then, based on the second public key, the application file signed by the second private key is decrypted to obtain a fourth hash value to be verified. If the fourth hash value to be verified is the same as the hash value of the application file, it means that the second private key has not been tampered with or there is no abnormality, and the verification is passed. Among them, the RSA2048 and RSA3072 algorithms can be used for calculation during the signature verification, for example, the RSA3072 algorithm is used; finally, after the verification is passed, the application file is controlled to start.

[0093] See also Figure 5 , showing a flowchart of application file decryption in an embodiment of the present application.

[0094] like Figure 5 As shown, in some embodiments, the third key includes a first subkey and a second subkey, the first subkey is used to encrypt the second subkey, the second subkey is used to encrypt the application file, and the decrypting the application file based on the preset third key includes:

[0095] Step S25. Decrypting the encrypted second subkey based on the first subkey;

[0096] Step S26: Decrypt the encrypted application file based on the second subkey.

[0097] It should be noted that when the memory module leaves the factory, the first subkey key1 can be built into the memory module, and the first subkey kye1 can be used as the unique identifier of the memory module; after the application file is generated, the application file can be encrypted based on the second subkey key2. When the second subkey key2 and the application file are stored in the first memory 2, in order to further improve the security of the second subkey key2, the second subkey key2 is encrypted by the first subkey key1 and then stored in the first memory 2. Then, even if the storage location of the second subkey key2 in the first memory 2 is obtained, the second subkey key2 cannot be directly read.

[0098] When the application file is started, the first subkey key1 is first used to decrypt the second subkey key2, and then the encrypted application file is decrypted using the second subkey key2, so that the application file can be safely started.

[0099] See also Figure 6 , shows a rollback flowchart of the firmware file of an embodiment of the present application.

[0100] like Figure 6 As shown, in some embodiments, the boot loader file and the application file constitute a firmware file, there are multiple firmware files, and the multiple firmware files include a first firmware file and a second firmware file, and the method further includes:

[0101] Step S30. When the first firmware file fails to start, the event of the first firmware file failing to start is marked in a preset marking area, and the memory module is reset;

[0102] It can be understood that the first firmware file and the second firmware file are merely used to distinguish different firmware files, and there is no substantial difference between the two.

[0103] The preset marking area can be a storage space inside the storage controller 1, which is used to mark the events of the firmware file that failed to start last time, including marking the boot loading file that failed to start and marking the application file that failed to start; thus, after the memory module is reset, the firmware file that failed to start last time can be excluded according to the marking information of the preset marking area, and the startup can be switched to other firmware files to improve the startup success rate of the memory module.

[0104] It is understandable that the firmware startup failure may be a firmware startup timeout, and the timeout information may be used to trigger a timer circuit (eg, a watchdog) to reset, thereby causing the memory module to reset.

[0105] It is understandable that if the firmware startup failure is caused by system power failure, the mark information in the preset mark area is cleared, so when the system is powered on next time, it may continue to control the startup of the first firmware file, that is, through one-by-one control until one of the firmware files is successfully started.

[0106] Step S31: When the memory module enters the booting phase again, switching to boot verification of the second firmware file according to the mark information of the preset mark area.

[0107] Based on the above disclosed content, the embodiment of the present application can ensure that the boot loading file and the application file have not been tampered with or damaged by verifying the boot loading file and the application file when the module is started, thereby ensuring the safe operation of the memory module; by setting multiple firmware files, when one or more firmware files fail to start, switching to other firmware files for startup verification, thereby improving the startup success rate of the memory module.

[0108] Continue to see Figure 1 In some embodiments, the memory module also includes a second memory 3, which is used for persistent storage of data. The storage controller 1 includes a data processing module 16, a first interface 11 and a second interface 12, wherein the first interface 11 is used to connect to an external main control component 4, and the second interface 12 is connected to the second memory 3, wherein the second memory 3 can be a phase change memory PCM (Phase Change Memory).

[0109] In some embodiments, the method further comprises:

[0110] Step S40 . Permanently store the communication data with the main control component 4 in the second memory 3 .

[0111] Exemplarily, when the communication data is persistently stored in the second memory 3, the main control component 4 communicates with the data processing module 16 and enters the storage controller 1 based on the first interface 11, and the data processing module 16 stores the data in the second memory 3 based on the second interface 12; in addition, the communication data can be refreshed to the second memory 3 in real time, or it can be refreshed to the second memory 3 in time before power failure, which will be explained separately below.

[0112] In some embodiments, the storage controller 1 further includes a cache module 13, the cache module 13 is connected to the first interface 11 and the second interface 12, and is used to cache communication data with the main control component 4, and the communication data with the main control component 4 is persistently stored in the second memory 3, including:

[0113] Step S41: Cache the communication data with the main control component 4 in the cache module 13, and when the cache data in the cache module 13 meets a preset condition, persistently store the cache data in the second memory 3.

[0114] Exemplarily, when the data processing module 16 receives communication data from the main control component 4 (such as a server), it can first cache the communication data to the cache module 13 (Cache) inside the storage controller 1 based on the first interface 11, and then when the cache data in the cache module 13 meets the preset conditions, the cache module 13 persistently stores the cache data to the second memory 3 through the second interface 12, wherein the preset conditions include one or more of the following combinations: the time interval for accessing the second memory 3 reaches a threshold, the number of accesses to the second memory 3 within a period of time is less than a threshold, new communication data needs to be written to the cache module 13 after the capacity of the cache module 13 reaches the capacity threshold, the storage controller 1 actively triggers the cache module 13 to migrate the communication data to the second memory 3, and simultaneously triggers writing to the second memory 3 when the communication data is written to the cache module 13.

[0115] It is understandable that when the communication data is persistently stored in the second memory 3, the data can also be refreshed to the second memory 3 in real time by a write-through method to achieve data persistence, and the second memory 3 provides read and write functions.

[0116] See also Figure 7 , showing a flowchart of data persistence storage in an embodiment of the present application.

[0117] In some embodiments, the communication data includes first data and second data, the first data is data between the main control component 4 and the storage controller 1, the second data is data inside the storage controller 1 and between the storage controller 1 and the second memory 3, and the communication data with the main control component 4 is persistently stored in the second memory 3, including:

[0118] When receiving the trigger signal sent by the main control component 4, the second data is persistently stored in the second memory 3;

[0119] When the main control component 4 detects power-off, it sends the first data to the storage controller 1 so that the first data is converted into the second data, and then sends the trigger signal.

[0120] like Figure 7As shown, in step S51, if the main control component 4 (such as the CPU of the server) detects power failure, then in step S52, the residual data (first data) between the CPU and the memory module is immediately flushed to the memory module and converted into second data, and in step S53, a trigger signal (such as a GPF (Global Power Fail) signal) is sent to the storage controller 1 to notify the storage controller 1 to store and back up the data inside the memory module as soon as possible to avoid data loss after power failure. In addition, after the memory module completes the data storage backup in step S54, if the system has not completely lost power at this moment, or the system motherboard can still supply power, the memory module can also feedback to the main control component 4 in step S55 that the data backup has been completed. In addition, after the memory module completes the data storage backup, the storage controller 1 marks the event of the completion of the data storage backup, for example, marks it in the storage space inside the first memory 2 or the storage controller 1, so that when the memory module is started next time, by detecting the mark, the data backup status of the memory module before the last power failure can be known, and if the data is abnormal or the data is unreliable, the data can be cleared for initialization.

[0121] In some embodiments, the storage controller 1 further includes an energy storage module 14, and the energy storage module 14 is used to provide backup power supply to the storage controller 1 and the second memory 3, and the communication data with the main control component 4 is persistently stored in the second memory 3, including:

[0122] When it is detected that the storage controller 1 is powered off, the communication data inside the storage controller 1 and between the storage controller 1 and the second memory 3 are persistently stored in the second memory 3 .

[0123] It is understandable that if the main control component 4 does not trigger the storage controller 1 to perform data storage backup, but the storage controller 1 detects power failure on its own, it means that the residual data between the main control component 4 and the memory module has been lost. At this time, the memory module needs to immediately perform persistent storage of the internal data to avoid data loss.

[0124] See also Figure 8 , showing a schematic diagram of the architecture of the firmware file version upgrade in an embodiment of the present application.

[0125] In some embodiments, the boot loading file and the application file constitute a firmware file, the storage controller 1 includes a first interface 11, the first interface 11 is used to connect to an external main control component 4, there are multiple first interfaces 11, and the communication protocols between each first interface 11 and the main control component 4 are different, and the method further includes:

[0126] The firmware file is upgraded based on one or more of the first interfaces 11 .

[0127] Exemplarily, the interface types of the first interface 11 include but are not limited to a CXL interface, an SMBUS (System Management Bus) interface and a UART (Universal Asynchronous Receiver / Transmitter) interface; the memory module can select one or more first interfaces 11 for firmware version upgrade.

[0128] It is understandable that the firmware file can be upgraded in an online or offline manner. During online upgrade, the memory module can interact with the server to achieve online upgrade.

[0129] The server uses an upgrade program that matches the memory module to upgrade the firmware file of the memory module, or the server uses a BMC (Baseboard Management Controller) to upgrade the firmware file of the memory module. Therefore, after the firmware version upgrade is completed, the server does not need to be restarted, and the updated firmware version can take effect directly.

[0130] During offline upgrade, the memory module can interact with the PC to achieve offline upgrade, and the firmware file can be upgraded through the firmware maintenance program preset in the PC.

[0131] In some embodiments, the controller module includes a third interface 15, and the third interface 15 is used to bridge with the NVDIMM module based on a protocol bridge (for example, CXL-NVDIMM Bridge (Compute Express Link non-volatile dual in-line memory module Bridge, high-speed interconnect bus and non-volatile dual in-line memory protocol bridge), so that all applications currently developed for NVDIMM devices can be ported to the memory module (for example, CXL-PMEM, Persist Memory) of the embodiment of the present application. Exemplarily, the application request for the memory module can be forwarded to the driver of the memory module through the CXL-NVDIMM Bridge, and then sent to the CXL-PMEM module based on the third interface 15, thereby expanding the application scenario of the memory module.

[0132] In some embodiments, when the memory module is used together with other memory devices, the user can choose ordinary memory or the memory module (CXL-PMEM) in the embodiment of the present application according to application requirements. For example, if the user has the need for persistent data storage, the memory module in the embodiment of the present application is allocated as a data storage device.

[0133] In some embodiments, when the memory module is CXL-PMEM, when CXL-PMEM is applied to the system, the information of program exceptions in the system can be dumped in the CXL-PMEM module. Thus, when a system crash or other malfunction occurs, the information of program exceptions can be obtained from the CXL-PMEM module when the system is restarted next time, so as to facilitate problem analysis and location of the program exceptions.

[0134] In some embodiments, when the memory module is CXL-PMEM, when CXL-PMEM is applied to the system, the on-site information of the program running in the system, such as stacks, registers, etc., can be periodically saved to the memory module, thereby facilitating the analysis of the program running trajectory.

[0135] In some embodiments, the memory module is applied to DMA (Direct Memory Access) or RDMA (Remote Direct Memory Access) to achieve persistent storage of data.

[0136] See also Fig. 9 , showing a structural diagram of a control device of a memory module according to an embodiment of the present application.

[0137] The embodiment of the present application provides a control device 200 of a memory module, wherein the memory module comprises a memory controller 1 and a first memory 2 connected to each other, wherein the first memory 2 is used to store a boot loading file and an encrypted application file, wherein the method is executed in the memory controller 1, and the device 200 comprises:

[0138] The first control unit 201 is used to read the boot loading file from the first memory 2 during the module booting stage, verify the boot loading file based on a preset first key, and if the verification passes, control the boot loading file to start, so as to guide the operating system of the memory module to start;

[0139] The second control unit 202 is used to read the application file from the first memory 2 when the operating system is started, verify the application file based on a preset second key, and if the verification passes, decrypt the application file based on a preset third key, and after the application file is decrypted, control the startup of the application file.

[0140] Continue to see Figure 1 An embodiment of the present application provides a memory module, comprising: a storage controller 1 and a first memory 2 connected to each other, the first memory 2 is used to store a boot loading file and an encrypted application file, and the storage controller 1 is used to load and execute to implement the operations performed by any of the methods described above.

[0141] In some embodiments, the memory module also includes a second memory 3, which is used to persistently store data. The storage controller 1 includes a first interface 11 and a second interface 12, wherein the first interface 11 is used to connect to an external main control component 4, and the second interface 12 is connected to the second memory 3.

[0142] In some embodiments, the storage controller 1 further includes a third interface 15, and the third interface 15 is used to connect to an external random access memory.

[0143] Since the memory controller 1 included in the memory module introduced in the embodiment of the present application is exactly the memory controller 1 introduced in the embodiment of the present application, the structure of the memory controller 1 and the principle of the method implemented, as well as the connection method between the memory controller 1 and the main control component 4 have been described in detail above, they will not be repeated here. All memory modules including the memory controller 1 of the embodiment of the present application belong to the scope of protection of the present invention.

[0144] See also Fig.10 , showing a structural diagram of an electronic system of an embodiment of the present application.

[0145] An embodiment of the present application provides an electronic system, including:

[0146] Main control unit 4;

[0147] In any of the memory modules described above, the storage controller 1 is connected to the main control component 4 .

[0148] Since the memory module included in the electronic system introduced in the embodiment of the present application is exactly the memory module introduced in the embodiment of the present application, the principle and structure of the memory module, and the connection method between the memory module and the main control component 4 have been described in detail above, so they will not be repeated here. Any electronic system including the memory module of the embodiment of the present application belongs to the scope of protection of the present invention.

[0149] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the description of the above specific languages ​​is for disclosing the best mode of the present invention.

[0150] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0151] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof.

[0152] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and further may be divided into a plurality of submodules or subunits or subcomponents. All features disclosed in this specification (including the abstract and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination, except that at least some of such features and / or processes or units are mutually exclusive. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying abstract and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0153] Furthermore, those skilled in the art will appreciate that although some embodiments herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present invention and to form different embodiments.

[0154] It should be noted that the above embodiments illustrate the present invention rather than limiting it. Any reference symbol between brackets should not be constructed as a limitation of the present invention. The word "comprising" does not exclude the presence of components or steps not listed in the present invention. The word "one" or "an" preceding a component does not exclude the presence of multiple such components. The present invention can be implemented by means of hardware including several different components and by means of appropriately programmed computers. In the embodiments in which several devices are listed, several of these devices can be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.

Claims

1. A control method for a memory module, characterized in that: The memory module includes a memory controller and a first memory connected to each other, the memory controller has a preset storage space, the security level of the preset storage space is higher than that of the first memory, the storage space is used for one-time writing of data, the first memory is used for storing a boot loading file and an encrypted application file, the method is executed on the storage controller, and the method includes: In the module booting stage, the boot loading file is read from the first memory, the boot loading file is verified based on a preset first key, and if the verification passes, the boot loading file is controlled to start, the first key is stored in the first memory and in the preset storage space, the first key is read from the first memory in the test stage of the memory module, and the first key is read from the preset storage space in the application stage of the memory module; When the startup loading file is started, the application file is read from the first memory, the application file is verified based on the preset second key, if the verification passes, the application file is decrypted based on the preset third key, and after the application file is decrypted, the application file is controlled to start; The third key includes a first subkey and a second subkey, the first subkey is used to encrypt the second subkey, the first subkey is a unique identifier of the memory module, and the second subkey is used to encrypt the application file. The decrypting the application file based on the preset third key includes: decrypting the encrypted second subkey based on the first subkey; The encrypted application file is decrypted based on the second subkey.

2. The method according to claim 1, characterized in that The first key includes a first public key and a first private key, the first private key is used to sign the encrypted value of the boot loading file, the storage controller has a preset storage space, the storage space is used to store the encrypted value of the first public key, and the first memory is used to store the signed boot loading file; The verifying the startup loading file based on the preset first key includes: Encrypting the first public key to obtain a first encrypted value to be verified; Reading the encrypted value of the first public key from the storage space, and if the first encrypted value to be verified is consistent with the encrypted value of the first public key, decrypting the signed boot loader file based on the first public key to obtain a second encrypted value to be verified; If the second encrypted value to be verified is consistent with the encrypted value of the startup loading file, the verification passes.

3. The method according to claim 1, characterized in that The second key includes a second public key and a second private key, the second private key is used to sign the encrypted value of the application file, the storage controller has a preset storage space, the storage space is used to store the encrypted value of the second public key, and the first memory is used to store the signed application file; The verifying the application file based on the preset second key includes: Encrypting the second public key to obtain a third encrypted value to be verified; Reading the encrypted value of the second public key from the storage space, and if the third encrypted value to be verified is consistent with the encrypted value of the second public key, decrypting the signed application file based on the second public key to obtain a fourth encrypted value to be verified; If the fourth encrypted value to be verified is consistent with the encryption value of the application file, the verification passes.

4. The method according to any one of claims 1 to 3, characterized in that: The boot loader file and the application file constitute a firmware file, the firmware file is multiple, the multiple firmware files include a first firmware file and a second firmware file, and the method further includes: When the first firmware file fails to start, marking the event of the first firmware file failing to start in a preset marking area, and resetting the memory module; When the memory module enters the booting phase again, the booting verification of the second firmware file is switched according to the mark information of the preset mark area.

5. The method according to claim 1, characterized in that The memory module further includes a second memory, the second memory is used for persistently storing data, the storage controller includes a first interface and a second interface, the first interface is used to connect to an external main control component, and the second interface is connected to the second memory, and the method further includes: The communication data with the main control component is persistently stored in the second memory.

6. The method according to claim 5, characterized in that The storage controller further includes a cache module, which is connected to the first interface and the second interface and is used to cache communication data with the main control component. The persistent storage of the communication data with the main control component in the second memory includes: The communication data with the main control component is cached in the cache module, and when the cache data in the cache module meets a preset condition, the cache data is persistently stored in the second memory.

7. The method according to claim 5, characterized in that The communication data includes first data and second data, the first data is data between the main control component and the storage controller, the second data is data inside the storage controller and between the storage controller and the second memory, and the persistent storage of the communication data with the main control component in the second memory includes: When receiving a trigger signal sent by the main control component, persistently storing the second data in the second memory; When the main control component detects power failure, the main control component sends the first data to the storage controller so that the first data is converted into the second data, and then sends the trigger signal.

8. The method according to claim 5, characterized in that The storage controller further includes an energy storage module, and the energy storage module is used to provide backup power supply to the storage controller and the second memory. The persistent storage of the communication data with the main control component in the second memory includes: When it is detected that the storage controller is powered off, the communication data inside the storage controller and between the storage controller and the second memory are persistently stored in the second memory.

9. The method according to claim 1, characterized in that: The boot loading file and the application file constitute a firmware file, the storage controller includes a first interface, the first interface is used to connect to an external main control component, there are multiple first interfaces, and the communication protocols between each first interface and the main control component are different, and the method further includes: The firmware file is upgraded based on one or more of the first interfaces.

10. A memory module, characterized in that: include: A storage controller and a first memory are interconnected, the first memory is used to store a boot loading file and an encrypted application file, and the storage controller is used to load and execute to implement the operations performed by any method as described in claims 1-9.

11. The memory module according to claim 10, wherein: The memory module also includes a second memory, which is used for persistent storage of data. The storage controller includes a first interface and a second interface, the first interface is used to connect to an external main control component, and the second interface is connected to the second memory.

12. The memory module according to claim 10, wherein: The storage controller also includes a third interface, and the third interface is used to connect to an external random access memory.

13. An electronic system, characterized in that: include: Main control components; In the memory module described in any one of claims 10-12, the storage controller is connected to the main control component.

Citation Information

Patent Citations

  • Microcontroller with safe starting function, safe starting method and vehicle terminal

    CN118862091A