Disclosure of Invention
The invention mainly aims to provide an APP management method, an intelligent terminal and a computer readable storage medium, and aims to solve the problem that development and maintenance of a plurality of APPs in a terminal in the prior art are complex.
In order to achieve the above object, the present invention provides an APP management method, which includes the steps of:
Receiving request information of an APP group;
according to the request object in the request information, calling a network interface corresponding to the request information;
according to the network interface, the request information is sent to a request server corresponding to the request object;
when feedback information sent by the request server according to the request information is detected, the feedback information is packaged and sent to the APP group.
Optionally, the APP management method, wherein the APP group includes a plurality of registered APPs; before receiving the request information of the APP group, the method further comprises the following steps:
when program information and a registration request sent by an APP are detected, judging whether the APP is the APP to be registered;
if yes, generating and storing identification information corresponding to the APP to be registered according to the program information.
Optionally, the APP management method, wherein the request information includes a data request, the request server includes a data server, and the feedback information includes feedback data; when detecting feedback information sent by the request server according to the request information, the method encapsulates and sends the feedback information to the APP group, and specifically includes:
and when feedback data sent by the data server according to the data request is detected, the feedback data is packaged and sent to the APP group.
Optionally, the APP management method, wherein the encapsulating and sending the feedback data to the APP group specifically includes:
judging whether identification information corresponding to the feedback data exists or not according to the identification information in the feedback data;
if so, taking the APP corresponding to the identification information as a target APP;
And packaging and sending the feedback data to the target APP.
Optionally, in the APP management method, the request information includes a subscription request, the subscription request includes a subscription topic, the request server includes a subscription server, and the feedback information includes push data; when detecting feedback information sent by the request server according to the request information, the method encapsulates and sends the feedback information to the APP group, and specifically includes:
When the subscription server detects push data sent by the subscription server according to the subscription request, judging whether topic information in the push data is the same as the subscription topic;
and if the push data are the same, packaging the push data and sending the push data to the APP group.
Optionally, the APP management method, wherein the encapsulating and sending the push data to the APP group specifically includes:
judging whether identification information corresponding to the push data exists or not according to the identification information in the push data;
If yes, taking the APP corresponding to the identification information as a target APP;
and packaging and sending the push data to the target APP.
Optionally, the APP management method, after generating and saving the identification information corresponding to the APP to be registered according to the program information, further includes:
and taking the program information as registration information and storing the registration information.
Optionally, in the APP management method, the generating and storing identification information corresponding to the APP to be registered according to the program information specifically includes:
Judging whether registration information which is the same as the program information exists or not;
If so, deleting the identification information corresponding to the registration information, generating the identification information corresponding to the APP to be registered according to the program information, and storing the identification information;
if the identification information does not exist, generating and storing identification information corresponding to the APP to be registered according to the program information.
In addition, to achieve the above object, the present invention further provides an intelligent terminal, where the intelligent terminal includes: the system comprises a memory, a processor and an APP management program stored in the memory and capable of running on the processor, wherein the APP management program realizes the steps of the APP management method when being executed by the processor.
In addition, to achieve the above object, the present invention also provides a computer-readable storage medium storing an APP management program which, when executed by a processor, implements the steps of the APP management method described above.
The invention provides an APP management method, an intelligent terminal and a computer readable storage medium, which are used for acquiring request information sent by an APP group formed by a plurality of APPs, then calling corresponding interfaces according to request objects in the request information, establishing communication connection with a server corresponding to the request objects based on the interfaces, and sending the request information to the server. And after the server sends the feedback information according to the request information, the feedback information is sent to the APP group. Therefore, the communication between the APP and the server is realized based on the intermediate intelligent terminal, and when parameters such as an interface of the server change, the relevant parameters of the intermediate intelligent terminal only need to be updated. That is, all internal APP of the same device receive management service together with a set of network request and message subscription, and meanwhile, the internal APP does not need to care about hardware parameters, network change processing, system version difference and other conditions of the device, so that compatibility is improved, cost of transplanting to other devices is reduced, development speed is improved, development success is reduced, and later maintenance becomes simpler and easier.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more clear and clear, the present invention will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The APP management method is applied to an APP management system, and the APP management system comprises a request management module and a user management module. As shown in fig. 1, the APP management method includes the following steps:
Step S100, receiving request information of an APP group.
Specifically, the APP group refers to a set formed by a plurality of APPs, and in the first implementation manner in this embodiment, only one APP in the APP group.
When the APP needs to request data from an external server, request information is sent to a request management module in an APP management system, and the request management module receives the request information sent by an APP group through a transmission interface between the request management module and the APP. Request information refers to a request that the APP needs to send certain data to a server for processing, or need to obtain certain data from a server. The request information contains the request object to be requested, namely the server, the requested content, the external interface and other information. The request object may appear as an IP address of the server, etc. that may identify a unique server.
In a second implementation of this embodiment, there are two or more APP in the APP set. For convenience of management, each APP added to an APP group needs to be registered, that is, the APP group includes a plurality of registered APPs. The registration process of APP is:
when program information and a registration request sent by an APP are detected, judging whether the APP is the APP to be registered;
if yes, generating and storing identification information corresponding to the APP to be registered according to the program information.
Specifically, when a certain APP needs to be registered, program information and a registration request are sent to a user management module, as shown in fig. 2, where the user management module determines whether the APP is an APP to be registered. The judging mode can be program information, user confirmation, white list and other modes. Taking user confirmation as an example, after the user management module receives the registration request and the program information, the APP is displayed through a display screen of the terminal, so that the user can confirm whether the APP is the APP to be registered or not if the user determines that the APP is the APP to be registered through input equipment such as a mouse. The white list is a list which is written with all relevant information of the APP to be registered in advance, the user management module can compare the program information with the white list to determine whether corresponding or consistent data exist, if yes, the APP is confirmed to be the APP in the white list, and therefore the APP is the APP to be registered.
If the APP is the APP to be confirmed, the identification information corresponding to the APP to be registered is generated according to the program information, and the identification information is generated in a plurality of ways, for example, a certain number is randomly generated, and then the number is bound with the program information, so that the identification information corresponding to the APP to be registered is generated. For example, splicing the APP version number in the program information and the name of the APP to obtain a character string, and taking the character string as identification information corresponding to the APP to be registered. The generation method of the identification information includes, but is not limited to, the above-mentioned methods, and since the methods are known by a plurality of mature technologies, they are not described in detail herein.
Further, there are two ways to detach the APP management system after APP registration, one is to detach directly, for example, the APP is unloaded by the user halfway, and the subsequent user is reinstalled. The user management module always stores the identification information of the APP in the process, if the APP is re-registered, one APP corresponds to two identification information, and in order to avoid conflict caused by repeated registration, in this embodiment, after the APP is registered, the program information is used as registration information and stored.
Therefore, in the process of generating the identification information corresponding to the APP to be registered, whether the registration information which is the same as the program information exists or not is judged. If so, the APP is the APP which is registered before, so that the identification information corresponding to the registration information is deleted, and the identification information corresponding to the APP to be registered is generated and stored according to the program information. If the identification information does not exist, the APP is a newly registered APP, and the past identification information does not exist, so that the identification information corresponding to the APP to be registered is directly generated and stored according to the program information.
The second way that an APP leaves the APP management system is to log off. Referring to fig. 5, the anti-registration, i.e. the cancellation, APP sends the program information and cancellation information first, and then the user management module determines whether the APP is the cancellation APP, and the manner of determining whether the APP is the cancellation APP may be the same as the manner of determining whether the APP is the cancellation APP, for example, by man-machine interaction confirmation, through a preset cancellation list, and the like. If the APP is to be logged off, the locally stored registration information and identification information of the APP are directly deleted, and no corresponding registration information exists when the APP is subsequently re-registered, so that the APP can be directly registered.
Step S200, according to the request object in the request information, the network interface corresponding to the request information is called.
Specifically, a great number of public parameters such as interfaces, keys and the like related to information transmission are prestored in the request management module, and the request management module determines a network interface corresponding to a server according to a request object in the request, namely the server and invokes the network interface corresponding to the server, so that the invoking of the network interface corresponding to the request information is completed.
And step S300, according to the network interface, the request information is sent to a request server corresponding to the request object.
Specifically, after the network interface corresponding to the request information is called, the request information is sent to a server corresponding to the request object, and the server is used as a request server, wherein the request server is a server for processing the request information sent by the APP.
And step 400, when feedback information sent by the request server according to the request information is detected, the feedback information is packaged and sent to the APP group.
Specifically, after receiving the request information sent by the request management module, the request server searches the database for corresponding data, that is, the history record, according to the request content, for example, the history record of a certain time period, in the request information, and then sends the searched data as feedback information to the user management module. And the user management module sends the feedback information to the APP.
In the first implementation manner of this embodiment, since various request information sent by the APP is sent by the request management module, when the interface for providing services by the server changes, for example, upgrade, update, and delete, only the interface corresponding to the request management module needs to be modified, and the interface of the APP generally only needs to be connected with the request management module, so that modification of the APP interface is reduced.
In addition, some external interfaces and request parameters may only be called by some APP, but the request management module does not store parameters related to the record, for example, the parameters of the external interfaces may be transmitted to the request management module together with the request information, while other conventional interfaces may be called by the request management module, so that the number of request parameters sent by APP is reduced, and simplification of the request parameters is achieved.
The request information may be divided into data requests and subscription requests according to the content of the request. The data request is the request data required for controlling the request server to directly send the APP according to the request content. In the second implementation manner of this embodiment, the request information includes identification information of the APP that sends the request information, and the feedback information also includes the identification information, so that the subsequent user management module determines, according to the feedback information obtained by the server, the identification information of the feedback information to be received. For a data request, the request management module comprises a network request management module, the request server comprises a data server, and the feedback information comprises feedback data; when the request information is a data request, referring to fig. 3, the process of obtaining feedback data and sending the feedback data to the APP is: and when feedback data sent by the data server according to the data request is detected, the feedback data is packaged and sent to the APP group.
The data request sent by the APP in the APP group comprises an interface to be called, after the network management module receives the data request, the network management module establishes communication connection with an object of the data request, namely a data server according to the interface in the data request, and then sends the data request to the data server based on the communication connection between the data server and the network management module.
After receiving the data request, the data server retrieves corresponding data in a corresponding database according to the request content in the data request, and takes the data and the identification information corresponding to the APP as feedback data and sends the feedback data to the network management module.
The network management module sends the feedback data to the user management module, so that the user management module sends the feedback data to the APP group.
Since in the second implementation manner of this embodiment, there are multiple APPs in the APP group, the user management module needs to further confirm the APP that needs to receive the feedback data, that is, the target APP. In order to facilitate the user management module to confirm the target APP, the feedback data contains program information of the APP to be received with the feedback data, such as the name of the target APP and identification information of the target APP. Therefore, the user management module firstly judges whether the identification information corresponding to the feedback data exists or not according to the identification information in the feedback data. And if so, taking the APP corresponding to the identification information as a target APP. After the target APP is determined, the user module encapsulates the feedback data and sends the feedback data to the target APP. In the process of data encapsulation, the information which is not directly related to the request content in the feedback data, such as program information for confirming the target APP, can be deleted so as to reduce the transmission of useless data.
For a subscription request, the request management module comprises a message management module, the subscription request comprises a subscription topic, the request server comprises a subscription server, and the feedback information comprises push data. Referring to fig. 4, if an APP needs to subscribe to a push message of a website, a subscription request is sent to a message management module, and similar to a data sending request, the subscription request also includes parameters such as a called interface. And after receiving the subscription request, the message management module sends the subscription request to the subscription server. The subscription server may be a server having both a push function and a topic editing management function, or may be a combination of a push server having a push function and a server having a topic editing management function as shown in fig. 4.
Taking the case of fig. 4 as an example, the message management module sends a subscription request including a subscription topic to a server having a topic content editing management function, the server sends related content to a push server according to the subscription topic therein, and each time the push server receives related content sent by a previous server, the push server sends the related content as push data, that is, a push message in fig. 4, to the message management module. When the message management module detects push data sent by the subscription server according to the subscription request, judging whether topic information in the push data is the same as the subscription topic or not. And if the push data are the same, packaging the push data and sending the push data to a user management module, and then sending the push data to the APP group by the user management module. If the push data are different, deleting the push data, and ending the whole flow.
Further, in the second implementation manner of this embodiment, since there are a plurality of APPs in the APP group, similarly to processing feedback data, it is determined whether there is identification information corresponding to the push data according to the identification information in the push data. If yes, the user management module takes the APP corresponding to the identification information as a target APP; and packaging and sending the push data to the target APP. And judging whether identification information corresponding to the push data exists or not. Since this process is similar to the above-described process feedback data, it is not repeated here.
Further, as shown in fig. 6, based on the APP management method, the present invention further provides an intelligent terminal, which includes a processor 10, a memory 20 and a display 30. Fig. 6 shows only some of the components of the intelligent terminal, but it should be understood that not all of the illustrated components are required to be implemented, and more or fewer components may alternatively be implemented.
The memory 20 may in some embodiments be an internal storage unit of the smart terminal, such as a hard disk or a memory of the smart terminal. The memory 20 may also be an external storage device of the smart terminal in other embodiments, such as a plug-in hard disk provided on the smart terminal, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD), etc. Further, the memory 20 may also include both an internal storage unit and an external storage device of the smart terminal. The memory 20 is used for storing application software installed in the intelligent terminal and various data, such as program codes for installing the intelligent terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, memory 20 has stored thereon an APP management program 40, which APP management program 40 is executable by processor 10 to implement the APP management methods of the present application.
The processor 10 may in some embodiments be a central processing unit (Central Processing Unit, CPU), microprocessor or other data processing chip for executing program code or processing data stored in the memory 20, for example performing the APP management method or the like.
The display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like in some embodiments. The display 30 is used for displaying information on the intelligent terminal and for displaying a visual user interface. The components 10-30 of the intelligent terminal communicate with each other via a system bus.
In one embodiment, the following steps are implemented when the processor 10 executes the APP management program 40 in the memory 20:
Receiving request information of an APP group;
according to the request object in the request information, calling a network interface corresponding to the request information;
according to the network interface, the request information is sent to a request server corresponding to the request object;
when feedback information sent by the request server according to the request information is detected, the feedback information is packaged and sent to the APP group.
Wherein the APP group comprises a plurality of registered APPs; before receiving the request information of the APP group, the method further comprises the following steps:
when program information and a registration request sent by an APP are detected, judging whether the APP is the APP to be registered;
if yes, generating and storing identification information corresponding to the APP to be registered according to the program information.
The request information comprises a data request, the request server comprises a data server, and the feedback information comprises feedback data; when detecting feedback information sent by the request server according to the request information, the method encapsulates and sends the feedback information to the APP group, and specifically includes:
and when feedback data sent by the data server according to the data request is detected, the feedback data is packaged and sent to the APP group.
The step of packaging and sending the feedback data to the APP group specifically comprises the following steps:
judging whether identification information corresponding to the feedback data exists or not according to the identification information in the feedback data;
if so, taking the APP corresponding to the identification information as a target APP;
And packaging and sending the feedback data to the target APP.
The request information comprises a subscription request, the subscription request comprises a subscription theme, the request server comprises a subscription server, and the feedback information comprises push data; when detecting feedback information sent by the request server according to the request information, the method encapsulates and sends the feedback information to the APP group, and specifically includes:
When the subscription server detects push data sent by the subscription server according to the subscription request, judging whether topic information in the push data is the same as the subscription topic;
and if the push data are the same, packaging the push data and sending the push data to the APP group.
The packaging and sending the push data to the APP group specifically includes:
judging whether identification information corresponding to the push data exists or not according to the identification information in the push data;
If yes, taking the APP corresponding to the identification information as a target APP;
and packaging and sending the push data to the target APP.
Wherein, after generating and storing the identification information corresponding to the APP to be registered according to the program information, the method further comprises:
and taking the program information as registration information and storing the registration information.
The generating and storing identification information corresponding to the APP to be registered according to the program information specifically includes:
Judging whether registration information which is the same as the program information exists or not;
If so, deleting the identification information corresponding to the registration information, generating the identification information corresponding to the APP to be registered according to the program information, and storing the identification information;
if the identification information does not exist, generating and storing identification information corresponding to the APP to be registered according to the program information.
The present invention also provides a computer readable storage medium storing an APP management program which when executed by a processor implements the steps of the APP management method as described above.
Of course, those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by a computer program for instructing relevant hardware (e.g., processor, controller, etc.), the program may be stored on a computer readable storage medium, and the program may include the above described methods when executed. The computer readable storage medium may be a memory, a magnetic disk, an optical disk, etc.
It is to be understood that the invention is not limited in its application to the examples described above, but is capable of modification and variation in light of the above teachings by those skilled in the art, and that all such modifications and variations are intended to be included within the scope of the appended claims.