Memory chip mirroring method and device

By using the image creation script in the embedded system building tool, the parameters are automatically parsed to generate storage chip images, which solves the problems of low efficiency and high error risk in traditional methods and realizes an efficient and reliable image creation process.

CN120653325BActive Publication Date: 2026-11-24JINGWEI HIRAIN (TIANJIN) RES&DEV CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510724643.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2026-11-24
Estimated Expiration
2045-05-30

AI Technical Summary

Technical Problem

Traditional methods of creating memory chip images rely on manual operation, which leads to low efficiency, high error risk, and difficulty in tracking and resolving problems, affecting production progress and the accuracy of image creation.

Method used

The image creation script in the embedded system building tool is used to automatically parse parameters and generate partition configuration files and image files for the storage chip. Through parameterized configuration and automated processes, manual intervention is reduced, improving the efficiency and reliability of image generation.

Benefits of technology

It enables automated production of memory chip images, improving production efficiency, reducing the complexity and error risk of manual operation, and ensuring the standardization and consistency of image production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120653325B_ABST
    Figure CN120653325B_ABST
Patent Text Reader

Abstract

This application discloses a method and apparatus for creating a memory chip image. The method includes: receiving at least one parameter for configuring the generation of a target memory chip image; determining a target partition configuration file and a target partition image file corresponding to the target memory chip based on the at least one parameter; and synthesizing the target partition image file based on the target partition configuration file to obtain an image file corresponding to the target memory chip. This method avoids manual intervention, reduces the complexity and error risk of manual operations through automation, and improves production efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of embedded system technology, and in particular relates to a method and apparatus for fabricating a memory chip image. Background Technology

[0002] In the production of embedded systems, the creation of memory chip images is one of the key steps. Once the image is created, it can be directly injected into memory chips in batches, thereby significantly improving the efficiency and consistency of large-scale production.

[0003] However, traditional methods for creating memory chip images have many shortcomings. For example, the creation process usually requires the cooperation of multiple steps and tools, and most operations rely on manual execution by developers. The proportion of manual operation in the entire creation process is very large, which not only leads to low efficiency, but also increases the risk of configuration errors and tool incompatibility, which may ultimately affect the accuracy of image creation and production schedule. Summary of the Invention

[0004] This application provides a method, apparatus, device, and computer storage medium for creating memory chip images, which can flexibly and efficiently realize the automated production process of memory chip images.

[0005] In a first aspect, embodiments of this application provide a method for creating a memory chip image, applied to an image creation script pre-configured in an embedded system building tool, the method comprising:

[0006] Receive at least one parameter used to configure the generation of the target storage chip image;

[0007] Based on at least one parameter, determine the target partition configuration file and the target partition image file corresponding to the target storage chip;

[0008] Based on the target partition configuration file, synthesize the target partition image file to obtain the image file corresponding to the target storage chip.

[0009] In one possible implementation of the first aspect, when at least one parameter includes a storage space parameter, the target partition configuration file and the target partition image file corresponding to the target storage chip are determined based on the at least one parameter, the method comprising:

[0010] Analyze the storage space parameters to determine the storage space size of the target storage chip;

[0011] Based on the storage space size, the target partition configuration file is selected from multiple partition configuration files.

[0012] In one possible implementation of the first aspect, when at least one parameter includes a partition selection parameter, the target partition configuration file and the target partition image file corresponding to the target storage chip are determined based on the at least one parameter, the method comprising:

[0013] Parse the partition selection parameters to determine the partition type of the target storage chip;

[0014] Based on the partition type, load the target partition image file corresponding to the partition type from the partition image library.

[0015] In one possible implementation of the first aspect, where at least one parameter includes an injection method parameter, the method further includes:

[0016] Analyze the injection method parameters to determine the mirror injection method for the target memory chip;

[0017] Retrieve the target injection configuration file corresponding to the image injection method;

[0018] Write the target injection configuration file into the image file of the target storage chip.

[0019] In one possible implementation of the first aspect, where at least one parameter includes a regional deployment parameter, matching a target partition image file corresponding to the partition type from a partition image library, based on the partition type, includes the following method:

[0020] Analyze the regional deployment parameters to determine the partition image library corresponding to each storage location in the target storage chip;

[0021] Based on the partition type, load the matching sub-target partition image file from the partition image library corresponding to each storage location to obtain multiple sets of sub-target partition image files;

[0022] Multiple sets of sub-target partition image files are merged to generate the target partition image file.

[0023] In one possible implementation of the first aspect, the method further includes:

[0024] Based on the target partition configuration file, extract the partition image file from the image file of the target storage chip;

[0025] The extracted partition image file is compared with the original partition image file in the partition image library;

[0026] If the extracted partition image file matches the original partition image file, the image file of the target storage chip has been successfully created.

[0027] In one possible implementation of the first aspect, the embedded system build tool pre-deploys a configuration file containing the target macro variables;

[0028] When the target macro variable is enabled, the default image creation function will run accordingly. The default image creation function is used to call and execute the image creation script.

[0029] Secondly, embodiments of this application provide a memory chip image fabrication apparatus, the apparatus comprising:

[0030] A receiving module is used to receive at least one parameter for configuring the generation of the target storage chip image;

[0031] The analysis module is used to determine the target partition configuration file and target partition image file corresponding to the target storage chip based on at least one parameter;

[0032] The processing module is used to synthesize a target partition image file based on the target partition configuration file, thereby obtaining the target storage chip.

[0033] Thirdly, embodiments of this application provide a computer device, the device including: a processor, and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the method of any one of the first aspects above.

[0034] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer program instructions that, when executed by a processor, implement the method of any one of the first aspects described above.

[0035] Fifthly, embodiments of this application provide a computer program product comprising a computer program that, when executed by a processor, implements the method of any one of the first aspects described above.

[0036] The technical solutions provided by the embodiments of this application bring at least the following beneficial effects:

[0037] The memory chip image creation method provided in this application automatically parses input parameters and determines the partition configuration file and partition image file corresponding to the target memory chip through a predefined image creation script in an embedded system building tool. Based on these files, the script can automatically generate a complete image file of the target memory chip. This scripted operation reduces manual intervention, improves the efficiency and reliability of image generation, and ensures the standardization and consistency of the image creation process. Attached Figure Description

[0038] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below.

[0039] Figure 1This is a schematic flowchart of a method for fabricating a memory chip image according to an embodiment of this application;

[0040] Figure 2 This is a schematic flowchart of a method for fabricating a memory chip image according to an embodiment of this application;

[0041] Figure 3 This is a schematic diagram of a memory chip image fabrication apparatus provided in an embodiment of this application;

[0042] Figure 4 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0043] To enable those skilled in the art to better understand the technical solutions of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.

[0044] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples consistent with some aspects of this application as detailed in the appended claims.

[0045] As described in the background section, there are many types of embedded systems, and the corresponding methods for programming memory chips also vary. Different programming methods correspond to different file formats and tools. Therefore, traditional bare chip fabrication methods usually require embedded system developers to manually collect and configure various tools, and combine them with the image files generated in the embedded system engineering to manually synthesize the memory chip image file.

[0046] This production method is not only inefficient but also faces several problems. First, due to the lack of unified tools and version control, developers need to switch between multiple tools and versions, increasing the complexity of the work. Second, manual operation occupies most of the time in the entire production process, making the production process more cumbersome and prone to errors. Finally, once errors occur, the lack of an effective error tracking and troubleshooting mechanism makes it difficult to quickly locate the problem, affecting the correction process and production schedule, and increasing the risk of errors.

[0047] In summary, traditional bare chip image fabrication methods not only reduce production efficiency but also make the entire process more reliant on manual operation, increasing the probability of errors and making it difficult to efficiently locate and resolve problems when errors occur.

[0048] To address this technical problem, this application provides a method and apparatus for fabricating a memory chip image.

[0049] The method for fabricating a memory chip image provided in this application will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0050] Before introducing the method for creating memory chip images, we will first introduce an image creation script proposed in the embodiments of this application.

[0051] For example, the image creation script proposed in this application embodiment can be named gengdiskimg.sh.

[0052] It should be noted that the image creation script is pre-configured in the embedded system's build tools for the efficient generation of storage chip images.

[0053] This image creation script automatically generates storage chip images by calling image creation tools, configuration files, and image files. Users only need to input a few necessary parameters to call the relevant tools and configuration files, greatly simplifying the image creation process, improving efficiency, and effectively reducing the complexity and error risk of manual operation. Tools and scripts use unified version management to ensure a stable generation process and easy troubleshooting.

[0054] This application provides a design example of integrating the image creation script into the Yocto project of an embedded system.

[0055] The Yocto project is an open-source collaborative project that provides tools and templates for embedded system development.

[0056] In a Yocto project, multiple folders and files work together to build and deploy the system. The following is a brief overview of the main folders and files mentioned below:

[0057] The `layer` folder: In a Yocto project, the `layer` folder is used to store various code, tools, and configurations used in Yocto builds. Each layer can be considered a functional module or subsystem, containing related recipes, configuration files, scripts, etc.

[0058] Recipe file: A recipe file in Yocto describes how to compile and deploy a specific software package or tool. In this scenario, a recipe file named gendiskimg.bb is created, which is responsible for defining how to create the image creation tool and related configuration files during the Yocto build process, and ensuring that these files are correctly placed in the target folder (such as diskimg) within the deploy folder.

[0059] The `deploy` folder is the directory in the Yocto project where build results are stored. In this solution, the `deploy` folder stores all tools, scripts, and configuration files related to image creation generated by `gendiskimg.bb`. This folder centrally stores the built files, facilitating subsequent image creation and deployment.

[0060] The `diskimg` folder is a target folder within the `deploy` folder, used to store all tools and files related to storage chip image creation. In this solution, `gendiskimg.bb` creates the `diskimg` folder within the `deploy` folder using the `Yocto` statement. All tools related to image creation (such as the `gengdiskimg.sh` script, image injection tools, storage chip image creation tools, etc.) will be deployed to this folder. When the image creation script is run, the script will automatically call these tools and files to generate the final storage chip image.

[0061] As can be seen from the above, this application embodiment, by designing an image creation script within an embedded system building tool, can significantly improve the automation level and production efficiency of image creation, reduce the complexity and error risk of traditional manual operations, and enhance the maintainability of tools and processes by leveraging Yocto's build and management capabilities. This solution provides an efficient, reliable, and scalable image creation solution for embedded system development.

[0062] Figure 1 A flowchart illustrating a method for fabricating a memory chip image according to an embodiment of this application is shown.

[0063] It should be understood that the execution entity of this method is the aforementioned image creation script.

[0064] like Figure 1 As shown, the method may include the following steps.

[0065] S110, Receive at least one parameter used to configure the generation of the target storage chip image.

[0066] It should be noted that the memory chip mentioned in the embodiments of this application may include a bare chip, that is, a bare-mounted memory chip.

[0067] It should be understood that this application also proposes multiple parameters for executing the image creation script. By inputting or adjusting the relevant parameters, the generation configuration of the storage chip image can be flexibly adjusted to meet the needs of different application scenarios and storage chips.

[0068] By way of example and not limitation, the following parameters are given in the embodiments of this application:

[0069] (1) Named parameters.

[0070] The naming parameter is used to specify the name of the generated image file for subsequent management and application.

[0071] For example, the naming parameter can be identified using MACHINE_NAME.

[0072] For example, the naming parameter can be the name of the memory chip or the name of the system on chip (SOC).

[0073] By setting naming parameters, the recognizability and ease of use of image files can be improved.

[0074] (2) Storage space parameters.

[0075] The storage space parameter is used to specify the storage capacity of the storage chip, ensuring that the generated image file meets the capacity requirements of the target storage chip.

[0076] For example, the storage space parameter can be a specific storage capacity value, such as 32GB, 64GB, 512GB, etc.

[0077] (3) Partition selection parameters.

[0078] The partition selection parameter is used to control the input of the partition image, that is, to specify the types of functional partitions that need to be included when creating the image.

[0079] In other words, by selecting the partition parameters, it can be determined which functional partitions the image file of the target storage chip is composed of.

[0080] For example, the partition selection parameters can be preset with different types, such as type1, type2, type3, etc. Among them, type1 can indicate that the images of partitions 1 to 5 are combined into the image of the target storage chip; type2 can indicate that the images of partitions 1 to 6 are combined into the image of the target storage chip; type3 can indicate that only the images of partitions 4 and 6 are combined into the image of the target storage chip.

[0081] (4) Injection method parameters.

[0082] The injection method parameter controls how the image file is injected.

[0083] In other words, by using the injection method parameters, it is possible to determine how to inject the generated image file into the target storage chip, making it easier to adapt to different production and deployment scenarios.

[0084] For example, the injection method parameter can be preset with different types, such as config1, config2, config3, etc. Among them, config1 can represent the "full disk write" injection method; config2 can represent the "incremental write" injection method; and config3 can represent the "segmented write" injection method.

[0085] (5) Regional deployment parameters.

[0086] Regional deployment parameters are used to control the distribution of image files in different regions / parts within the storage chip.

[0087] It should be understood that a storage chip can be divided into two or more storage regions (e.g., partition A and partition B). Through region deployment parameters, the mirror library source for each storage region can be configured to meet the needs of backup or different tasks.

[0088] For example, the regional deployment parameters may include multiple path parameters (e.g., a-path, b-path), where each path parameter corresponds to the path of a partition image library or image folder for a region.

[0089] For example, a-path points to the image library of partition A, and b-path points to the image library of partition B.

[0090] By inputting the two path parameters in the region deployment parameters, you can specify that partition A and partition B are written to the same or different image files:

[0091] If the same image file is written, a backup is achieved;

[0092] If different image files are written, multi-functional task deployment is supported. For example, partition A is used for system startup, and partition B is used for data storage.

[0093] By inputting or adjusting the path in the regional deployment parameters, users can quickly and flexibly complete the partition configuration of the image, thereby adapting to diverse storage chip usage scenarios.

[0094] Based on the above descriptions of the parameters, in one example, the image creation script can be executed in the form of . / gendiskimg.sh name 32GB type1 config1-a path1-b path2.

[0095] Understandably, you can add parameters as needed for image creation. The general principle for adding parameters is that the parameter type and name should be concise, and the parameters should not affect the single execution of tools like bpttool within the script. For example, the third parameter, when type1, actually executes `bpttool-image partition_1:partition1 image...-image partition_5...`; when type2, it executes `bpttool-image partition_1:partition1 image...-image partition_6...`. The `type1` and `type2` commands have different bpttool execution methods within the script and do not share a common set; they can be distinguished using switch or if statements.

[0096] S120. Determine the target partition configuration file and target partition image file corresponding to the target storage chip based on at least one parameter.

[0097] A partition configuration file is a configuration file used when creating a storage chip. It contains the partition information of the storage chip (such as partition name, partition size, and offset).

[0098] Partition configuration files are typically named based on the storage space size of the storage chip for easy matching. Therefore, during image creation, partition configuration files that match the target storage chip can be quickly selected using storage space parameters.

[0099] In one implementation, the method for determining the target partition configuration file based on storage space parameters may include:

[0100] Analyze the storage space parameters to determine the storage space size of the target storage chip.

[0101] Based on the storage space size, the target partition configuration file is selected from multiple partition configuration files.

[0102] A partition image file is an image file of each functional partition in a storage chip, containing the programs or data required for partition functionality. When the image creation script runs, it can load a specific partition image file based on the partition selection parameters.

[0103] In one implementation, the method for determining the target partition image file corresponding to the target storage chip based on partition selection parameters may include:

[0104] Parse the partition selection parameters to determine the partition type of the target storage chip.

[0105] For example, type1 indicates a basic function partition (such as a boot partition + system partition). When the partition selection parameter is type1, the partition type corresponding to the target storage chip is determined to be a basic function partition.

[0106] Based on the partition type, load the target partition image file corresponding to that partition type from the partition image library.

[0107] A partition image library is a resource repository that stores partition image files, organized according to partition type. During image creation, the required image file can be quickly retrieved.

[0108] For example, if the target storage chip contains a boot partition and a system partition, the image creation script will load the corresponding boot partition and system partition image files from the partition image library.

[0109] Understandably, the partition configuration file and partition image file are pre-set, and you only need to select them as needed when executing the image creation script to create the image file of the target storage chip.

[0110] S130. Based on the target partition configuration file, synthesize the target partition image file to obtain the image file corresponding to the target storage chip.

[0111] The implementation process begins by parsing the target partition configuration file to extract the partition information of the target storage chip. Then, based on the parsing results, the corresponding target partition image file is loaded from the partition image library, and its integrity is verified to ensure it is not corrupted and meets the target configuration requirements. After verification, each partition image file is written sequentially to the target image file according to the partition order defined in the target partition configuration file, ensuring the data is stored at the correct offset. Finally, these components are combined to form a complete target storage chip image file.

[0112] This application presents an automated image creation script pre-configured within an embedded system building tool. This script, by parsing input parameters, automatically determines the partition configuration file and partition image file corresponding to the target storage chip. Based on these files, the script can automatically generate a complete image file of the target storage chip, significantly simplifying the image creation process. This approach avoids manual intervention, reducing the complexity and error risk of manual operations through automation, thereby improving production efficiency. Through parameterized configuration, users only need to provide the necessary input, and the script can accurately select and load the corresponding configuration file and image file, ensuring a fast, efficient, and consistent image creation process, further improving the reliability and repeatability of storage chip image creation.

[0113] In one embodiment, if at least one parameter also includes an injection method parameter, step S130 may include the following steps:

[0114] The injection method parameters are analyzed to determine the mirror injection method for the target memory chip.

[0115] Obtain the target injection configuration file corresponding to the image injection method.

[0116] The injection configuration file contains parameters and settings related to the selected injection method, such as injection order and injection offset.

[0117] The injection configuration file is written into the image file of the target storage chip.

[0118] The injection configuration file is written into the target memory chip's image file to ensure that the image file can be correctly written into the memory chip according to the specified injection method during subsequent burning processes.

[0119] In this embodiment, by flexibly adjusting the image injection strategy according to different injection methods, the accuracy and flexibility of image creation in different application scenarios are ensured, thereby improving the automation level of the image creation process.

[0120] In one embodiment, if at least one parameter also includes a regional deployment parameter, step S130 may include the following steps:

[0121] The deployment parameters of the target region are analyzed to determine the partition type corresponding to each storage location in the target storage chip.

[0122] It should be understood that the storage location is the storage area mentioned in step S110.

[0123] Based on the partition type, the matching sub-target partition image file is loaded from the partition image library corresponding to each storage location to obtain multiple sets of sub-target partition image files.

[0124] Each storage location may correspond to a different image library, so that the corresponding image data can be loaded according to different needs or deployment strategies.

[0125] Based on the partition type, the matching sub-target partition image file is loaded from the partition image library corresponding to each storage location to obtain multiple sets of sub-target partition image files.

[0126] Multiple sets of sub-target partition image files are merged to generate the target partition image file.

[0127] These multiple sets of sub-target partition image files are merged to generate the final target partition image file, thus completing the construction of the target storage chip image.

[0128] In this embodiment, by flexibly configuring regional deployment parameters, matching image files can be loaded and synthesized according to different storage locations, thereby achieving more accurate image generation.

[0129] Understandably, after generating the image file of the target memory chip, it is necessary to perform a consistency check on the generated image file to confirm that its size and content meet expectations, and save the image file that passes the check as the final output for subsequent memory chip injection and production.

[0130] In one embodiment, a method for verifying an image file may include:

[0131] Based on the target partition configuration file, extract the corresponding partition image file from the target storage chip image file.

[0132] The extracted partition image file is compared with the original partition image file in the partition image library.

[0133] If the extracted partition image file matches the original partition image file, it confirms that the image file of the target storage chip was successfully created, indicating that there are no problems with the generation and configuration of the image.

[0134] Conversely, if the extracted partition image file is inconsistent with the original partition image file, it indicates that the creation of the target storage chip image file has failed, and the image creation process needs to be re-examined to find and correct the errors.

[0135] The verification process will be illustrated with an example below.

[0136] Suppose a raw chip image (diskimg.bin) contains 3 partition images: partition names part1_a, part2_a, part3_a; the offsets of the partitions in the storage chip are offset1, offset2, offset3; the sizes are size1, size2, size3; and the partition images generated by the yocto project are named part1.img, part2.img, part3.img.

[0137] After the script generates the raw chip image file diskimg.bin, you can use the hexdump command to dump a partition image file, such as dump1, from the bin file. Example command: hexdump -C diskimg.bin -s offset1 -n size1>dump1; Then use the diff command to compare dump1 and part1.img. After performing this comparison on all partition images, if the diff command shows no difference, it means that the raw chip image file compiled for this Yocto project is reliable.

[0138] In this embodiment, the accuracy of image file creation is ensured by automatically verifying the image file, reducing the need for manual intervention and enabling early detection of problems during the creation process. This improves the reliability and efficiency of image creation and avoids production delays or quality issues caused by image file errors.

[0139] In one embodiment, the embedded system building tool pre-deploys a configuration file containing target macro variables. When the target macro variables are enabled, a preset image creation function runs accordingly. This preset image creation function is used to call and execute the image creation script.

[0140] In one implementation, methods for enabling the execution of image creation scripts may include:

[0141] In response to the first request, the target macro variable in the corresponding configuration file of the embedded system build tool is enabled.

[0142] The first request may refer to a request to create an image of the target memory chip.

[0143] The target macro variable is used to enable the image creation process.

[0144] Once the target macro variable is enabled, the preset image creation function is run, which calls and executes the image creation script.

[0145] An example of integrating an image creation script into a Yocto project, this self-starting method may include:

[0146] Add macros (such as ENABLE_DISKIMG) to the Yocot configuration file to control whether a bare chip image is generated during compilation.

[0147] Add the _gen_diskimg function to the class file in the Yocto project. This function calls the gendiskimg.sh script during the compilation process to generate the bare chip image.

[0148] In this embodiment, by pre-setting macro variables and functions in the embedded system's build tool, the image creation process can be simplified, reducing the complexity of manual operations. During runtime, when the target macro variable is enabled, the preset image creation function is automatically called and executed, allowing the image creation script to automatically perform corresponding operations based on pre-configured parameters. This approach not only improves the automation level of image creation and reduces human error but also ensures that each image creation conforms to unified specifications and processes, further improving production efficiency and image accuracy. Simultaneously, through centralized configuration management and automatic execution, the traceability and controllability of the entire image creation process are significantly enhanced, facilitating rapid problem location and resolution.

[0149] In one embodiment, the image creation tool mentioned in this application can be the bpttool tool.

[0150] When using the bpttool tool, you need to configure the corresponding bpt file.

[0151] The bpt file is the configuration file used when creating a bare chip image using the bpttool tool. It stores the partition information of the storage chip. The bpttool tool will select the appropriate partition image as needed and then create a complete bare chip image based on the information in the bpt file.

[0152] In other words, a bpt file can be understood as... Figure 1 An example of a partition configuration file in the embodiment.

[0153] Understandably, the same type of storage chip may have different partitioning requirements, thus resulting in different BPT files and different numbers and names of partition images. This means that the bpttool tool requires a lot of parameters to be input when using it (such as the name of the bpt file, the path of each partition image, the name of each partition image, the name of each partition of the storage chip, and the path and name of the output file, etc.). If each time bpttool is used to create a raw chip image, the tool must be placed in a folder and dozens of parameters must be manually entered, it will be very easy to make mistakes.

[0154] The image fabrication script designed in this application requires only a few short but necessary parameters to run, which greatly simplifies the bare chip fabrication process.

[0155] The image creation method provided in this application embodiment will be described below with reference to a specific example.

[0156] In this example, the image creation script is integrated into the Yocto project of the embedded system. During execution, the bpttool tool is used to create the memory chip image.

[0157] The method may include the following parts.

[0158] Part 1: Preparations before script execution.

[0159] 1. Ensure the environment is configured correctly.

[0160] Verify that the Yocto project environment has been set up and that all necessary dependencies and tools have been installed. Ensure that the meta-self-layer (or other custom layer) has been correctly created and configured.

[0161] 2. Prepare the necessary tools and documents.

[0162] Place the tools related to bare chip fabrication (such as bpttool, compression / decompression tools, etc.) in the files folder, at the path: meta-self-layer / recipes-tools / diskimg / files. Also, ensure that the bpt file (i.e., the partition configuration file) is prepared and make necessary adjustments as needed.

[0163] 3. Create the gendiskimg.bb file.

[0164] In the meta-self-layer, create the gendiskimg.bb file according to the Yocto project specifications.

[0165] This file is used to integrate the image creation script during the Yocto compilation process. The file path is: meta-self-layer / recipes-tools / diskimg / gendiskimg.bb.

[0166] In addition, you need to create a script file gengdiskimg.sh and place it in the meta-self-layer / recipes-tools / diskimg / files directory, ensuring that the script file's configuration conforms to the Yocto specification.

[0167] Add macros (such as ENABLE_DISKIMG) to the Yocot configuration file to control whether a bare-chip image is generated during compilation. Add the _gen_diskimg function to the class file in your Yocot project. This function calls the gendiskimg.sh script during compilation to generate the bare-chip image.

[0168] Part Two: Script Execution Process.

[0169] Figure 2 A schematic flowchart of a mirror image creation method provided in an embodiment of this application is shown.

[0170] like Figure 2 As shown, the method may include the following steps.

[0171] S210. Determine whether macro variables in the Yocto project are enabled.

[0172] If so, proceed to step S220.

[0173] During the compilation of the S220 and Yocto projects, the image creation function (_gen_diskimg function) is run.

[0174] S230. Based on the image creation function, call the image creation script (gengdiskimg.sh).

[0175] This process may include the following steps:

[0176] S231, Startup script, Parameter parsing.

[0177] Execute the script and parse the passed parameters.

[0178] The parameters passed in can be: . / gendiskimg.sh name 32GB type1 config1 –a path1 –bpath2.

[0179] These parameters are: name parameter, storage space parameter 32GB, partition selection parameter type1, injection method parameter config1, and region deployment parameters –a path1 –b path2.

[0180] S232. Select the appropriate bpt file according to the storage space parameters.

[0181] S233. Prepare the corresponding partition image file according to the partition selection parameters.

[0182] S234. Determine the injection method based on the injection method parameters.

[0183] S235. Determine the path of the partition image based on the regional deployment parameters.

[0184] In addition, if special processing (such as compression / decompression) is required on the files generated by the Yocto project before creating the bare chip image, these operations are performed in this step.

[0185] S236. Use the bpttool tool to generate a bare chip image based on the bpt file and the partition image file.

[0186] This step may involve multiple calls to bpttool, depending on the number and type of partition images.

[0187] All partition images are combined into a complete raw chip image according to the configuration in the bpt file. The raw chip image is named name-32GB-config1.bin. Additional configuration files are generated depending on the injection method.

[0188] After the S240 and Yocto projects are compiled, an image file package is generated.

[0189] This step may include the following steps:

[0190] S241. Verify the bare chip image.

[0191] Use tools such as hexdump and diff to verify whether the partition images in the generated bare chip image file are consistent with the partition images generated in the yocto project.

[0192] S242. Compress the bare chip image and related configuration files into a single compressed package, and delete the original bare chip image file to save space.

[0193] This embodiment proposes a method for automated bare chip fabrication based on Yocto engineering. It standardizes and simplifies the bare chip fabrication process, is applicable to various different SoCs, has high portability, reduces manual intervention in the bare chip image fabrication process, and increases the accuracy of the bare chip image.

[0194] The foregoing mainly describes a method for fabricating a memory chip image according to an embodiment of this application, with reference to the accompanying drawings. It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially, these steps are not necessarily executed in the order shown in the figures. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of steps or stages in other steps. The following describes a device for fabricating a memory chip image according to an embodiment of this application, with reference to the accompanying drawings. For brevity, appropriate omissions will be made in the following description of the device; relevant content can be referred to in the relevant descriptions of the method above, and will not be repeated.

[0195] Corresponding to the method described in the above embodiments, Figure 3 This diagram illustrates the structure of a memory chip image fabrication apparatus 1000 provided in one embodiment of this application. For ease of explanation, only the parts relevant to the embodiment of this application are shown.

[0196] like Figure 3 As shown, the device 1000 may include:

[0197] The receiving module 1001 is used to receive at least one parameter for configuring the generation of the target storage chip image.

[0198] Analysis module 1002 is used to determine the target partition configuration file and target partition image file corresponding to the target storage chip based on at least one parameter.

[0199] Processing module 1003 is used to synthesize a target partition image file based on the target partition configuration file to obtain the target storage chip.

[0200] Figure 4 A schematic diagram of the hardware structure of a computer device provided in an embodiment of this application is shown.

[0201] The computer device may include a processor 7001 and a memory 7002 storing computer program instructions.

[0202] Specifically, the processor 7001 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0203] Memory 7002 may include mass storage for data or instructions. For example, and not limitingly, memory 7002 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. In one instance, memory 7002 may include removable or non-removable (or fixed) media, or memory 7002 may be non-volatile solid-state memory. Memory 7002 may be internal or external to the integrated gateway disaster recovery device.

[0204] In one instance, the memory 7002 may be a read-only memory (ROM). In one instance, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.

[0205] Memory 302 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this disclosure.

[0206] The processor 7001 reads and executes computer program instructions stored in memory 7002 to achieve... Figure 1 The method for creating a memory chip image in the illustrated embodiment.

[0207] In one example, the computer device may also include a communication interface 7003 and a bus 7004. Wherein, as... Figure 4 As shown, the processor 7001, memory 7002, and communication interface 7003 are connected through bus 7004 and complete communication with each other.

[0208] The communication interface 7003 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0209] Bus 7004 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 7004 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.

[0210] Furthermore, in conjunction with the memory chip image fabrication method in the above embodiments, this application embodiment can provide a computer storage medium for implementation. This computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the memory chip image fabrication methods in the above embodiments.

[0211] This application also provides a computer program product, including a computer program, which, when executed, implements any of the memory chip image fabrication methods described in the above embodiments.

[0212] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0213] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (ROM), flash memory, erasable read-only memory (EROM), floppy disks, compact disc read-only memory (CD-ROM), optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0214] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0215] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A method for fabricating a memory chip image, characterized in that, Image creation scripts pre-configured in embedded system build tools include: Receive at least one parameter used to configure the generation of the target storage chip image; Based on the at least one parameter, determine the target partition configuration file and the target partition image file corresponding to the target storage chip; Based on the target partition configuration file, the target partition image file is synthesized to obtain the image file corresponding to the target storage chip; Wherein, if at least one parameter includes a storage space parameter, determining the target partition configuration file and target partition image file corresponding to the target storage chip based on the at least one parameter includes: The storage space parameters are analyzed to determine the storage space size of the target storage chip; Based on the storage space size, the target partition configuration file is selected from multiple partition configuration files. The target partition configuration file contains the partition information of the target storage chip. The partition information includes the partition name, partition size, and offset. The multiple partition configuration files are identified by their corresponding storage space size.

2. The method according to claim 1, characterized in that, When at least one parameter includes a partition selection parameter, determining the target partition configuration file and target partition image file corresponding to the target storage chip based on the at least one parameter includes: The partition selection parameters are parsed to determine the partition type of the target storage chip; Based on the partition type, load the target partition image file corresponding to the partition type from the partition image library.

3. The method according to claim 1, characterized in that, When at least one parameter includes an injection method parameter, the method further includes: The injection method parameters are analyzed to determine the mirror injection method of the target memory chip; Obtain the target injection configuration file corresponding to the image injection method; The target injection configuration file is written into the image file of the target memory chip.

4. The method according to claim 2, characterized in that, Where at least one parameter includes a regional deployment parameter, the step of matching the target partition image file corresponding to the partition type from the partition image library according to the partition type includes: Analyze the regional deployment parameters to determine the partition image library corresponding to each storage location in the target storage chip; Based on the partition type, load the matching sub-target partition image file from the partition image library corresponding to each storage location to obtain multiple sets of sub-target partition image files; The multiple sets of sub-target partition image files are merged to generate the target partition image file.

5. The method according to claim 2 or 4, characterized in that, The method further includes: Based on the target partition configuration file, extract the partition image file from the image file of the target storage chip; The extracted partition image file is compared with the original partition image file in the partition image library; If the extracted partition image file matches the original partition image file, the image file of the target storage chip is confirmed to have been successfully created.

6. The method according to any one of claims 1 to 3, characterized in that, The embedded system building tool pre-deploys a configuration file containing target macro variables; When the target macro variable is enabled, the preset image creation function runs accordingly. The preset image creation function is used to call and execute the image creation script.

7. A memory chip image fabrication apparatus, characterized in that, include: A receiving module is used to receive at least one parameter for configuring the generation of the target storage chip image; The analysis module is used to determine the target partition configuration file and the target partition image file corresponding to the target storage chip based on the at least one parameter; The processing module is used to synthesize the target partition image file according to the target partition configuration file to obtain the target storage chip; If at least one of the parameters includes a storage space parameter, the analysis module is further configured to parse the storage space parameter to determine the storage space size of the target storage chip; and based on the storage space size, to filter out the target partition configuration file from multiple partition configuration files, wherein the target partition configuration file contains partition information of the target storage chip, the partition information including partition name, partition size and offset, and the multiple partition configuration files are identified by their corresponding storage space size.

8. A computer device, characterized in that, The device includes: a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the method as claimed in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions that, when executed by a processor, implement the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Mirror image file acquisition method and device, computer equipment and storage medium

    CN109788032A

  • Container service change management system based on description file

    CN117591237A

  • Method for making eMMC mirror image for soc heterogeneous architecture

    CN120010763A