Background
The existing high-pass platform modifies the NV parameters (Non Voliatile, non-volatile parameters) by:
(1) Read-write modification is performed through QXDM (The QUALCOMM Extensible Diagnostic Monitor, high-pass debugging tool requiring high-pass account authorization) tools;
(2) Reading, writing and modifying NV parameters through the existing interface of the high-pass platform;
The specific flow is as follows:
1. Updating apk;
2. updating qcNVItem. Jar;
3. updating QcRilHook.jar;
4. update libqcril _qmi.so;
5. Update libqmi.so;
6. Updating NON-HLOS. Bin;
7. Updating the NV parameters;
8. The machine is restarted.
The method comprises the following steps:
(1) The upper layer application apk can call the doNvRead/doNvWrite private interface in the middle layer qcnvItems. Jar to read and write NV items;
(2) doNvRead/doNvWrite in turn calls the sendQcRilHookMsg interface in qcrilhook, jar to read and write NV items by sending messages;
(3) sendQcRilHookMsg calls the sendOemRilRequestRaw interface in qcrilmsgtunnel to send the request ID and then make a callback through IOemHookCallback;
Wherein QcRilHook.jar
The QcRilHook.java only provides QCRILHOOK ID, but does not provide an interface to the outside and does not provide a corresponding read-write efs file interface.
(4) The upper layer calls down, call qcril-qmi.so, and then walk qcril _main main function;
(5) Call qcril _init function in qcril _main;
(6) Qcril _ init calls qcril _ init _ hash _ table interface, qcril _init_hash u Table interface function there is a qcril _event_table table.
Wherein qcril.java provides the read-write NV corresponding QCRIL _evt_hook_nv ID as follows:
One-to-one correspondence with the IDs in QcRilHook above.
(7) The qcril library calls to the bottom layer can be transferred to the qmi of the modem side through a qmi message mechanism;
qcril_other_request_oem_hook_nv_read()
qcril_other_request_oem_hook_nv_write();
(8) The modem side qmi calls the corresponding read-write NV interface (nvio _read_item/nvio _write_item);
(9) The nvio _read_item/nvio _write_item read-write interface has a call efs_get/efs_put function;
(10) The efs_get/efs_put function finally calls the efs_read/efs_write function to read and write the NV item, and finally writes the NV item into the EFS to realize apk read and write NV parameters;
(11) Restarting the equipment;
it has the following disadvantages:
1. When the NV parameters are updated, the whole modem mirror image file, other intermediate jar packages and the so library are required to be updated, and the updating efficiency is low;
2. The QcRilHook.jar only provides QCRILHOOK ID, but does not provide an interface to the outside and a corresponding read-write EFS file interface, and only the NV parameters can be updated, and other information of the EFS file cannot be updated.
Detailed Description
In order to describe the technical contents, the achieved objects and effects of the present invention in detail, the following description will be made with reference to the embodiments in conjunction with the accompanying drawings.
Referring to fig. 1, a method for supporting dynamic read-write NV parameters includes:
s1, updating and installing a preset APK application;
s2, receiving an NV parameter read-write request of a preset APK application, and calling a corresponding first read-write NV parameter interface in a pre-packaged parameter interface library through a java local interface, wherein the first read-write NV parameter interface comprises a read NV universal interface, a write NV universal interface, a read EFS file universal interface and a write EFS file universal interface;
S3, calling a diag service through the first read-write NV parameter interface, issuing a command sequence to the modem side, and reading, writing and updating NV parameters in an EFS file of the modem side;
S4, restarting the equipment if the NV parameters are changed.
As can be seen from the description, the invention has the beneficial effects that when the NV parameters are required to be updated, the apk can be dynamically updated, the apk is directly pushed to a client for remote updating or manual installation of the apk or OTA updating, the whole modem mirror image file and other intermediate jar packets and so libraries are not required to be updated, the QMI interface is not required to be expanded at the modem side, NON-HLOS. Bin is not required to be updated, the NV parameters are directly updated through dynamically updating the apk, the time for updating the whole packet by the client and the resources for consuming data flow are greatly reduced, the updating efficiency is improved, and the invention provides a universal read-write interface for the EFS file, and the EFS file can be updated. The NV parameters can be updated, so that the problems of customized updating of some communication functions of clients and network problematic and complicated diseases can be solved.
Further, the step S1 specifically includes:
if the device installs the preset APK application for the first time, integrating an intermediate library libnvrw _ext and a high-pass UI control library libmmi, wherein the parameter interface library is located in the intermediate library libnvrw _ext;
otherwise, updating the APK application directly.
As can be seen from the above description, the present invention needs to integrate the intermediate repository libnvrw _ext and the high-pass UI control repository libmmi, which includes control interfaces of buttons, windows and texts, and some NV read-write interfaces, when the preset application is installed for the first time, to ensure the normal call of the subsequent function interfaces.
Further, in step S3, the calling of the diag service through the read-write NV parameter interface, and the issuing of the command sequence to the modem side specifically includes:
the first read-write NV parameter interface sends a call request to a second read-write NV parameter interface in the high-pass UI control library libmmi;
The second read-write NV parameter interface receives a call request of the first read-write NV parameter interface, packages a command sequence header according to the call request of the first read-write NV parameter interface, and sends a call request containing the command sequence header to the send_command interface;
The send_command interface receives a call request of a second read-write NV parameter interface, acquires the command sequence header, generates a complete command sequence according to the call request of the second read-write NV parameter interface, and then sends a call request containing the command sequence to a diag_callback_send_data interface in a high-pass UI control library libdiag by using diag service;
The diag_callback_send_data interface receives a call request of the send_command interface, assembles a character array data_buf value according to the call request of the send_command interface, acquires the command sequence, and then sends a call request containing the command sequence to the diag_send_data interface;
The diag_send_data interface receives the request of the diag_callback_send_data interface, acquires the command sequence, and writes the command sequence into the file descriptor FD.
As can be seen from the above description, the first read-write NV parameter interface calls the second read-write NV parameter interface, encapsulates the command sequence header, calls the send_command interface to issue the command sequence, and finally writes the command sequence into the file descriptor FD, thereby implementing issuing the command sequence to the modem side.
Further, in step S3, the reading and writing of the NV parameters in the EFS file at the modem side and updating are specifically:
The modem side detects the writing of command sequences, and sends a call request to a third read-write NV parameter interface for reading and writing NV parameters of the modem side through a diag service;
the third read-write NV parameter interface receives a call request of the modem side and sends the call request to the nv_cmd_diag interface;
and the nv_cmd_diag interface calls a corresponding function efs_read or efs_write according to the request of the third read-write NV parameter interface to read and write the EFS file.
From the above description, the modem side finally performs read-write update on the EFS file through the requested call, thereby implementing dynamic read-write of the NV parameters.
Further, the pre-packaged parameter interface library is specifically an nv_rw_ext library pre-packaged in the intermediate library libnvrw _ext.
As can be seen from the above description, the nv_rw_ext library is encapsulated in libnvrw _ext, and the nv_rw_ext includes interfaces such as diag_lsm_ Init, register _ callback, diag _nv_read, diag_nv_write, diag_lsm_ DeInit, and the like, and no further expansion is needed in the following.
As shown in fig. 3, the present invention further provides a terminal for supporting dynamic read-write NV parameters, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
s1, updating and installing a preset APK application;
s2, receiving an NV parameter read-write request of a preset APK application, and calling a corresponding first read-write NV parameter interface in a pre-packaged parameter interface library through a java local interface, wherein the first read-write NV parameter interface comprises a read NV universal interface, a write NV universal interface, a read EFS file universal interface and a write EFS file universal interface;
S3, calling a diag service through the first read-write NV parameter interface, issuing a command sequence to the modem side, and reading, writing and updating NV parameters in an EFS file of the modem side;
S4, restarting the equipment if the NV parameters are changed.
As can be seen from the description, the invention has the beneficial effects that when the NV parameters are required to be updated, the apk can be dynamically updated, the apk is directly pushed to a client for remote updating or manual installation of the apk or OTA updating, the whole modem mirror image file and other intermediate jar packets and so libraries are not required to be updated, the QMI interface is not required to be expanded at the modem side, NON-HLOS. Bin is not required to be updated, the NV parameters are directly updated through dynamically updating the apk, the time for updating the whole packet by the client and the resources for consuming data flow are greatly reduced, the updating efficiency is improved, and the invention provides a universal read-write interface for the EFS file, and the EFS file can be updated. The NV parameters can be updated, so that the problems of customized updating of some communication functions of clients and network problematic and complicated diseases can be solved.
Further, the step S1 specifically includes:
if the device installs the preset APK application for the first time, integrating an intermediate library libnvrw _ext and a high-pass UI control library libmmi, wherein the parameter interface library is located in the intermediate library libnvrw _ext;
otherwise, updating the APK application directly.
As can be seen from the above description, the present invention needs to integrate the intermediate repository libnvrw _ext and the high-pass UI control repository libmmi, which includes control interfaces of buttons, windows and texts, and some NV read-write interfaces, when the preset application is installed for the first time, so as to ensure the normal call of the subsequent function interfaces.
Further, in step S3, the calling of the diag service through the read-write NV parameter interface, and the issuing of the command sequence to the modem side specifically includes:
the first read-write NV parameter interface sends a call request to a second read-write NV parameter interface in the high-pass UI control library libmmi;
The second read-write NV parameter interface receives a call request of the first read-write NV parameter interface, packages a command sequence header according to the call request of the first read-write NV parameter interface, and sends a call request containing the command sequence header to the send_command interface;
The send_command interface receives a call request of a second read-write NV parameter interface, acquires the command sequence header, generates a complete command sequence according to the call request of the second read-write NV parameter interface, and then sends a call request containing the command sequence to a diag_callback_send_data interface in a high-pass UI control library libdiag by using diag service;
The diag_callback_send_data interface receives a call request of the send_command interface, assembles a character array data_buf value according to the call request of the send_command interface, acquires the command sequence, and then sends a call request containing the command sequence to the diag_send_data interface;
The diag_send_data interface receives the request of the diag_callback_send_data interface, acquires the command sequence, and writes the command sequence into the file descriptor FD.
As can be seen from the above description, the first read-write NV parameter interface calls the second read-write NV parameter interface, encapsulates the command sequence header, calls the send_command interface to issue the command sequence, and finally writes the command sequence into the file descriptor FD, thereby implementing issuing the command sequence to the modem side.
Further, in step S3, the reading and writing of the NV parameters in the EFS file at the modem side and updating are specifically:
The modem side detects the writing of command sequences, and sends a call request to a third read-write NV parameter interface for reading and writing NV parameters of the modem side through a diag service;
the third read-write NV parameter interface receives a call request of the modem side and sends the call request to the nv_cmd_diag interface;
and the nv_cmd_diag interface calls a corresponding function efs_read or efs_write according to the request of the third read-write NV parameter interface to read and write the EFS file.
From the above description, the modem side finally performs read-write update on the EFS file through the requested call, thereby implementing dynamic read-write of the NV parameters.
Further, the pre-packaged parameter interface library is specifically an nv_rw_ext library pre-packaged in the intermediate library libnvrw _ext.
From the above description, it is known that the nv_rw_ext library is encapsulated in libnvrw _ext, and the nv_rw_ext library can call interfaces including diag_lsm_ Init, register _ callback, diag _nv_read, diag_nv_write, diag_lsm_ DeInit, and the like, and no further expansion is needed in the following.
Referring to fig. 1 and 2, a first embodiment of the invention is as follows:
a method of supporting dynamic read-write NV parameters, comprising:
s1, updating and installing a preset APK application;
s2, receiving a request for reading NV parameters by a preset APK application, and calling a first read-write NV parameter interface nvrw _ext_read_general through a java local interface, wherein the nvrw _ext_read_general interface is a read NV universal interface, and in addition, the peer interface further comprises a write NV universal interface nvrw _ext_write_general, a read EFS file universal interface nvrw _ext_ffs_read and a write EFS file universal interface nvrw _ext_effs_write;
S3, nvrw _ext_read_general interface sends a call request to a second read/write NV parameter interface diag_nv_read in the high-pass UI control library libmmi, wherein the diag_nv_read interface is an interface for reading NV parameters, and the peer interface also comprises diag_nv_write, diag_effs_nv_read and diag_effs_nv_write;
The diag_nv_read interface receives a call request of nvrw _ext_read_general, packages a command sequence header according to the call request of the nvrw _ext_read_general interface, and sends a call request containing the command sequence header to the send_command interface;
The send_command interface receives a call request of a diag_nv_read interface, acquires the command sequence header, generates a complete command sequence according to the call request of the diag_nv_read interface, and then sends a call request containing the command sequence to a diag_callback_send_data interface in a high-pass UI control library libdiag by using diag service;
The diag_callback_send_data interface receives a call request of the send_command interface, assembles a character array data_buf value according to the call request of the send_command interface, acquires the command sequence, and then sends a call request containing the command sequence to the diag_send_data interface;
The diag_send_data interface receives a request of the diag_callback_send_data interface, acquires the command sequence, and writes the command sequence into a file descriptor FD;
The method comprises the steps that when a modem side detects writing of command sequences, a call request is sent to a nvdiag _read interface of the modem side through a diag service, wherein the nvdiag _read interface is an interface of the modem side for reading NV parameters through the diag service, and the peer-to-peer interface further comprises an interface nvdiag _write of the modem side for writing the NV parameters through the diag service;
the nvdiag _read interface receives a call request of the modem side and sends the call request to the nv_cmd_diag interface;
The nv_cmd_diag interface calls a corresponding function efs_read according to the request of the nvdiag _read interface to read the EFS file.
S4, restarting the equipment if the NV parameters are changed.
Referring to fig. 3, a second embodiment of the present invention is as follows:
A terminal 1 supporting dynamic read-write NV parameters, comprising a processor 2, a memory 3 and a computer program stored on the memory 3 and executable on the processor 2, said processor 2 implementing a method supporting dynamic read-write NV parameters as described above when executing said computer program.
In summary, the method and terminal for supporting dynamic read-write NV parameters provided by the invention can dynamically update apk when the NV parameters are required to be updated, push remote update or manual installation of apk or OTA update to a client directly for a background server, do not need to update the whole modem image file and other intermediate jar packets and so libraries, do not need to extend QMI interfaces at the modem side, do not need to update NON-HLOS. Bin, and directly update the NV parameters by dynamically updating apk, thereby greatly reducing the time for updating the whole packet and the resources consuming data flow of the client, improving the updating efficiency. The invention can solve the problems of customized updating of some communication functions of clients and network difficult and complicated diseases by updating NV parameters, in addition, the invention encapsulates an nv_rw_ext library in libnvrw _ext, and the nv_rw_ext library can call interfaces including diag_LSM_ Init, register _ callback, diag _nv_read, diag_nv_write, diag_LSM_ DeInit and the like, and the interfaces do not need to be expanded in the follow-up process.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent changes made by the specification and drawings of the present invention, or direct or indirect application in the relevant art, are included in the scope of the present invention.