Memory testing method and electronic equipment
By storing signature files and scripts in the target test partition of the device under test and using key combinations to control the writing and deletion of the start flag, the memory test is automatically triggered, solving the problems of low efficiency and high security risks in traditional memory testing solutions, and realizing efficient and secure batch memory testing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHEN ZHEN BAO XIN CHUANG XIN XI JI SHU YOU XIAN GONG SI
- Filing Date
- 2026-01-12
- Publication Date
- 2026-05-05
AI Technical Summary
Traditional memory testing solutions rely on external deployment via USB flash drive, involve cumbersome manual operation, have low testing efficiency, pose high security risks, and are difficult to meet the quality traceability requirements of batch testing.
When the device under test is in factory test mode, the target signature file and memory test script are stored in the target test partition. Based on the trigger state of the preset key combination, the start test flag is written or deleted. The memory test is automatically triggered during the BIOS power-on self-test phase, avoiding the shutdown of external storage devices and secure boot mechanisms.
Significantly improves memory testing efficiency, ensures the safety and traceability of the testing process, reduces human intervention, and meets the high-efficiency memory testing needs of batch devices.
Smart Images

Figure CN121983108A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic technology, and in particular to a memory testing method and an electronic device. Background Technology
[0002] In recent years, with the rapid development of the computer hardware industry, USB flash drive-based memory testing solutions have been widely used in batch testing scenarios on production lines due to their flexible deployment and compatibility with various PC devices.
[0003] However, taking batch memory testing of devices such as PCs and laptops as an example, traditional memory testing solutions rely on external USB flash drives to deploy testing tools. This requires manually entering the BIOS Setup interface using shortcut keys to disable the Secure Boot option, then entering the Boot Manager to select USB flash drive boot, and finally manually triggering the memory testing tool to run in the UEFI Shell.
[0004] Specifically, in batch memory testing scenarios, a large number of USB drives need to be prepared, and the UEFI environment and memory testing tools need to be copied and deployed in advance. The preliminary preparation work is complicated and the hardware cost is high. If a single USB drive is used to test each machine, the subsequent test logs cannot be saved after the USB drive is removed after the test, which makes it difficult to meet the quality traceability requirements of batch testing. Moreover, disabling the Secure Boot option will directly destroy the security protection mechanism during the system startup phase, and the UEFI Shell and test tool EFI files that have not been signed by the secure boot certificate are easily blocked by the device security policy and cannot run normally. Summary of the Invention
[0005] The memory testing method and electronic device provided in this application are intended to solve at least some of the defects in the existing memory testing methods of electronic devices.
[0006] In a first aspect, embodiments of this application provide a memory testing method. The memory testing method includes: when the device under test is in factory test mode, storing a target signature file and a memory test script in a target test partition; writing or deleting a start test flag bit in random access memory based on the trigger state of a preset key combination; during the power-on self-test (POST) of the basic input / output system, detecting whether the start test flag bit exists in the random access memory; if the start test flag bit exists in the random access memory, controlling the device under test to start the target test partition to perform a memory test operation.
[0007] Secondly, embodiments of this application provide an electronic device. The electronic device includes a memory and a processor, the processor being communicatively connected to the memory. The memory stores computer program instructions, which, when invoked by the processor, cause the processor to execute the memory testing method described above.
[0008] The beneficial effects of the memory testing method provided in this application are as follows: By storing the target signature file and memory test script in the target test partition when the device under test is in factory test mode, and controlling the writing and deletion of the start test flag in the random access memory based on the trigger state of a preset key combination, the memory test process is automatically triggered during the BIOS power-on self-test phase, significantly improving memory testing efficiency and effectively avoiding the technical defects of traditional solutions that rely on external USB flash drive deployment and cumbersome manual operation steps. Moreover, this application stores the target signature file in the built-in target test partition, eliminating the need for external storage devices and disabling the secure boot mechanism, thus meeting the high-efficiency memory testing needs of batch devices while ensuring the security of the testing process. Attached Figure Description
[0009] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0010] Figure 1 A schematic diagram illustrating a memory testing method provided in an embodiment of this application; Figure 2 A schematic diagram illustrating the storage target signature file and memory test script provided in an embodiment of this application; Figure 3 A schematic diagram illustrating the writing or deleting of the start test flag bit provided in an embodiment of this application; Figure 4 A schematic diagram of the target test partition for startup provided in an embodiment of this application; Figure 5 A schematic diagram illustrating another memory testing method provided in an embodiment of this application; Figure 6 This is a schematic diagram of the architecture of the memory testing device provided in the embodiments of this application; Figure 7 This is a schematic diagram of the architecture of an electronic device provided in an embodiment of this application. Detailed Implementation
[0011] To facilitate understanding of this application, a more detailed description of this application will be provided below in conjunction with the accompanying drawings and specific embodiments.
[0012] It should be noted that when a component is said to be "set on" another component, it can be directly on the other component or there may be an intervening component. When a component is considered to be "connected" to another component, it can be directly connected to the other component or there may be an intervening component, or it can refer to the two components being interconnected via signals. When a component is considered to be "coupled" to another component, it can be directly coupled to the other component or there may be an intervening component, or it can refer to the two components interacting via signals.
[0013] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the specification of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application.
[0014] Furthermore, the technical features involved in the different embodiments of this application described below can be combined with each other as long as they do not conflict with each other.
[0015] Due to the high demands for efficiency and security in mass production testing of computer hardware, the industry currently widely adopts a USB flash drive-based memory testing solution. This solution deploys UEFI Shell and Memory Test tools via an external USB flash drive, and combines this with manual operation to complete device memory testing, thereby meeting the needs of batch device memory testing.
[0016] First, testers need to copy the UEFI environment and Memory Test tool to a USB flash drive beforehand. Then, connect the USB flash drive to the device under test and manually enter the BIOS Setup interface using a shortcut key to disable the Secure Boot option. Next, enter the Boot Manager again using a shortcut key and select the USB flash drive to boot from. Finally, manually run the Memory Test tool in the UEFI Shell on the USB flash drive to complete the memory test. If test logs need to be saved, the USB flash drive must remain connected throughout the process.
[0017] However, in the process of developing this application, the applicant noticed that traditional USB flash drive-based memory testing solutions have significant technical flaws and are difficult to adapt to the needs of efficient and secure mass production testing. On the one hand, relying on manual completion of a series of operations such as USB flash drive deployment, secure boot and shutdown, boot option selection, and test tool execution is cumbersome and requires high levels of human intervention. This not only results in low testing efficiency but also makes tests prone to failure due to human error. At the same time, batch testing scenarios require the preparation of a large number of USB flash drives and the pre-copying of test tools, which involves a lot of preparatory work and significantly increases testing costs. On the other hand, disabling the Secure Boot option directly undermines the security protection mechanism during the system startup phase, and test tools that have not been securely signed are easily blocked by device security policies, posing a system security risk. If a single USB flash drive is used for testing on each device, the test logs cannot be saved after the USB flash drive is removed, making it difficult to meet the quality traceability requirements of batch testing.
[0018] To address the issues of inefficiency, high reliance on manual intervention, significant security risks, and limited test log storage in traditional memory testing methods, the applicant has developed a novel memory testing method. This method includes: storing a target signature file and a memory test script in a target test partition when the device under test is in factory test mode; writing or deleting a start test flag in random access memory (RAM) based on a preset key combination trigger state; detecting the presence of the start test flag in the RAM during the system's power-on self-test (POST); and controlling the device under test to start the target test partition to perform memory testing operations if the start test flag is present in the RAM.
[0019] By storing the target signature file and memory test script in the target test partition when the device under test is in factory test mode, and controlling the writing and deletion of the boot test flag in random access memory based on the trigger state of a preset key combination, the memory test process is automatically triggered during the BIOS power-on self-test phase, significantly improving memory testing efficiency and effectively avoiding the technical shortcomings of traditional solutions that rely on external USB flash drive deployment and cumbersome manual operation. Moreover, this application stores the target signature file in the built-in target test partition, eliminating the need for external storage devices and disabling the secure boot mechanism, thus meeting the high-efficiency memory testing needs of batch devices while ensuring the security of the testing process.
[0020] Based on the above-described inventive concept, the memory testing method provided in this application can be generally applied to production line testing scenarios for various electronic devices such as personal computers and laptops, reducing the impact of traditional memory testing solutions on mass production delays, system security risks, and difficulties in fault tracing caused by low efficiency, high security risks, and poor traceability. For ease of understanding, the following is combined with... Figure 1The specific implementation of the memory testing method provided in the embodiments of this application is illustrated by example.
[0021] Figure 1 This is a schematic diagram of a memory testing method provided in an embodiment of this application. Figure 1 As shown, the memory testing method includes: S101. When the device under test is in factory test mode, store the target signature file and memory test script in the target test partition. The "device under test" refers to an electronic device equipped with an embedded controller (EC), a basic input output system (BIOS), and a storage medium that can be partitioned into target test partitions. The device under test supports Factory Test Mode (MFG Mode) and Secure Boot mechanism, which are used to complete the automated quality inspection of the memory of the device under test through memory testing operations before leaving the factory, to ensure that the memory hardware performance meets the factory standards.
[0022] "Factory Test Mode" refers to a dedicated testing state for the device before it leaves the factory. It is a pre-set working mode by the equipment manufacturer for hardware testing, firmware debugging, and functional verification on the production line. In this factory test mode, the device under test will have access to test interfaces, hardware access permissions, and dedicated test functions that are disabled in normal user mode. This allows testers to efficiently conduct comprehensive hardware testing and firmware debugging, ensuring that the performance indicators of the device under test meet the factory quality standards.
[0023] "Target signed files" refer to a collection of executable programs signed with a secure boot certificate, primarily including UEFI shells (such as BOOTX64.efi) and memory testing tools (such as MemoryTestX64.efi). This signature is issued by the device manufacturer or its authorized legal body to verify the legitimacy of the file source and the integrity of its content to the device's BIOS / UEFI firmware, ensuring that the test programs are compatible with the device's secure boot mechanism.
[0024] A "memory test script" refers to a pre-written set of automated instructions (such as a Startup.nsh script). This memory test script is pre-configured with the filename information of memory testing tools. Its function is to automatically read and execute the memory test script after the UEFI Shell starts, accurately calling the memory testing tools through the pre-configured filename information, completing the memory test operation without manual intervention, and improving memory testing efficiency.
[0025] A "target test partition" refers to a dedicated storage area on the storage medium of the device under test, used to centrally store various files related to memory testing, including target signature files, memory test scripts, and memory test logs. This target test partition typically has a fixed partition name (e.g., EFITEST) and a preset format. In some embodiments, the target test partition uses the FAT32 format to adapt to the UEFI boot mechanism's compatibility requirements for partition formats, ensuring that various files related to memory testing can be correctly recognized and read by the BIOS / UEFI.
[0026] In some embodiments, taking a laptop computer as an example, when the laptop computer is in MFG Mode, the tester calls the laptop computer's built-in partitioning tool to perform partitioning operations on the laptop computer's solid-state drive; creates a new target test partition in FAT32 format; and stores the target signature file signed by the secure boot certificate and the edited memory test script in the target test partition according to the preset directory structure.
[0027] S102. Based on the trigger state of the preset combination key, write or delete the start test flag bit in the random access memory; "Preset key combinations" refer to a predefined set of keys that must be pressed simultaneously (e.g., CTRL+ALT+M, CTRL+ALT+C) as physical commands to trigger memory test-related functions. Specifically, CTRL+ALT+M is used to write the boot test flag bit to random access memory (e.g., ECRAM); CTRL+ALT+C is used to delete the boot test flag bit from ECRAM. These preset key combinations are detected independently by ECRAM and do not depend on the BIOS operating state.
[0028] "Trigger state" refers to the valid execution state corresponding to the physical key operation of a preset key combination, specifically divided into two states: triggered and untriggered. The triggered state indicates that the key operation meets preset judgment conditions (e.g., simultaneous key presses, duration exceeding a specified limit); the untriggered state indicates that the key operation does not meet the judgment conditions or the key operation was not executed. This trigger state is the basis for EC to determine whether to perform a write or delete operation on the start test flag.
[0029] "Random Access Memory" refers to the ECRAM built into the EC, which is different from the main memory of the device under test. This ECRAM is a temporary storage area with high-speed read and write characteristics. It is mainly used to store key status information related to the test process, such as the boot test flag, for the BIOS to quickly read and modify during the power-on self-test and test execution phases.
[0030] The "Startup Test Flag" is a switch signal that controls the memory test process. When the Startup Test Flag is stored in the ECRAM, it instructs the BIOS to start the memory test process; when the Startup Test Flag is not stored in the ECRAM, it instructs the BIOS to execute the normal system boot process without triggering the memory test operation.
[0031] In some embodiments, taking a laptop computer as the device under test as an example, the preset key combinations are divided into two sets of functionally independent key combinations, corresponding to the trigger and termination instructions of the memory test process, respectively. When the tester presses the first key combination (e.g., CTRL+ALT+M), if the EC detects the valid trigger state of the key combination, it writes a start test flag bit into the ECRAM; when the tester presses the second key combination (e.g., CTRL+ALT+C), if the EC detects the valid trigger state of the key combination, it deletes the start test flag bit from the ECRAM, terminating the subsequent memory test process. The detection of the preset key combination and the writing and deletion of the start test flag bit are all completed independently by the EC, without relying on the BIOS power-on self-test (POST) process. Therefore, it can respond in real time even when the laptop computer is not powered off (e.g., in standby, test execution, system running, etc.), realizing flexible control of the memory test process at all times.
[0032] S103. During the power-on self-test of the basic input / output system, check whether the start-up test flag bit exists in the random access memory; The "Basic Input Output System" refers to the underlying firmware program (BIOS) embedded in the motherboard chip of the device under test. It is a bridge connecting hardware and software and is responsible for basic operations such as hardware self-test and initialization after the device under test is powered on.
[0033] The "Power-On Self-Test (POST) phase" refers to the stage where the BIOS performs the POST after the device under test is powered on. During this phase, the BIOS performs a comprehensive check and initialization of hardware components such as the central processing unit (CPU), main memory, and storage devices to ensure that each component functions correctly and operates stably. Simultaneously, the BIOS prioritizes reading and checking the boot test flags in the ECRAM, determining whether to trigger and start the memory test process based on the storage status of these flags, rather than directly entering the regular system boot process.
[0034] In some embodiments, taking a laptop computer as an example, during the POST phase, the BIOS will first read and detect whether the ECRAM stores a start test flag bit. Based on the storage status of the start test flag bit, it will determine whether to trigger and start the memory test process, thereby realizing automated trigger control of memory testing.
[0035] S104. If the start test flag exists in the random access memory, control the device under test to start the target test partition to perform memory test operations.
[0036] "Memory test operation" refers to the memory test operation performed on the device under test by the target signature file (containing UEFI Shell and memory test tools) stored in the target test partition after the device under test is started from the preset target test partition.
[0037] In some embodiments, taking a laptop computer as an example, when the BIOS detects that the ECRAM stores a boot test flag during the power-on self-test (POST) phase, it controls the laptop computer to boot from the EFITEST partition; then, it performs a memory test operation on the laptop computer through the target signature file signed by the Secure Boot certificate stored in the EFITEST partition.
[0038] The memory testing method provided in this application separates the test preparation process from the test trigger execution process. In the early stage, only the storage operations of the target signature file and memory test script, as well as the write / deletion operations of the start test flag bit, are completed (e.g., S101 and S102). In the later stage, only the detection operation of the start test flag bit in the random access memory and the start memory test operation of the target test partition based on the detection result are performed (e.g., S103 and S104). This separate design can realize independent control of test preparation and test execution, which can not only ensure the security of the storage of the target signature file, memory test script and the write / deletion of the start test flag bit, but also realize automated memory testing through accurate detection of the start test flag bit in the power-on self-test stage, which can greatly improve the testing efficiency of the memory of the device under test.
[0039] Figure 2 The specific process of storing the target signature file and memory test script provided in the embodiments of this application. In some embodiments, such as Figure 2 As shown, S101 specifically includes: S1011. In the image creation stage of the device under test, a region is allocated from the storage medium of the device under test as the target test partition. The "image creation stage" refers to the stage in which the equipment manufacturer creates a system image and configures hardware parameters for the device under test before it leaves the factory.
[0040] "Storage media" refers to the hardware carrier in the device under test used to store various information such as system images, test files, and user data. It is the physical basis for dividing the target test partitions. For electronic devices such as personal computers (PCs) and laptops, common storage media include solid-state drives (SSDs), NVMe SSDs, and hard disk drives (HDDs). They have characteristics such as large capacity, partitionability, and high-speed read and write, which can meet the needs of system image storage, test file storage, and test log recording.
[0041] S1012. According to the preset directory structure, store the target signature file and the memory test script in the target test partition.
[0042] The "preset directory structure" refers to the standardized storage path specification pre-defined for the target signature file and memory test scripts, enabling the BIOS to accurately identify and load test-related files. This directory structure strictly adheres to the Unified Extensible Firmware Interface (UEFI) boot standard. For example, the UEFI Shell follows the path "EFI / BOOT / BOOTX64.efi," and the memory test tools and memory test scripts are stored in the root directory of the EFITEST partition. This ensures that when the device under test boots from the target test partition, the BIOS can quickly locate, read, and call the memory test tools, improving memory testing efficiency.
[0043] In this embodiment, when customizing the image, a target test partition, formatted as FAT32 and fixedly named EFITEST, is first partitioned on the storage medium of the device under test. Then, the target signature file, signed with a secure boot certificate, and the memory test script are stored within this target test partition according to a preset directory structure. Specifically, the UEFI Shell in the target signature file strictly adheres to the UEFI boot specification and is stored in the path "EFI / BOOT / BOOTX64.efi"; while the memory test tool and memory test script in the target signature file are directly stored in the root directory of the target test partition. On one hand, this fully adapts to the standardized file path requirements of the UEFI boot mechanism, ensuring that the BIOS can quickly locate and load the UEFI Shell during the power-on self-test (POST). On the other hand, by placing the memory test script and memory test tool in the same root directory, the UEFI Shell can directly call the memory test tool after starting and executing the memory test script, without needing additional configuration file path parameters, effectively simplifying the memory testing process and improving memory testing efficiency.
[0044] Figure 3 This application provides a specific process for writing or deleting the start test flag bit in its embodiments. In some embodiments, the preset combination key includes a first combination key and a second combination key; such as... Figure 3 As shown, S102 specifically includes: S1021. If the first combination key is detected to be triggered, the start test flag is written into the random access memory. The "first key combination" refers to the preset key combination used to trigger the memory test process, such as CTRL+ALT+M. When the tester presses this key combination and the EC detects its valid trigger state, it will write a start test flag bit into the ECRAM, providing an instruction signal for the BIOS to trigger the memory test process.
[0045] S1022. If the second combination key is detected to be triggered, the start test flag bit in the random access memory is deleted.
[0046] The "second key combination" refers to the preset key combination used to terminate the memory test process, such as CTRL+ALT+C. When the tester presses this key combination and the EC detects its valid trigger state, it will delete the boot test flag stored in the ECRAM, causing the BIOS to boot according to the normal procedure and terminating the memory test process.
[0047] In this embodiment, a laptop computer is used as the device under test, and the first key combination is CTRL+ALT+M and the second key combination is CTRL+ALT+C. The EC will detect the triggering status of the first and second key combinations in real time. When the EC detects that the CTRL+ALT+M key combination is pressed effectively, it will write a start test flag bit into the ECRAM; when the EC detects that the CTRL+ALT+C key combination is pressed effectively, it will delete the start test flag bit stored in the ECRAM. The detection of the preset key combinations and the writing and deletion of the start test flag bit are all completed independently by the EC, without relying on the BIOS power-on self-test (POST) process. Therefore, it can respond in real time even when the laptop computer is not powered off (e.g., in standby, test execution, system running, etc.), realizing flexible control of the memory testing process at all times.
[0048] Figure 4 The specific process for launching the target test partition provided in the embodiments of this application. In some embodiments, such as Figure 4 As shown, S104 specifically includes: S1041. If the start test flag bit exists in the random access memory, control the device under test to start the command line environment of the extensible firmware interface in the target signature file from the target test partition. Among them, "command line environment of extensible firmware interface" refers to the interactive command line operation environment (such as UEFI Shell) that runs before the operating system starts under the Unified Extensible Firmware Interface (UEFI) architecture.
[0049] S1042. Run the memory test script using the command-line environment based on the extensible firmware interface; S1043. Based on the memory test script, call the memory test tool in the target signature file to perform memory test operations.
[0050] Among them, "memory testing tool" refers to a component specifically designed for memory testing. This memory testing tool is signed and certified by a secure boot certificate, has memory testing capabilities, and can perform testing operations on the memory of the device under test.
[0051] In this embodiment, when the BIOS detects a boot test flag stored in the ECRAM during the power-on self-test (POST) phase, it controls the device under test to boot from the target test partition. Subsequently, the BIOS loads the command-line environment (e.g., UEFI Shell) of the extensible firmware interface in the target signature file within the target test partition according to the UEFI boot specification, and automatically runs the memory test script (e.g., Startup.nsh script) stored in the root directory of the target test partition through the command-line environment of the extensible firmware interface. It further calls the memory test tool (e.g., MemoryTestX64.efi) stored in the same directory as the memory test script to perform memory test operations.
[0052] In some embodiments, before storing the target signature file and memory test script in the target test partition when the device under test is in factory test mode, the memory testing method further includes: S111. Perform secure boot certificate signing processing on the command line environment and memory testing tool of the extensible firmware interface to obtain a target signature file containing the command line environment and memory testing tool of the extensible firmware interface. "Secure Boot Certificate Signing Processing" refers to the process by which device manufacturers use their legally held Secure Boot certificates to digitally sign the command-line environment (such as UEFI Shell) and memory testing tools of the extensible firmware interface, so that the target signed file meets the certification requirements of the UEFI secure boot mechanism and ensures that the BIOS can be legally loaded and executed.
[0053] S112. Write the filename information of the memory testing tool into the memory testing script.
[0054] Among them, "filename information of memory testing tool" refers to the complete file name and suffix information of the memory testing tool (e.g., MemoryTestX64.efi). This information includes file identifier and format attributes, which is the key identifier for the memory testing script to accurately locate and call the corresponding memory testing tool in the target test partition.
[0055] In this embodiment, a Secure Boot certificate is first used to digitally sign the UEFI Shell and memory testing tools, generating a target signature file that conforms to the UEFI Secure Boot authentication standard. Secondly, the memory testing script (Startup.nsh script) is edited, incorporating the filename information of the memory testing tool (e.g., MemoryTestX64.efi) to ensure the script can accurately locate and call the corresponding memory testing tool. Through this process, the device under test can load and run memory testing-related files normally without disabling Secure Boot. This fully preserves the security protection mechanisms during system startup, effectively preventing the illegal loading of malicious files, while also allowing the memory testing tool to be launched smoothly to perform memory testing operations. This successfully solves the technical problem in traditional testing solutions where "Secure Boot must be disabled to run unsigned testing tools."
[0056] In some embodiments, the memory testing method further includes: S121. During the power-on self-test of the basic input / output system, if a preset shortcut key is detected to be triggered, the start test flag bit in the random access memory is deleted, and the memory test operation is terminated. The detection priority of the preset shortcut key is higher than the detection priority of the start test flag.
[0057] "Preset shortcut keys" refer to physical keys that device manufacturers pre-define for the device under test. These keys can be directly recognized by the BIOS during the device's power-on process and trigger specific operations. Common preset shortcut keys include F2, F12, and Del.
[0058] In this embodiment, taking a laptop computer as the device under test as an example, if the BIOS detects that a preset shortcut key has been pressed during the power-on self-test (POST), it immediately deletes the boot test flag stored in the ECRAM, terminating the memory test process. Simultaneously, the BIOS will control the device under test to boot from the specified boot source according to the preset boot entry corresponding to the preset shortcut key. Further, taking the F12 key as an example, its corresponding preset boot entry is the regular system partition. When the BIOS detects that the F12 key has been pressed during the POST, it will delete the boot test flag in the ECRAM, terminate the memory test operation, and directly guide the laptop computer to boot from the regular system partition, ultimately entering the normal operating system interface.
[0059] In some embodiments, the memory testing method further includes: S131. When the device under test is not powered off, detect the trigger state of the second combination key; "Non-power-off state" refers to all operating states of the device under test where the power supply is not completely cut off, which is the opposite of "power-off state" (i.e., the power is completely disconnected and all hardware components of the device stop working). In this state, the device under test retains power to at least some hardware modules (such as the embedded controller EC) so that it can respond to external trigger commands such as preset key combinations.
[0060] S132. If the second combination key is detected to be triggered, the start test flag bit in the random access memory is deleted and the memory test operation is terminated.
[0061] In this embodiment, taking a laptop computer as the device under test as an example, the memory test termination method includes two trigger scenarios: Scenario 1: During the BIOS power-on self-test, if a preset shortcut key (e.g., F2 key, F12 key, Del key) is detected to be pressed effectively, the start test flag bit in the ECRAM will be deleted immediately, and the memory test process will be terminated; Scenario 2: When the laptop computer is not powered off (e.g., during the memory test execution stage, during the test standby stage, etc.), if the ECRAM detects that the second combination key (e.g., CTRL+ALT+C) is pressed effectively in real time, the start test flag bit stored in the ECRAM will be deleted immediately, and the currently executing memory test operation will be terminated, ensuring that the device under test quickly exits the memory test state and returns to the normal operating mode.
[0062] In some embodiments, the memory testing method further includes: S141. After the memory test is completed, collect the memory test results output by the memory test tool; Among them, "memory test results" refers to the comprehensive data set output by the memory testing tool after completing the test of the memory of the device under test, which reflects the quality and operating status of the memory hardware. It is the basis for judging whether the memory hardware meets the factory quality standards.
[0063] S142. Store the memory test results in the target test partition in the form of a memory test log.
[0064] The "memory test log" refers to a text file generated by a memory testing tool after completing memory testing. The log is structured according to a preset standardized format (such as XML, JSON, or a custom text format) and can be stored permanently in the target test partition. This memory test log comprehensively records test time, test equipment information, test items, and test results, possessing traceability and readability, providing a basis for memory quality analysis and product quality traceability.
[0065] In this embodiment, taking a laptop computer as the device under test as an example, after the memory testing tool in the target test partition completes a comprehensive test of the laptop's memory, the memory test script will automatically collect the various test results output by the memory testing tool, including key information such as memory capacity, hardware model, and read / write speed. Then, the memory test script will organize these memory test results into a standardized memory test log (e.g., result.log) according to a pre-set format and save it to the target test partition for easy retrieval of the memory test log for memory quality analysis and problem tracing.
[0066] This application provides another memory testing method. For example... Figure 5 As shown, the memory testing method includes: S501. Sign the UEFI Shell and Memory Test tools using the Secure Boot certificate.
[0067] In some embodiments, the UEFI Shell (e.g., BOOTX64.efi) and the Memory Test tool (MemoryTestX64.efi) are signed with Secure Boot’s certificate.
[0068] S502. Fill the filename information of the signed Memory Test EFI into the Startup.nsh script.
[0069] In some embodiments, edit the Startup.nsh script and enter the name of the Memory Test EFI file. S503. Determine if the device under test is in MFG mode. Here, if it is "yes", meaning the device under test is in MFG mode, proceed to S504; otherwise, meaning the device under test is not in MFG mode, proceed to S509.
[0070] S504: In the customized image, divide the EFITEST partition and place the signed files and Startup.nsh script according to the directory structure.
[0071] In some embodiments, when customizing the image, a specific FAT32 formatted partition is created, with a fixed partition name, such as EFITEST. The UEFI Shell and Memory Test signed files, along with the Startup.nsh script file, are placed in this partition. The UEFI Shell file directory structure is EFI / BOOT / BOOTX64.efi, and the Memory Test signed files and Startup.nsh script are placed in the root directory of the partition.
[0072] S505, EC detection combination key, record / clear flag.
[0073] In some embodiments, if the EC detects that the CTRL+ALT+M key combination is pressed, it records the flag bit (i.e., the aforementioned boot test flag bit) to the ECRAM; if the EC detects that the CTRL+ALT+C key combination is pressed, it clears the relevant flag bit in the ECRAM. The detection of this key combination is completed by the EC and does not need to be pressed during the BIOS Post process to take effect.
[0074] S506, BIOS sets the Boot Select option based on the flag bits in ECRAM.
[0075] In some embodiments, the BIOS reads whether a flag bit exists in the ECRAM and automatically sets the device's boot options, such as which partition to boot from, based on the presence or absence of the flag bit.
[0076] S507. Determine if any other Post key combination keys have been pressed? Here, if there is another Post key combination pressed, enter S508; otherwise, if there is no other Post key combination pressed, enter S509.
[0077] The S508 BIOS sets a new Boot Select based on the Post key combination and clears the flag bits in the ECRAM.
[0078] In some embodiments, assuming that after the device under test is powered on, the BIOS enters the Post phase, at which point the flag bit already present in the embedded controller's built-in ECRAM will, according to the default logic, set the boot option (Boot Select) to the target test partition to start the memory test; however, if the tester presses the Post key combination (e.g., F12) during the Post process, the BIOS will respond to this operation first, reset the Boot Select to the regular system partition (i.e., the new Boot Select) and clear the flag bit in the ECRAM, and finally the device will boot from the regular system partition, and the memory test operation that was about to be executed will be terminated.
[0079] S509, normal startup.
[0080] S510, BIOS boots from EFITEST partition.
[0081] In some embodiments, during the BIOS Post process, a flag bit is detected in the ECRAM. If the flag bit is present, the BIOS will boot from a specific partition (e.g., the EFITEST partition). If another hotkey is detected, the relevant flag bit in the ECRAM is cleared and the BIOS will boot from the boot entry defined by the hotkey. In other words, the hotkey in the Post process has higher priority and can be used to terminate this test.
[0082] It should be noted that, in addition to pressing other hotkeys (such as F2, F12, Del) during the POST process, you can also terminate this test by pressing CTRL+ALT+C while the computer is not powered off.
[0083] S511, Automatically run the Startup.nsh script.
[0084] S512, automatically runs the memory testing tool in the Startup.nsh script.
[0085] S513, collect memory test results and data.
[0086] This application embodiment further provides a memory testing apparatus. For example... Figure 6 As shown, the memory testing device 600 includes: a first processing module 610, a second processing module 620, a third processing module 630, and a fourth processing module 640.
[0087] The first processing module 610 is used to store the target signature file and memory test script in the target test partition when the device under test is in the factory test mode. The second processing module 620 is used to write or delete the start test flag bit in the random access memory based on the trigger state of the preset combination key. The third processing module 630 is used to detect whether the start test flag bit exists in the random access memory during the power-on self-test of the basic input / output system. The fourth processing module 640 is used to control the device under test to start the target test partition to perform memory test operations if the start test flag bit exists in the random access memory.
[0088] In some embodiments, the first processing module 610 is specifically used to: during the image creation stage of the device under test, divide a region from the storage medium of the device under test as the target test partition; and store the target signature file and the memory test script in the target test partition according to a preset directory structure.
[0089] In some embodiments, the preset combination key includes a first combination key and a second combination key; the second processing module 620 is specifically configured to: if the first combination key is detected to be triggered, write the start test flag bit into the random access memory; if the second combination key is detected to be triggered, delete the start test flag bit in the random access memory.
[0090] In some embodiments, the fourth processing module 640 is specifically configured to: if the start test flag is present in the random access memory, control the device under test to start the command-line environment of the extensible firmware interface in the target signature file from the target test partition; run the memory test script based on the command-line environment of the extensible firmware interface; and call the memory test tool in the target signature file based on the memory test script to perform memory test operations.
[0091] In some embodiments, the memory testing apparatus 600 further includes: a fifth processing module and a sixth processing module, wherein, The fifth processing module is used to perform secure boot certificate signing processing on the command-line environment and memory testing tool of the extensible firmware interface to obtain a target signature file containing the command-line environment and the memory testing tool of the extensible firmware interface. The sixth processing module is used to write the file name information of the memory testing tool into the memory testing script.
[0092] In some embodiments, the memory testing device 600 further includes a seventh processing module, wherein the seventh processing module is configured to, during the power-on self-test of the basic input / output system, if a preset shortcut key is detected to be triggered, delete the start test flag bit in the random access memory and terminate the memory testing operation; wherein the detection priority of the preset shortcut key is higher than the detection priority of the start test flag bit.
[0093] In some embodiments, the memory testing apparatus 600 further includes: an eighth processing module and a ninth processing module, wherein, The eighth processing module is used to detect the trigger state of the second combination key when the device under test is not powered off. The ninth processing module is used to delete the start test flag bit in the random access memory and terminate the memory test operation if the second combination key is detected to be triggered.
[0094] In some embodiments, the target test partition is in FAT32 format.
[0095] In some embodiments, the memory testing apparatus 600 further includes: a tenth processing module and an eleventh processing module, wherein, The tenth processing module is used to collect the memory test results output by the memory testing tool after the memory test is completed; The eleventh processing module is used to store the memory test results in the form of memory test logs within the target test partition.
[0096] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the functional modules described above can be referred to the corresponding method steps in the foregoing embodiments, and will not be repeated here. Those skilled in the art can use different methods to implement the described functions for each specific application. For example, a computer software program containing the steps of the above method embodiments can be stored in a computer-readable storage medium so that, when executed, the program can implement one or more steps of the above method embodiments.
[0097] Figure 7 The diagram shows the structure of an electronic device according to an embodiment of this application. This embodiment does not limit the specific implementation of the electronic device.
[0098] like Figure 7 As shown, the electronic device 700 may include: a processor 710, a communication interface 720, a memory 730, and a communication bus 740.
[0099] The processor 710, communication interface 720, and memory 730 communicate with each other via communication bus 740. Communication interface 720 is used for communication connections with other external devices. The processor 710 executes program 750 to implement the image white point determination method described in one or more of the above embodiments.
[0100] Specifically, program 750 may include program code that includes computer operation instructions. When program 750 is invoked, processor 710 executes the computer operation instructions to implement the steps in the image white point determination method of one or more embodiments.
[0101] Depending on the actual application scenario, the processor 710 can be of the appropriate type, including but not limited to mainstream embedded processors such as microcontrollers (MCUs) and ARM architecture processors, as well as other types of processors such as digital signal processors (DSPs), application-specific integrated circuits (ASICs), and field-programmable gate arrays (FPGAs), as long as they can provide the computing and control capabilities required by the actual application scenario.
[0102] The memory 730 is used to store the program 750. It includes a program storage area and a data storage area. The program storage area is used to store firmware programs, embedded applications, and various functional modules; the data storage area is used to store data and calculation results during program execution. For example, the memory 730 may include: on-chip RAM (for temporary data storage during program execution); on-chip Flash memory (for storing program code and configuration data); and EEPROM or other types of non-volatile memory (for storing parameters that need to be retained when power is off).
[0103] This application also provides a computer-readable storage medium. This computer-readable storage medium can be a non-volatile computer-readable storage medium. This computer-readable storage medium stores a computer program.
[0104] When executed by a processor, the computer program implements one or more steps of the image white point determination method disclosed in the embodiments of this application. A complete computer program product is embodied on one or more computer-readable storage media containing the computer program disclosed in the embodiments of this application.
[0105] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of this application as described above. For the sake of brevity, they are not provided in detail. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A memory testing method, characterized in that, include: When the device under test is in factory test mode, the target signature file and memory test script are stored in the target test partition; Based on the trigger state of the preset key combination, write or delete the start test flag bit in the random access memory; During the power-on self-test of the basic input / output system, the presence of the start-up test flag bit in the random access memory is detected. If the start test flag is present in the random access memory, the device under test is controlled to start the target test partition to perform memory test operations.
2. The memory testing method according to claim 1, characterized in that, The step of storing the target signature file and memory test script in the target test partition includes: During the image creation stage of the device under test, a region is allocated from the storage medium of the device under test as the target test partition; According to the preset directory structure, the target signature file and the memory test script are stored in the target test partition.
3. The memory testing method according to claim 1, characterized in that, The preset key combination includes a first key combination and a second key combination; The trigger state based on the preset key combination, writing or deleting the start test flag bit in the random access memory, includes: If the first combination key is detected to be triggered, the start test flag is written into the random access memory; If the second key combination is detected to be triggered, the start test flag bit in the random access memory is deleted.
4. The memory testing method according to claim 1, characterized in that, If the start test flag is present in the random access memory, then the device under test is controlled to start the target test partition to perform memory test operations, including: If the start test flag is present in the random access memory, the device under test is controlled to start the command-line environment of the extensible firmware interface in the target signature file from the target test partition; The memory test script is run using the command-line environment based on the extensible firmware interface. Based on the memory test script, the memory test tool in the target signature file is invoked to perform memory test operations.
5. The memory testing method according to claim 1, characterized in that, Before storing the target signature file and memory test script in the target test partition when the device under test is in factory test mode, the method further includes: The command-line environment and memory testing tool of the extensible firmware interface are subjected to secure boot certificate signing processing to obtain a target signature file containing the command-line environment of the extensible firmware interface and the memory testing tool; Write the filename information of the memory testing tool into the memory testing script.
6. The memory testing method according to claim 1, characterized in that, The method further includes: During the power-on self-test of the basic input / output system, if a preset shortcut key is detected to be triggered, the start test flag bit in the random access memory is deleted, and the memory test operation is terminated. The detection priority of the preset shortcut key is higher than the detection priority of the start test flag.
7. The memory testing method according to claim 3, characterized in that, The method further includes: When the device under test is not powered off, the trigger state of the second combination key is detected; If the second key combination is detected to be triggered, the start test flag bit in the random access memory is deleted, and the memory test operation is terminated.
8. The memory testing method according to claim 1, characterized in that, The target test partition is in FAT32 format.
9. The memory testing method according to any one of claims 1 to 8, the method further comprising: After the memory test is completed, collect the memory test results output by the memory testing tool; The memory test results are stored in the target test partition in the form of a memory test log.
10. An electronic device, characterized in that, include: A memory and a processor, the processor being communicatively connected to the memory, the memory storing computer program instructions, which, when invoked by the processor, cause the processor to execute the memory testing method as described in any one of claims 1-8.