Background
The existing high-pass platform method for modifying NV parameters (Non-volatile parameters) includes:
(1) reading and writing modification is carried out through a QXDM (The QUALCOMM Extensible Diagnostic Monitor which needs a high-pass debugging tool authorized by a high-pass account number) tool;
(2) reading and writing to modify NV parameters through the existing interface of the high-pass platform;
the specific process is as follows:
1. updating the apk;
2. jar updating qcnvitem;
3. updating QcRilHook.jar;
4. so, updating libqcril _ qmi;
5. so, update libqmi;
6. update NON-hlos.bin;
7. updating the NV parameters is completed;
8. the machine is restarted.
The method specifically comprises the following steps:
(1) the upper layer application apk can call a donvred/doNvWrite private interface in the middle layer qcnvitems.
(2) Donnvread/donnvwrite in turn calls the sendQcRilHookMsg interface in qcrilhook.
(3) Sending a request ID by a sendQcRilRequestRaw interface in the qcrilmsgunnel called by sendQcRilHookMsg, and then calling back through IOemHookCallback;
wherein, qcrilhook
Java provides only QCRILHOOK ID but does not provide an interface to the outside and does not provide a corresponding read-write efs file interface.
(4) So, calling downwards at the upper layer, calling qcril-qmi.so, and then walking a qcril _ main function;
(5) calling a qcril _ init function in qcril _ main;
(6) and the qcril _ init calls a qcril _ init _ hash _ table interface, and a qcril _ event _ table is arranged in a qcril _ init _ hash _ table interface function.
Java provides the read-write NV corresponding to QCRIL _ EVT _ HOOK _ NV ID, as follows:
corresponding to the ID in QcRilHook, above, one to one.
(7) The qcril library calls to the bottom layer and is transferred to qmi on the modem side through an qmi message mechanism;
qcril_other_request_oem_hook_nv_read()
qcril_other_request_oem_hook_nv_write();
(8) the modem side qmi will call the corresponding read-write NV interface (nvio _ read _ item/nvio _ write _ item);
(9) the reading and writing interface of nvio _ read _ item/nvio _ write _ item calls efs _ get/efs _ put function;
(10) the EFS _ get/EFS _ put function 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 the reading and writing of the NV parameter by the apk;
(11) restarting the equipment;
it has the following disadvantages:
1. when updating NV parameters, the whole modem image file, other intermediate jar packages and the so library need to be upgraded, and the updating efficiency is low;
2. jar only provides QCRILHOOK ID, but does not provide an interface to the outside and does not provide a corresponding read-write efs file interface; only the NV parameters can be updated, and other information of the EFS file cannot be updated.
Detailed Description
In order to explain technical contents, achieved objects, and effects of the present invention in detail, the following description is made with reference to the accompanying drawings in combination with the embodiments.
Referring to fig. 1, a method for supporting dynamic reading and writing of NV parameters includes:
s1, updating and installing the preset APK application;
s2, receiving NV parameter read-write requests of preset APK applications, and calling corresponding first read-write NV parameter interfaces in a pre-packaged parameter interface library through a java local interface, wherein the first read-write NV parameter interfaces comprise 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;
and S4, if the NV parameter is changed, restarting the equipment.
From the above description, the beneficial effects of the present invention are: when the NV parameters need to be updated, the invention can dynamically update the apk, the apk is directly pushed to a client by a background server for remote updating or manually installed apk or OTA (over the air technology) upgrading, the whole modem image file, other intermediate jar packages and so libraries do not need to be upgraded, the QMI interface does not need to be expanded on the modem side, and the NON-HLOS (management of network virtualization operating system) bin does not need to be updated. By updating the NV parameters, the problems of customized updating of some communication functions of a client and network difficult and complicated diseases can be solved.
Further, step S1 is specifically:
if the preset APK application is installed for the first time on the equipment, 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, directly updating the APK application.
It can be known from the above description that the middle library libnvrw _ ext and the high-pass UI control library libmmi need to be integrated when the preset application is installed for the first time, so as to ensure the normal call of the subsequent functional interface, and the high-pass UI control library includes control interfaces of buttons, windows and texts, and also includes some NV read-write interfaces.
Further, the step of calling the diag service through the read-write NV parameter interface in step S3, and issuing a command sequence to the modem side specifically includes:
the first read-write NV parameter interface sends a calling request to a second read-write NV parameter interface in a 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, encapsulates a command sequence header according to the call request of the first read-write NV parameter interface, and sends the 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 a command sequence header, generates a complete command sequence according to the call request of the second read-write NV parameter interface, and then sends the call request containing the command sequence to a diag _ callback _ send _ data interface in a libdiag of a high-pass UI control library by using a diag service;
the diag _ callback _ send _ data interface receives a calling request of a send _ command interface, assembles a character array data _ buf value according to the calling request of the send _ command interface, acquires the command sequence, and then sends the calling request containing the command sequence to the diag _ send _ data interface;
and 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.
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 the issue of the command sequence to the modem side.
Further, the reading and writing and updating the NV parameter in the EFS file of the modem side in step S3 specifically include:
the modem side detects the writing of a command sequence, and sends a calling 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 calling request of the modem side and sends the calling request to the NV _ cmd _ diag interface;
and calling a corresponding function EFS _ read or EFS _ write by the NV _ cmd _ diag interface according to the request of the third read-write NV parameter interface, and reading and writing the EFS file.
As can be seen from the above description, the modem side finally performs read-write update on the EFS file through the call of the request, 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 an intermediate library libnvrw _ ext.
As can be seen from the above description, the nv _ rw _ ext library is packaged in the libnvrw _ ext, and the nv _ rw _ ext includes interfaces such as Diag _ LSM _ Init, register _ callback, Diag _ nv _ read, Diag _ nv _ write, and Diag _ LSM _ DeInit, and no expansion is required subsequently.
As shown in fig. 3, the present invention further provides a terminal supporting dynamic reading and writing of NV parameters, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, where the processor executes the computer program to implement the following steps:
s1, updating and installing the preset APK application;
s2, receiving NV parameter read-write requests of preset APK applications, and calling corresponding first read-write NV parameter interfaces in a pre-packaged parameter interface library through a java local interface, wherein the first read-write NV parameter interfaces comprise 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;
and S4, if the NV parameter is changed, restarting the equipment.
From the above description, the beneficial effects of the present invention are: when the NV parameters need to be updated, the invention can dynamically update the apk, the apk is directly pushed to a client by a background server for remote updating or manually installed apk or OTA (over the air technology) upgrading, the whole modem image file, other intermediate jar packages and so libraries do not need to be upgraded, the QMI interface does not need to be expanded on the modem side, and the NON-HLOS (management of network virtualization operating system) bin does not need to be updated. By updating the NV parameters, the problems of customized updating of some communication functions of a client and network difficult and complicated diseases can be solved.
Further, step S1 is specifically:
if the preset APK application is installed for the first time on the equipment, 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, directly updating the APK application.
It can be known from the above description that the middle library libnvrw _ ext and the high-pass UI control library libmmi need to be integrated when the preset application is installed for the first time, so as to ensure the normal call of the subsequent functional interface, and the high-pass UI control library includes buttons, windows, text control interfaces, and some NV read-write interfaces.
Further, the step of calling the diag service through the read-write NV parameter interface in step S3, and issuing a command sequence to the modem side specifically includes:
the first read-write NV parameter interface sends a calling request to a second read-write NV parameter interface in a 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, encapsulates a command sequence header according to the call request of the first read-write NV parameter interface, and sends the 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 a command sequence header, generates a complete command sequence according to the call request of the second read-write NV parameter interface, and then sends the call request containing the command sequence to a diag _ callback _ send _ data interface in a libdiag of a high-pass UI control library by using a diag service;
the diag _ callback _ send _ data interface receives a calling request of a send _ command interface, assembles a character array data _ buf value according to the calling request of the send _ command interface, acquires the command sequence, and then sends the calling request containing the command sequence to the diag _ send _ data interface;
and 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.
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 the issue of the command sequence to the modem side.
Further, the reading and writing and updating the NV parameter in the EFS file of the modem side in step S3 specifically include:
the modem side detects the writing of a command sequence, and sends a calling 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 calling request of the modem side and sends the calling request to the NV _ cmd _ diag interface;
and calling a corresponding function EFS _ read or EFS _ write by the NV _ cmd _ diag interface according to the request of the third read-write NV parameter interface, and reading and writing the EFS file.
As can be seen from the above description, the modem side finally performs read-write update on the EFS file through the call of the request, 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 an intermediate library libnvrw _ ext.
As can be seen from the above description, the nv _ rw _ ext library is packaged in the libnvrw _ ext, and the nv _ rw _ ext library can call interfaces including flag _ LSM _ Init, register _ callback, Diag _ nv _ read, Diag _ nv _ write, and Diag _ LSM _ DeInit, and no expansion is required subsequently.
Referring to fig. 1 and fig. 2, a first embodiment of the present invention is:
a method for supporting dynamic read-write of NV parameters comprises the following steps:
s1, updating and installing the preset APK application;
s2, receiving a request for reading NV parameters by a preset APK application, 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 general interface, and the same level interface further comprises a write NV general interface nvrw _ ext _ write _ general interface, a read EFS file general interface nvrw _ ext _ EFS _ read and a write EFS file general interface nvrw _ ext _ EFS _ write;
s3, sending a call request to a second read-write NV parameter interface diag _ NV _ read in the high-pass UI control library libmmi by the nvrw _ ext _ read _ general interface, wherein the diag _ NV _ read interface is an interface for reading NV parameters, and the peer interface further comprises: diag _ nv _ write, diag _ efs _ nv _ read, diag _ efs _ nv _ write;
the diag _ nv _ read interface receives a call request of nvrw _ ext _ read _ general, encapsulates a command sequence header according to the call request of the nvrw _ ext _ read _ general interface, and sends the 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 a command sequence header, generates a complete command sequence according to the call request of the diag _ nv _ read interface, and then sends the call request containing the command sequence to a diag _ callback _ send _ data interface in the high-pass UI control library libdiag by using a diag service;
the diag _ callback _ send _ data interface receives a calling request of a send _ command interface, assembles a character array data _ buf value according to the calling request of the send _ command interface, acquires the command sequence, and then sends the calling 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 a modem side detects writing of a command sequence, and sends a call request to an nvdiag _ read interface of the modem side through a diag service, wherein the nvdiag _ read interface is an interface for the modem side to read NV parameters through the diag service, and the peer interface further comprises an interface nvdiag _ write for the modem side to write the NV parameters through the diag service;
the nvdiag _ read interface receives a calling request of the modem side and sends the calling request to the nv _ cmd _ diag interface;
and calling a corresponding function EFS _ read by the nv _ cmd _ diag interface according to the request of the nvdiag _ read interface, and reading the EFS file.
And S4, if the NV parameter is changed, restarting the equipment.
Referring to fig. 3, the second embodiment of the present invention is:
a terminal 1 supporting dynamic read-write of NV parameters comprises a processor 2, a memory 3 and a computer program which is stored on the memory 3 and can run on the processor 2, wherein the processor 2 realizes the above method for supporting dynamic read-write of the NV parameters when executing the computer program.
In summary, the method and the terminal for supporting dynamic read-write of NV parameters provided by the invention can perform dynamic update of apk when NV parameters need to be updated, the apk is directly sent to a client for remote update by a background server or manually installed apk or OTA (over the air technology) upgrade, the whole modem image file and other intermediate jar packages and so libraries do not need to be upgraded, a QMI (quality management interface) does not need to be expanded to the modem side, and NON-HLOS (NON-Hadoop-binary) is also not needed to be upgraded, the NV parameters are directly updated by dynamically updating the apk, the time for updating the whole package by the client and the resource consuming data flow are greatly reduced, the updating efficiency is improved, the general read-write interface of an EFS (electronic file) is provided, and the EFS (electronic file) can be updated. In addition, the invention has packaged NV _ rw _ ext storehouse in libnvrw _ ext, NV _ rw _ ext storehouse can call the interface including Diag _ LSM _ Init, register _ callback, Diag _ NV _ read, Diag _ NV _ write, Diag _ LSM _ DeInit, etc., need not expand subsequently.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to the related technical fields, are included in the scope of the present invention.