EMMC instant read-write verification method and device, readable storage medium and electronic equipment

By using the Java reflection mechanism and the underlying access interface in the Java application layer, realizing instant read and write verification of eMMC is solved, and the problem of inability to read and write in the Android Java application layer is improved, and the efficiency and accuracy of eMMC performance testing is improved.

CN120256229AActive Publication Date: 2025-07-04CHENGDU BIWIN STORAGE TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510732761.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-07-04
Estimated Expiration
2045-06-04

AI Technical Summary

Technical Problem

Instant read and write verification of eMMC cannot be achieved in the Android Java application layer. The existing methods have limitations and cannot efficiently test eMMC performance and are complex.

Method used

Use the Java reflection mechanism to obtain flags, define the underlying access function collection and direct access to the eMMC operation class, integrate the underlying access interface in the Java application layer, and perform instant read and write verification.

Benefits of technology

Implement cacheless real-time read and write verification in the Java application layer, reduce test complexity, improve eMMC performance testing efficiency, detect subtle data differences, and ensure read and write accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120256229A_ABST
    Figure CN120256229A_ABST
Patent Text Reader

Abstract

The invention discloses an eMMC instant read-write verification method and device, a readable storage medium and electronic equipment, and the method comprises the steps: obtaining a mark for direct input and output through a Java reflection mechanism, and defining a bottom layer access interface comprising a bottom layer access function set in a Java application layer, the bottom layer access function set comprises an opening function, a reading function, a writing function and a memory alignment distribution function, defining a direct access eMMC operation class in the Java application layer, integrating a bottom layer access interface by using the direct access eMMC operation class, and carrying out instant read-write verification on the eMMC by using the direct access eMMC operation class based on a mark to obtain a verification result, therefore, a tester does not need to carry out C / C + + coding, cache-free and instant read-write verification on the eMMC can be realized in an Android Java application layer, eMMC verification is transferred to an application layer from a development layer, the time for compiling and debugging a bottom driver is saved, the performance of the eMMC is more efficiently tested, and the test complexity is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of embedded storage technologies, and particularly to an eMMC instant read-write verification method, device, readable storage medium, and electronic device. Background Art

[0002] Performing instant read-write verification operations on an eMMC (embedded multimedia card) in the Android Java application layer is of great significance in the test and research and development scenarios of eMMC reliability and stability. However, direct reading and writing of the eMMC are not allowed in Android Java applications because this involves Android system permissions and underlying hardware, and the Java interface calls abstracted by the Android system are all cached and cannot perform instant read-write operations on the underlying eMMC. The following are the common methods and defects of the existing Android Java application layer for reading and writing the eMMC: (1) Performing file read-write operations through the File class, RandomAccessFile class, and related interfaces provided in the Android SDK (software development kit). Defect: Only supports files and cannot directly operate the eMMC device, and has data caching and cannot perform instant read-write.

[0003] (2) Invoking the read and write operations in the underlying C / C++ code through JNI (Java Native Interface) to read and write the eMMC. Defect: Requires C / C++ custom coding and cannot be implemented in the Java application layer.

[0004] (3) Executing system shell commands in Android Java and invoking system or third-party tools to complete the read and write operations on the eMMC block device, such as the dd tool (command-line tool) and cat tool (computer-aided translation tool). Defect: Limited by third-party tools and cannot freely complete the read and write operations on the eMMC device.

[0005] It can be seen from the above information that there are significant limitations in implementing cache-free and instant read-write verification of the eMMC in the Android Java application layer. Summary of the Invention

[0006] The technical problem to be solved by the present invention is: to provide an eMMC instant read-write verification method, device, readable storage medium, and electronic device, which can more efficiently test the eMMC performance and reduce the test complexity.

[0007] To solve the above technical problem, a technical solution adopted by the present invention is: An eMMC instant read-write verification method, comprising the steps of: Using the Java reflection mechanism to obtain a flag for direct input and output; Define a low-level access interface in the Java application layer, where the low-level access function set includes an open function, a read function, a write function, and a memory alignment allocation function; Define a direct access eMMC operation class in the Java application layer, and use the direct access eMMC operation class to integrate the low-level access interface; Based on the flag, use the direct access eMMC operation class to perform immediate read / write verification on the eMMC to obtain a verification result.

[0008] To solve the above technical problems, another technical solution adopted by the present invention is: An eMMC immediate read / write verification device, comprising: A flag acquisition module, configured to use the Java reflection mechanism to acquire a flag for direct input / output; An interface definition module, configured to define a low-level access interface in the Java application layer, where the low-level access function set includes an open function, a read function, a write function, and a memory alignment allocation function; A class definition module, configured to define a direct access eMMC operation class in the Java application layer, and use the direct access eMMC operation class to integrate the low-level access interface; A verification module, configured to perform immediate read / write verification on the eMMC based on the flag using the direct access eMMC operation class to obtain a verification result.

[0009] To solve the above technical problems, another technical solution adopted by the present invention is: A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each step in the above eMMC immediate read / write verification method is implemented.

[0010] To solve the above technical problems, another technical solution adopted by the present invention is: An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, each step in the above eMMC immediate read / write verification method is implemented.

[0011] The beneficial effects of the present invention are as follows: Use the Java reflection mechanism to obtain the flags for direct input and output, define a low-level access interface including a set of low-level access functions in the Java application layer. The set of low-level access functions includes an open function, a read function, a write function, and a memory alignment allocation function. Define a direct access eMMC operation class in the Java application layer, and use the direct access eMMC operation class to integrate the low-level access interface. Based on the flags, use the direct access eMMC operation class to perform immediate read and write verification on the eMMC to obtain a verification result. In this way, testers do not need to perform C / C++ coding, and can achieve cacheless and immediate read and write verification of the eMMC in the Android Java application layer, transfer the eMMC verification from the development level to the application level, save the time for writing and debugging low-level drivers, thereby more efficiently test the eMMC performance and reduce the test complexity. Description of the Drawings

[0012] Figure 1 It is a flowchart of the steps of an eMMC immediate read and write verification method according to an embodiment of the present invention; Figure 2 It is a schematic structural diagram of an eMMC immediate read and write verification device according to an embodiment of the present invention; Figure 3 It is a schematic structural diagram of an electronic device according to an embodiment of the present invention. Detailed Embodiments

[0013] To describe in detail the technical content, the achieved objectives and the effects of the present invention, the following is described in conjunction with the embodiments and the accompanying drawings.

[0014] Please refer to Figure 1 , an eMMC immediate read and write verification method, including the steps: Use the Java reflection mechanism to obtain the flags for direct input and output; Define a low-level access interface including a set of low-level access functions in the Java application layer, and the set of low-level access functions includes an open function, a read function, a write function, and a memory alignment allocation function; Define a direct access eMMC operation class in the Java application layer, and use the direct access eMMC operation class to integrate the low-level access interface; Based on the flags, use the direct access eMMC operation class to perform immediate read and write verification on the eMMC to obtain a verification result.

[0015] As can be seen from the above description, the beneficial effects of the present invention are as follows: Use the Java reflection mechanism to obtain the flags for direct input and output, define a low-level access interface including a set of low-level access functions in the Java application layer. The set of low-level access functions includes an open function, a read function, a write function, and a memory alignment allocation function. Define a direct access eMMC operation class in the Java application layer, and use the direct access eMMC operation class to integrate the low-level access interface. Based on the flags, use the direct access eMMC operation class to perform immediate read and write verification on the eMMC to obtain a verification result. In this way, testers do not need to perform C / C++ coding, and can implement cache-free and immediate read and write verification of the eMMC in the Android Java application layer, transfer the eMMC verification from the development level to the application level, save the time for writing and debugging the low-level driver, thereby more efficiently test the eMMC performance and reduce the test complexity.

[0016] Further, the direct access eMMC operation class includes a constructor method, a method for obtaining the eMMC sector size, a method for writing data, a method for reading data, and a data comparison verification method; The performing immediate read and write verification on the eMMC based on the flags using the direct access eMMC operation class to obtain a verification result includes: Based on the flags, call the constructor method and the open function to open and access the eMMC in a direct and immediate manner; Call the method for obtaining the eMMC sector size and the read function to obtain the sector size of the eMMC; Based on the sector size, call the method for writing data, the memory alignment allocation function, and the write function to write data to the eMMC; Based on the sector size, call the method for reading data, the memory alignment allocation function, and the read function to read data from the eMMC; Call the data comparison verification method to compare and verify the written data and the read data to obtain a verification result.

[0017] As can be seen from the above description, through the direct access eMMC operation class combined with the constructed set of low-level access functions, immediate access to the eMMC storage device can be achieved. The automated data comparison verification mechanism immediately verifies the integrity of the read data after writing, can quickly detect and correct potential storage errors or transmission problems. At the same time, implementing immediate read and write verification of the eMMC in the Android Java application layer simplifies the test complexity.

[0018] Further, the calling the constructor method and the open function based on the flags to open and access the eMMC in a direct and immediate manner includes: Call the open function in the construction method, and use the flag and the path of the eMMC as input parameters to input into the open function, so as to open and access the eMMC in a direct and immediate manner.

[0019] As can be seen from the above description, the flag obtained previously is used to set the mode for the system to access the eMMC. By calling the open function in the construction method and using the flag and the path of the eMMC as input parameters to input into the open function, the eMMC can be directly operated and accessed, improving the efficiency of eMMC performance testing.

[0020] Further, the steps of calling the method for obtaining the eMMC sector size and the read function to obtain the sector size of the eMMC include: Define an array with the preset sector size as an array element in the method for obtaining the eMMC sector size; Call the read function, and use the array elements in the array as input parameters to input into the read function respectively, and determine the array element that is successfully read for the first time as the sector size of the eMMC.

[0021] As can be seen from the above description, the preset sector size is a common sector size. By inputting it into the read function respectively, the physical sector size of different eMMC devices can be automatically adapted in a dynamic detection manner without the need to pre-hardcode specific values, improving the compatibility and portability of the code. Moreover, the validity of each candidate sector size is verified through actual read operations to ensure the accuracy of the detection results and avoid read and write errors caused by device specification differences.

[0022] Further, the steps of calling the data writing method, the memory alignment allocation function and the write function based on the sector size to write data to the eMMC include: In the data writing method, detect whether the size of the data buffer is a multiple of the sector size. If so, call the memory alignment allocation function to allocate a write memory block aligned according to the sector size, and copy the data in the data buffer to the write memory block, so that the data aligned according to the sector size in the write memory block is in a ready state; Call the write function, and use the write memory block as an input parameter to input into the write function to immediately write the data in the write memory block to the eMMC.

[0023] As described above, in the data writing method, it is detected whether the size of the data buffer is a multiple of the sector size. If so, the memory alignment allocation function is called to apply for a write memory block aligned according to the sector size, fundamentally avoiding system call failures or performance degradation caused by unaligned access, ensuring that each write operation conforms to the physical sector characteristics of the storage device, bypassing the kernel cache through the immediate write mechanism of the write function, and achieving low-latency operations where data directly reaches the storage medium.

[0024] Further, the data reading of the eMMC by calling the data reading method, the memory alignment allocation function, and the reading function based on the sector size includes: In the data reading method, it is detected whether the size of the data buffer is a multiple of the sector size. If so, the memory alignment allocation function is called to apply for a read memory block aligned according to the sector size; The reading function is called, and the read memory block is input as an input parameter to the reading function to immediately read the data in the eMMC into the read memory block.

[0025] As described above, in the data reading method, it is detected whether the size of the data buffer is a multiple of the sector size. If so, the memory alignment allocation function is called to apply for a read memory block aligned according to the sector size, ensuring that the direct I / O read operation fully conforms to the physical characteristic requirements of the storage device, avoiding read failures or performance losses caused by unaligned memory, and inputting the read memory block as an input parameter to the reading function to immediately read the data in the eMMC into the read memory block, enabling the data to be efficiently and reliably transferred directly from the eMMC device to the user space.

[0026] Further, the calling of the data comparison and verification method to compare and verify the written data and the read data to obtain a verification result includes: The data comparison and verification method is called, and the write memory block and the read memory block are input as input parameters to the data comparison and verification method; One byte is sequentially and orderly obtained from the write memory block and the read memory block respectively; It is determined whether the byte obtained from the write memory block is the same as the byte obtained from the read memory block. If not, the verification result is determined to be a failure. If so, the verification result is determined to be a success.

[0027] As described above, by comparing the written data and the read data byte by byte, the read and write accuracy of the eMMC can be accurately verified, any subtle data differences can be detected, and the reliability of the eMMC performance test is improved.

[0028] Please refer toFigure 2 , another embodiment of the present invention provides an eMMC instant read and write verification device, including: A flag acquisition module, configured to acquire a flag for direct input and output using the Java reflection mechanism; An interface definition module, configured to define a low-level access interface including a set of low-level access functions in the Java application layer, where the set of low-level access functions includes an open function, a read function, a write function, and a memory alignment allocation function; A class definition module, configured to define a direct access eMMC operation class in the Java application layer, and integrate the low-level access interface using the direct access eMMC operation class; A verification module, configured to perform instant read and write verification on the eMMC using the direct access eMMC operation class based on the flag to obtain a verification result.

[0029] Another embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each step in the above eMMC instant read and write verification method is implemented.

[0030] Please refer to Figure 3 , another embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, each step in the above eMMC instant read and write verification method is implemented.

[0031] The above eMMC instant read and write verification method, device, readable storage medium, and electronic device of the present invention can be applied to the test scenarios of eMMC reliability and stability, which will be described below through specific embodiments: Please refer to Figure 1 , Embodiment 1 of the present invention is: An eMMC instant read and write verification method, including the steps of: S1. Acquire a flag for direct input and output (I / O) using the Java reflection mechanism.

[0032] Wherein, the flag is the OsConstants.O_DIRECT flag hidden from the Java application in the Android framework layer. This flag is subsequently used to set the mode of system access to the eMMC.

[0033] S2. Define a low-level access interface including a set of low-level access functions in the Java application layer, where the set of low-level access functions includes an open function, a read function, a write function, and a memory alignment allocation function.

[0034] Among them, the difference between the underlying access interface and the Java native interface in the prior art is that the underlying access interface does not require C / C++ custom coding.

[0035] The input parameters of the open function include the file path and the flag, and the return value is the file descriptor, which is used to identify the file opened by the process. This function is used to open the eMMC device and the file, and this file is used to store the data written directly and retrieve it for verification.

[0036] The input parameters of the read function include the file descriptor, the read memory block, and the memory block size, and the return value is the number of bytes successfully read. This function is used to read data from the eMMC into the read memory block.

[0037] The input parameters of the write function include the file descriptor, the write memory block, and the memory block size, and the return value is the number of bytes successfully written. This function is used to write the data in the write memory block to the eMMC.

[0038] The input parameters of the posix_memalign function include the memory block, the sector size, and the memory block size, and the return value is whether the operation is successful. This function is used to align and arrange the memory block of the specified size according to the sector size.

[0039] In the above functions, the eMMC is operated by using the C function with the same name as the function. Specifically, the com.sun.jna.Native.load() method is called to load the C runtime library of the Android operating system, and this method calls the C language function with the same name to implement.

[0040] S3. Define a direct access eMMC operation class in the Java application layer, and use the direct access eMMC operation class to integrate the underlying access interface.

[0041] Among them, the direct access eMMC operation class includes a constructor method, a method for obtaining the eMMC sector size, a method for writing data, a method for reading data, and a method for data comparison and verification.

[0042] The present invention calls the underlying access interface through the direct access eMMC operation class, and this interface inherits com.sun.jna.Library.java to realize the interaction with the eMMC.

[0043] S4. Based on the flag, use the direct access eMMC operation class to perform immediate read and write verification on the eMMC to obtain a verification result, specifically including S41 - S45: S41. Based on the flag, call the constructor method and the open function to open and access the eMMC in a direct immediate manner.

[0044] Specifically, in the described construction method, the open function is called, and the flag and the path of the eMMC are input as input parameters into the open function to open and access the eMMC in a direct and immediate manner.

[0045] S42. Call the method for obtaining the eMMC sector size and the read function to obtain the sector size of the eMMC, which specifically includes S421 - S422: S421. Define an array with the preset sector size as an array element in the method for obtaining the eMMC sector size.

[0046] Wherein, the preset sector size is a common sector size of the eMMC or other storage devices. In an alternative embodiment, the preset sector size includes 512 bytes, 2048 bytes, and 4096 bytes.

[0047] For example, in the method for obtaining the eMMC sector size, an array is generated with 512 bytes, 2048 bytes, and 4096 bytes as array elements in ascending order.

[0048] S422. Call the read function, and input the array elements in the array as input parameters into the read function respectively, and determine the first successfully read array element as the sector size of the eMMC.

[0049] For example, first input 512 bytes as an input parameter into the read function. If the return value is the number of successfully read bytes, then determine the sector size of the eMMC as 512 bytes. Otherwise, continue to input 2048 bytes as an input parameter into the read function, and so on, until the sector size of the eMMC is determined.

[0050] S43. Based on the sector size, call the method for writing data, the memory alignment allocation function, and the write function to write data to the eMMC, which specifically includes S431 - S432: S431. In the method for writing data, detect whether the size of the data buffer is a multiple of the sector size. If so, call the memory alignment allocation function to apply for a write memory block aligned according to the sector size, and copy the data in the data buffer to the write memory block to make the data aligned according to the sector size in the write memory block in a ready state.

[0051] For example, assume that the sector size determined in the previous step is 512 bytes. In the data writing method, check whether the size of the buffer is a multiple of 512 bytes. If so, call the memory alignment allocation function to allocate a write memory block aligned to 512 bytes, and copy the data in the buffer to the write memory block, so that the data aligned to 512 bytes in the write memory block is in a ready state.

[0052] S432. Call the writing function and input the write memory block as an input parameter to the writing function to immediately write the data in the write memory block to the eMMC.

[0053] S44. Based on the sector size, call the data reading method, the memory alignment allocation function, and the reading function to read data from the eMMC, specifically including S441 - S442: S441. In the data reading method, check whether the size of the data buffer is a multiple of the sector size. If so, call the memory alignment allocation function to allocate a read memory block aligned to the sector size.

[0054] For example, in the data reading method, check whether the size of the buffer is a multiple of 512 bytes. If so, call the memory alignment allocation function to allocate a read memory block aligned to 512 bytes.

[0055] S442. Call the reading function and input the read memory block as an input parameter to the reading function to immediately read the data in the eMMC to the read memory block.

[0056] S45. Call the data comparison and verification method to compare and verify the written data and the read data to obtain a verification result, specifically including S451 - S453: S451. Call the data comparison and verification method and input the write memory block and the read memory block as input parameters to the data comparison and verification method.

[0057] S452. Sequentially obtain one byte from the write memory block and the read memory block in order.

[0058] S453. Determine whether the byte obtained from the write memory block is the same as the byte obtained from the read memory block. If not, determine that the verification result is a failure; if so, determine that the verification result is a success.

[0059] For example, obtain a byte wb_1 from the write memory block in sequence, then obtain a byte rb_1 from the read memory block, and determine whether the byte wb_1 is the same as the byte rb_1. If they are not the same, the verification result can be directly determined as failed. If they are the same, perform the comparison of the next byte, that is, obtain the next byte wb_2 from the write memory block, then obtain the next byte rb_2 from the read memory block, and determine whether the byte wb_2 is the same as the byte rb_2. If they are not the same, determine the verification result as failed. If they are the same, perform the comparison of the next byte, and so on. Only when the comparison of each pair of bytes is the same, the verification result is determined as successful.

[0060] Please refer to Figure 2 , Embodiment 2 of the present invention is: An eMMC instant read and write verification device, comprising: A flag acquisition module, configured to acquire a flag for direct input and output by using the Java reflection mechanism; An interface definition module, configured to define a low-level access interface including a set of low-level access functions in the Java application layer, and the set of low-level access functions includes an open function, a read function, a write function, and a memory alignment allocation function; A class definition module, configured to define a direct access eMMC operation class in the Java application layer, and integrate the low-level access interface by using the direct access eMMC operation class; A verification module, configured to perform instant read and write verification on the eMMC by using the direct access eMMC operation class based on the flag, and obtain a verification result.

[0061] Embodiment 3 of the present invention is: A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each step of the eMMC instant read and write verification method in Embodiment 1 can be implemented.

[0062] Embodiment 4 of the present invention is: Please refer to Figure 3 , An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, each step of the eMMC instant read and write verification method in Embodiment 1 is implemented.

[0063] In summary, the present invention provides an eMMC instant read and write verification method, device, readable storage medium and electronic device. The Java reflection mechanism is used to obtain the flag for direct input and output. A low-level access interface including a set of low-level access functions is defined in the Java application layer. The set of low-level access functions includes an open function, a read function, a write function, and a memory alignment allocation function. A direct access eMMC operation class is defined in the Java application layer, and the low-level access interface is integrated using the direct access eMMC operation class. Based on the flag, the direct access eMMC operation class is used to perform instant read and write verification on the eMMC to obtain a verification result. In this way, testers do not need to perform C / C++ coding, and instant read and write verification of the eMMC without caching can be achieved in the Android Java application layer, transferring the eMMC verification from the development level to the application level, saving the time for writing and debugging the low-level driver, thus testing the eMMC performance more efficiently and reducing the testing complexity. In addition, by comparing the written data and the read data byte by byte, the read and write accuracy of the eMMC can be accurately verified, any subtle data differences can be detected, and the reliability of the eMMC performance test is improved.

[0064] In the above embodiments provided by the present application, it should be understood that the disclosed method, device, computer-readable storage medium, and electronic device can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation. For example, multiple components or modules can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces, and the indirect coupling or communication connection of the device, component, or module may be in an electrical, mechanical, or other form.

[0065] The components described as separate components may or may not be physically separated, and the components displayed as components may or may not be physical modules, that is, they may be located in one place, or may be distributed to multiple network modules. Some or all of the components can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0066] In addition, in each embodiment of the present invention, the functional modules can be integrated into one processing module, or each component can exist physically alone, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules.

[0067] When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.

[0068] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0069] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0070] The above are only the embodiments of the present invention, and thus do not limit the patent scope of the present invention. Any equivalent transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in the relevant technical fields, shall be equally included in the patent protection scope of the present invention.

Claims

1. An eMMC instant read-write verification method, characterized in that, Including the steps: Using the Java reflection mechanism to obtain the flag for direct input and output; Defining a low-level access interface including a set of low-level access functions in the Java application layer, where the set of low-level access functions includes an open function, a read function, a write function, and a memory alignment allocation function; Defining a direct access eMMC operation class in the Java application layer and integrating the low-level access interface using the direct access eMMC operation class; Based on the flag, using the direct access eMMC operation class to perform immediate read and write verification on the eMMC to obtain a verification result.

2. The eMMC instant read-write verification method according to claim 1, wherein The direct access eMMC operation class includes a constructor method, a method for obtaining the eMMC sector size, a method for writing data, a method for reading data, and a data comparison verification method; The performing immediate read and write verification on the eMMC based on the flag using the direct access eMMC operation class to obtain a verification result includes: Based on the flag, calling the constructor method and the open function to open and access the eMMC in a direct immediate manner; Calling the method for obtaining the eMMC sector size and the read function to obtain the sector size of the eMMC; Based on the sector size, calling the method for writing data, the memory alignment allocation function, and the write function to write data to the eMMC; Based on the sector size, calling the method for reading data, the memory alignment allocation function, and the read function to read data from the eMMC; Calling the data comparison verification method to compare and verify the written data and the read data to obtain a verification result.

3. The eMMC instant read-write verification method according to claim 2, wherein The calling the constructor method and the open function based on the flag to open and access the eMMC in a direct immediate manner includes: In the constructor method, calling the open function and inputting the flag and the path of the eMMC as input parameters into the open function to open and access the eMMC in a direct immediate manner.

4. The eMMC instant read-write verification method according to claim 2, wherein The calling the method for obtaining the eMMC sector size and the read function to obtain the sector size of the eMMC includes: Defining an array with a preset sector size as an array element in the method for obtaining the eMMC sector size; Calling the read function and inputting the array elements in the array as input parameters into the read function respectively, and determining the first successfully read array element as the sector size of the eMMC.

5. The eMMC instant read / write verification method according to claim 2, wherein The writing data to the eMMC based on the sector size by calling the method for writing data, the memory alignment allocation function, and the write function includes: In the method for writing data, detecting whether the size of the data buffer is a multiple of the sector size. If so, calling the memory alignment allocation function to apply for a write memory block aligned according to the sector size, and copying the data in the data buffer to the write memory block to make the data aligned according to the sector size in the write memory block in a ready state; Calling the write function and inputting the write memory block as an input parameter into the write function to immediately write the data in the write memory block to the eMMC.

6. The eMMC instant read-write verification method according to claim 5, characterized in that, Invoking the data reading method, the memory alignment allocation function, and the reading function based on the sector size to read data from the eMMC includes: In the data reading method, detect whether the size of the data buffer is a multiple of the sector size. If so, invoke the memory alignment allocation function to apply for a read memory block aligned according to the sector size; Invoke the reading function and input the read memory block as an input parameter to the reading function to immediately read the data in the eMMC into the read memory block.

7. The eMMC instant read-write verification method according to claim 6, wherein Invoking the data comparison and verification method to compare and verify the written data and the read data, and obtaining the verification result includes: Invoke the data comparison and verification method and input the written memory block and the read memory block as input parameters to the data comparison and verification method; Successively obtain one byte from the written memory block and the read memory block in sequence; Determine whether the byte obtained from the written memory block is the same as the byte obtained from the read memory block. If not, determine that the verification result is a failure. If so, determine that the verification result is a success.

8. An eMMC instant read-write verification device, characterized in that, Includes: A flag acquisition module for acquiring a flag for direct input and output using the Java reflection mechanism; An interface definition module for defining a low-level access interface including a set of low-level access functions in the Java application layer. The set of low-level access functions includes an open function, a reading function, a writing function, and a memory alignment allocation function; A class definition module for defining a direct access eMMC operation class in the Java application layer and integrating the low-level access interface using the direct access eMMC operation class; A verification module for performing immediate read and write verification on the eMMC using the direct access eMMC operation class based on the flag to obtain a verification result.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, each step in an eMMC immediate read and write verification method according to any one of claims 1 to 7 is implemented.

10. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, each step in an eMMC immediate read and write verification method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • EMMC verification method and system and storage medium

    CN113297023A

  • Read-write method and device of eMMC device, equipment and storage medium

    CN114936173A

  • Performance test method and device for EMMC device based on Android device

    CN117873799A

  • Storage system including a connection unit and a plurality of networked storage nodes

    US20180059969A1

  • Log writing method, apparatus and system

    WO2019057000A1