A method and apparatus for checking non-volatile memory values
By automating the verification of non-volatile memory values by reading and writing a table in the host computer, the inefficiency and accuracy problems caused by manual operation are solved, and the automatic verification and tamper detection of non-volatile memory values are realized.
Patent Information
- Application Number
- CN202110752912.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-02
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2041-07-02
AI Technical Summary
In existing technologies, when batch modifying values in non-volatile memory, manual operation is prone to errors, is inefficient, cannot guarantee verification accuracy, and is difficult to detect tampering.
The host computer reads the non-volatile memory value of the mobile terminal and writes it into a specified table. The value is then compared with the default value of the item. An automatic script performs modification verification and synchronously verifies whether the value has been tampered with.
It enables automated verification of non-volatile memory values, improving verification accuracy and efficiency, and ensuring the integrity of NV modifications.
Smart Images

Figure CN113568771B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of computer, in particular to a method and device for checking non-volatile memory value. BACKGROUND
[0002] Currently, mobile terminals often need to adjust various parameters for multiple times, which also includes modification of non-volatile memory. In the prior art, the value of non-volatile memory (NV value) is manually checked and modified. When the NV items are modified in batches, manual operation is prone to errors, and manual verification of NV item modification is inefficient, which cannot guarantee the accuracy of verification and is difficult to find the tampered NV items in the past. SUMMARY
[0003] An object of the present application is to provide a method and device for checking non-volatile memory value, which solves the problem that modification and integration of non-volatile memory value in the prior art can easily lead to errors.
[0004] According to an aspect of the present application, a method for checking non-volatile memory value is provided, which comprises:
[0005] returning the non-volatile memory value of the mobile terminal read by the host computer to the host computer and writing it into a specified table;
[0006] comparing all non-volatile memory values in the specified table with corresponding item default values to obtain a comparison result;
[0007] determining the non-volatile memory value in the specified table that has been modified according to the comparison result.
[0008] Optionally, the returning of the non-volatile memory value of the mobile terminal read by the host computer to the host computer comprises:
[0009] judging whether there is a new modified value of non-volatile memory based on the storage data in the host computer, and if so, reading the new modified value of non-volatile memory through a specified instruction and returning it to the host computer.
[0010] Optionally, before returning the non-volatile memory value of the mobile terminal read by the host computer to the host computer, it comprises:
[0011] specifying a reading interface and determining a specified table for storing the read non-volatile memory value, wherein the reading interface is used to realize reading of the non-volatile memory value in the mobile terminal and reading of the corresponding EFS file.
[0012] Optionally, the non-volatile memory value of the mobile terminal read by the host computer is returned to the host computer and written into a specified table, including:
[0013] The target path in the specified table is sent to the corresponding baseband chip in the mobile terminal by the host computer through the specified instruction;
[0014] The current value of the non-volatile memory in the target path is read through a specified function interface, and the current value is returned to the host computer and written into the specified table.
[0015] Optionally, the specified table is a table in a preset specified format.
[0016] Optionally, the storage data in the host computer includes a non-volatile memory modification configuration of the mobile terminal, and the method includes:
[0017] The item default value is determined according to the non-volatile memory modification configuration of the mobile terminal.
[0018] According to another aspect of the present application, there is also provided an apparatus for verifying a non-volatile memory value, the apparatus comprising:
[0019] A data reading module for returning the non-volatile memory value of the mobile terminal read by the host computer to the host computer and writing the non-volatile memory value into a specified table;
[0020] A judging module for comparing all non-volatile memory values in the specified table with corresponding item default values to obtain a comparison result;
[0021] A data processing module for determining a non-volatile memory value in the specified table that has been modified according to the comparison result.
[0022] According to still another aspect of the present application, there is also provided a computer readable medium having computer readable instructions stored thereon, the computer readable instructions being executable by a processor to implement the method of any one of the preceding aspects.
[0023] According to yet another aspect of the present application, there is also provided an apparatus for verifying a non-volatile memory value, wherein the apparatus comprises:
[0024] One or more processors; and
[0025] A memory having computer readable instructions stored thereon, the computer readable instructions being executable by the processor to perform the operations of the method of any one of the preceding aspects.
[0026] Compared with the prior art, the application returns the non-volatile memory value of the mobile terminal read by the host computer to the host computer and writes the non-volatile memory value into a specified table; compares all non-volatile memory values in the specified table with corresponding item default values to obtain a comparison result; and determines the non-volatile memory value in the specified table that is modified according to the comparison result. Thus, the modification of the non-volatile memory is checked by an automatic script, and whether the past NV modification item is tampered with is verified synchronously, thereby ensuring the accuracy of the check and improving the verification efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0027] Other features, objects, and advantages of the application will become more apparent from the following detailed description of non-limiting embodiments, when read in conjunction with the accompanying drawings:
[0028] Figure 1 Fig. 1 shows a flowchart of a method for checking a non-volatile memory value according to an aspect of the application;
[0029] Figure 2 Fig. 2 shows a flowchart of a method for checking a non-volatile memory value according to an optional embodiment of the application;
[0030] Figure 3 Fig. 3 shows a schematic diagram of a device framework structure for checking a non-volatile memory value according to another aspect of the application.
[0031] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION
[0032] The application is described in further detail below in conjunction with the accompanying drawings.
[0033] In a typical configuration of the application, the terminal, the device of the service network, and the trusted party each include one or more processors (CPU), input / output interfaces, network interfaces, and memories.
[0034] The memory can include non-permanent memory in a computer readable medium, random access memory (RAM), and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of the computer readable medium.
[0035] Computer-readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassette, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer readable media does not include transitory media such as modulated data signals and carriers.
[0036] Figure 1 A method for checking non-volatile memory values is shown according to an aspect of the present application. The method includes S100-S300, wherein in S100, the non-volatile memory values of the mobile terminal read by the host computer are returned to the host computer and written into a specified table; in S200, all non-volatile memory values in the specified table are compared with the corresponding item default values to obtain a comparison result; in S300, the non-volatile memory values in the specified table that have been modified are determined according to the comparison result. Thus, the modification of the non-volatile memory is checked by an automatic script, and whether the past NV modification items have been tampered with is verified synchronously, thereby ensuring the accuracy of the check and improving the verification efficiency.
[0037] It should be noted that the aforementioned method identification numbers do not define the implementation order of the above methods.
[0038] Specifically, in S100, the non-volatile memory values of the mobile terminal read by the host computer are returned to the host computer and written into a specified table. Here, the host computer can be a computer used by a developer or a maintenance personnel, which is connected with the mobile terminal to read the non-volatile memory values (NV values) of the mobile terminal and return them to the host computer and write them into a specified table.
[0039] In S200, all non-volatile memory values in the designated table are compared with corresponding item default values to obtain a comparison result. In S300, the non-volatile memory value in the designated table that is modified is determined according to the comparison result. Here, all NV values in the designated table are compared with corresponding item default values. If they are consistent, the modification target is achieved, for example, the current modification of the mobile terminal is to modify the network type. If the modified NV value is consistent with the corresponding item default value of the network type modification, it can be determined that the modification target of the network type is achieved, and the modification is correct. If they are not consistent, the modification may be tampered. Thus, the non-volatile memory value with inconsistent comparison result is determined, and the user is prompted.
[0040] In an optional embodiment of the present application, in S100, whether there is a new modified value of the non-volatile memory is determined based on the storage data in the host computer. If yes, the new modified value of the non-volatile memory is read by a specified instruction and returned to the host computer. Here, whether there is a new modified value of the non-volatile memory can be determined based on the code in the storage data in the host computer. If yes, the new modified value of the non-volatile memory is read by a specified instruction and returned to the host computer, so as to determine whether the past NV item is tampered by comparing the NV value in the table.
[0041] In an optional embodiment of the present application, before the non-volatile memory value of the mobile terminal read by the host computer is returned to the host computer, a specified reading interface and a designated table for storing the read non-volatile memory value are specified, wherein the reading interface is used to realize the reading of the non-volatile memory value in the mobile terminal and the reading of the corresponding EFS file. Here, the host computer can specify a reading interface and a designated table for storing the read non-volatile memory value, wherein the reading interface (com port) can return the NV value to be read in the designated table to the host computer by AT instruction, for example, by AT+QNVR or AT+QNVFR to obtain the NV value to be read in the designated table.
[0042] In an optional embodiment of the present application, in S100, the host computer sends the target path in the specified table to the corresponding baseband chip in the mobile terminal through the specified instruction; the current value of the non-volatile memory in the target path is read through the specified function interface, the current value is returned to the host computer, and the current value is written into the specified table. Here, the specified instruction can be an AT instruction, the host computer sends the target path in the specified table to the corresponding baseband chip (BP) in the mobile terminal through the AT instruction, then the current value of the NV in the target path can be read through the dsatutil_get_nv_item or efs_read function interface, the current value is returned to the host computer and written into the specified table.
[0043] In an optional embodiment of the present application, the specified table is a table of a preset specified format. Here, by presetting the specified table format as a specified format, the uniformity of all tables is ensured, and the tables have the characteristics of customization and expansion, which facilitates the verification of NV modification for different modification configurations and different terminals.
[0044] In an optional embodiment of the present application, the storage data in the host computer includes the non-volatile memory modification configuration of the mobile terminal, and the item default value is determined according to the non-volatile memory modification configuration of the mobile terminal. Here, the data processing module can be used to calculate and determine the item default value according to the non-volatile memory modification configuration of the mobile terminal.
[0045] Figure 2A flowchart of a method for checking non-volatile memory values in an optional embodiment of the present application is shown, in which AT command execution, AT command return value processing, table processing, and comparison query operations are implemented by Python. The AT command part needs to implement an interface for reading NV and efs files in the BP part. First, determine the specified table in the host computer. Determine whether there is a new NV modification according to the host computer. Whether there is a new NV modification can be determined according to the code instructions stored in the host computer by the user. If so, send the target nv item id that needs to be read in the table to the BP side through the AT command AT+QNVR or AT+QNVFR, and then read the NV value (nv data) of the specified NV item (nvitem) through the high-pass platform dsatutil_get_nv_item or efs_read function interface, and return the read NV value to the host computer to fill in the table. After reading and writing all the NV values in the table into the table, compare them with the corresponding item default values, and fill in the comparison results. The format of the table is unified, and has the characteristics of customization and extensibility, and the item default value can be determined by the user according to the modification configuration corresponding to the modified item. Thus, the modification of the non-volatile memory is checked by the automatic script, and whether the past NV modification item is tampered with is verified synchronously, thereby ensuring the accuracy of the check and improving the verification efficiency.
[0046] The embodiment of the present application also provides a computer readable medium having computer readable instructions stored thereon, which can be executed by a processor to implement the foregoing method for checking non-volatile memory values.
[0047] Corresponding to the method described above, the present application also provides a terminal, which includes a module or unit capable of executing the foregoing Figure 1 Or Figure 2 Or the method steps of each embodiment, these modules or units can be realized by hardware, software or a combination of software and hardware, and the present application is not limited. For example, in an embodiment of the present application, a device for checking non-volatile memory values is provided, wherein the device includes:
[0048] One or more processors; and
[0049] A memory having computer readable instructions stored thereon, which when executed cause the processor to perform the operations of the foregoing method for checking non-volatile memory values.
[0050] For example, the computer readable instructions, when executed, cause the one or more processors to:
[0051] The non-volatile memory value of the mobile terminal read by the host computer is returned to the host computer and written into a specified table; all non-volatile memory values in the specified table are compared with corresponding item default values to obtain a comparison result; and the non-volatile memory value in the specified table that is modified is determined according to the comparison result.
[0052] Figure 3 A device framework structure diagram for verifying non-volatile memory values is shown according to another aspect of the present application. The device includes a data reading module 100 for returning the non-volatile memory value of the mobile terminal read by the host computer to the host computer and writing into a specified table; a judging module 200 for comparing all non-volatile memory values in the specified table with corresponding item default values to obtain a comparison result; and a data processing module 300 for determining the non-volatile memory value in the specified table that is modified according to the comparison result. Thus, the verification of the modification of the non-volatile memory is realized by the automatic script, the past NV modification items are verified whether being tampered, the accuracy of the verification is ensured, and the verification efficiency is improved.
[0053] It should be noted that the contents executed by the data reading module 100, the judging module 200 and the data processing module 300 are the same as or corresponding to the contents in the above steps S100, S200 and S300, respectively, and thus are not described herein again for simplicity.
[0054] In an optional embodiment of the present application, the data reading module 100 is further configured to specify a reading interface and determine a specified table for storing the read non-volatile memory value before returning the non-volatile memory value of the mobile terminal read by the host computer to the host computer, wherein the reading interface is used to realize the reading of the non-volatile memory value in the mobile terminal and the reading of the corresponding EFS file. Herein, the data reading module 100 can specify the reading interface and determine the specified table for storing the read non-volatile memory value through the host computer, wherein the reading interface (com port) can return the NV value to be read in the specified table to the host computer through AT instruction, for example, through AT+QNVR or AT+QNVFR to obtain the NV value to be read in the specified table.
[0055] In an optional embodiment of the present application, the specified table is a table of a preset specified format. Herein, by presetting the format of the specified table as the specified format, the uniformity of all tables is ensured, and the tables have the characteristics of customization and expansion, which facilitates the verification of the NV modification for different modification configurations and different terminals.
[0056] In an alternative embodiment of the present application, the storage data in the host computer comprises a non-volatile memory modification configuration of the mobile terminal, and the data processing module 300 is further configured to determine the item default value according to the non-volatile memory modification configuration of the mobile terminal. In this case, the data processing module 300 is configured to determine the item default value according to the non-volatile memory modification configuration of the mobile terminal.
[0057] Obviously, various modifications and changes can be made to the present application by those skilled in the art without departing from the spirit and scope of the present application. Thus, it is intended that the present application cover the modifications and changes of this application, or its equivalents.
[0058] It should be noted that the present application can be implemented in software and / or a combination of software and hardware, for example, by using an application-specific integrated circuit (ASIC), a general purpose computer or any other similar hardware device. In one embodiment, the software program of the present application can be executed by a processor to implement the steps or functions described above. Similarly, the software program of the present application (including related data structures) can be stored in a computer-readable recording medium, such as a RAM memory, a magnetic or optical drive or a floppy disk and the like. In addition, some steps or functions of the present application can be implemented by hardware, for example, as a circuit cooperating with the processor to perform the respective steps or functions.
[0059] In addition, a part of the present application can be applied as a computer program product, for example, computer program instructions, when executed by a computer, through the operation of the computer, the method and / or technical solutions according to the present application can be invoked or provided. The program instructions invoking the method of the present application can be stored in a fixed or removable recording medium, and / or transmitted through a data stream in a broadcast or other signal bearing medium, and / or stored in the working memory of the computer device running according to the program instructions. In this case, according to one embodiment of the present application, the device comprises a memory for storing computer program instructions and a processor for executing program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to run the method and / or technical solutions based on the above-mentioned embodiments according to the present application.
[0060] It will be obvious to a person skilled in the art that the application is not limited to the details of the above-described exemplary embodiments but can be implemented in other embodiments without departing from the scope of the application. The application is therefore not limited by the described examples but can vary within the scope of the claims and their equivalents. No reference signs in the claims should be considered as limiting the scope of the claims. Furthermore, it is obvious that the wording "comprising" does not exclude other parts and does not exclude other steps. Singularity is not excluded with respect to plurality and vice versa. Multiple units or devices recited in a device claim can also be implemented by one unit or device by means of software or hardware. The terms first, second and the like do not denote any ordering, but rather serve as names.
Claims
1. A method of verifying a value of non-volatile memory, wherein, The method comprises: determining whether there is a new modified value of the non-volatile memory based on the storage data in the host computer, if yes, reading the new modified value of the non-volatile memory through a specified instruction and returning it to the host computer, and writing it into a specified table; comparing all non-volatile memory values in the specified table with corresponding item default values to obtain a comparison result, wherein the storage data in the host computer includes a non-volatile memory modification configuration of the mobile terminal, and the item default values are determined according to the non-volatile memory modification configuration of the mobile terminal; determining the non-volatile memory values in the specified table that have been modified according to the comparison result.
2. The method of claim 1, wherein, Before returning the non-volatile memory values of the mobile terminal read by the host computer to the host computer, it comprises: specifying a reading interface and a specified table for storing the read non-volatile memory values, wherein the reading interface is used to realize the reading of the non-volatile memory values in the mobile terminal and the reading of the corresponding EFS file.
3. The method of claim 2, wherein, Returning the non-volatile memory values of the mobile terminal read by the host computer to the host computer and writing them into a specified table comprises: using the host computer to send a target path in the specified table to the corresponding baseband chip in the mobile terminal through the specified instruction; reading the current value of the non-volatile memory in the target path through a specified function interface, returning the current value to the host computer, and writing it into the specified table.
4. The method of claim 1, wherein, The specified table is a table of a predetermined specified format.
5. An apparatus for verifying a non-volatile memory value, wherein, The device comprises: a data reading module for determining whether there is a new modified value of the non-volatile memory based on the storage data in the host computer, if yes, reading the new modified value of the non-volatile memory through a specified instruction and returning it to the host computer, and writing it into a specified table; a judging module for comparing all non-volatile memory values in the specified table with corresponding item default values to obtain a comparison result, wherein the storage data in the host computer includes a non-volatile memory modification configuration of the mobile terminal, and the item default values are determined according to the non-volatile memory modification configuration of the mobile terminal; a data processing module for determining the non-volatile memory values in the specified table that have been modified according to the comparison result.
6. A computer readable medium having computer readable instructions stored thereon, the computer readable instructions being executable by a processor to implement the method of any one of claims 1 to 4.
7. An apparatus for verifying a non-volatile memory value, wherein, The device comprises: one or more processors; and a memory having computer readable instructions stored thereon, the computer readable instructions, when executed, causing the processor to perform the operations of the method of any one of claims 1 to 4.
Citation Information
Patent Citations
NV data processing method and apparatus
CN101425079A
System for detecting the data change of a mobile phone
KR1020060028242A