CN107818022B - Application program interface merging method, mobile terminal and computer readable storage medium - Google Patents

Application program interface merging method, mobile terminal and computer readable storage medium Download PDF

Info

Publication number
CN107818022B
CN107818022B CN201711005557.4A CN201711005557A CN107818022B CN 107818022 B CN107818022 B CN 107818022B CN 201711005557 A CN201711005557 A CN 201711005557A CN 107818022 B CN107818022 B CN 107818022B
Authority
CN
China
Prior art keywords
interface
starting
parameter value
merging
application program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711005557.4A
Other languages
Chinese (zh)
Other versions
CN107818022A (en
Inventor
倪秉炬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201711005557.4A priority Critical patent/CN107818022B/en
Publication of CN107818022A publication Critical patent/CN107818022A/en
Application granted granted Critical
Publication of CN107818022B publication Critical patent/CN107818022B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-server

Abstract

The invention discloses an application program interface merging method, a mobile terminal and a computer readable storage medium, wherein the method comprises the following steps: when an application program is started, a plurality of starting interfaces for sending requests to a server are intercepted; merging the starting interfaces to obtain a first merging interface and corresponding first merging interface parameters; sending a first merging interface request carrying a first merging interface parameter to a server and receiving a first merging parameter value returned by the server; and decomposing the first merged parameter value into a plurality of interface parameter values corresponding to the starting interfaces and distributing the interface parameter values to each starting interface so that each starting interface finishes the starting of the application program. Compared with the prior art, the method and the device realize real-time dynamic automatic start interface combination, and combine the interface with the login information during interface combination, thereby improving the integration level and comprehensiveness of interface combination, reducing the calling times of the interface and obviously improving the start speed of the application program.

Description

Application program interface merging method, mobile terminal and computer readable storage medium
Technical Field
The present invention relates to the field of mobile terminal technologies, and in particular, to an application program interface merging method, a mobile terminal, and a computer-readable storage medium.
Background
When the application program is started, a plurality of interfaces are called to load resources. Specifically, the multiple interfaces respectively initiate HTTP requests to the server and then receive resources returned by the server. In order to increase the starting speed of the application program, in the prior art, the starting interfaces of the application program may be merged, that is, the merged starting interfaces together request resources from the server, but many applications require an account to log in for use at present, and therefore many interfaces have login information of a user. Since the login information of each user is different, the merging process is not generally performed on the interfaces when the interfaces are merged in the prior art. Therefore, the merging method in the prior art has the following problems: 1. during the starting process, part of the interfaces are still not merged. 2. The speed of interface invocation with login information has not improved yet. 3. During the starting process, if the user is in the logged-in state, the starting speed of the application is greatly reduced. Therefore, the interface merging is not obvious to improve the application starting speed, the cost of the interface merging is wasted, and the application starting speed cannot be improved and the power consumption of the mobile terminal cannot be reduced well.
Therefore, it is desirable to provide an application program interface merging method, a mobile terminal and a computer readable storage medium to solve the above technical problems.
Disclosure of Invention
The invention mainly aims to provide an application program interface merging method, a mobile terminal and a computer readable storage medium, and aims to solve the problem that the application starting speed is not obviously improved because the existing interface merging technology cannot merge interfaces with login information.
First, to achieve the above object, the present invention provides a mobile terminal, where the mobile terminal includes a memory, a processor, and an application program interface merge program stored in the memory and operable on the processor, and the application program interface merge program implements the following steps when executed by the processor:
when an application program is started, intercepting a plurality of starting interfaces for sending requests to a server, wherein the starting interfaces comprise common interfaces and interfaces with login information;
merging the starting interfaces to obtain a first merging interface and corresponding first merging interface parameters;
sending a first merging interface request carrying the first merging interface parameter to the server and receiving a first merging parameter value returned by the server, wherein a request header of the first merging interface request carries the login information to identify the interface with the login information;
and decomposing the first merged parameter value into a plurality of interface parameter values corresponding to the starting interfaces and distributing the interface parameter values to the starting interfaces so that the starting interfaces complete the starting of the application program.
Optionally, the processor is further configured to execute the application program interface merging program to implement the following steps:
judging whether the current application program is started for the first time;
if the starting is the first time, calculating the CRC of the interface parameter value of each interface with the login information;
saving the interface parameter value of the interface with the login information and the CRC check code in the local storage space of the mobile terminal;
and if the mobile terminal is not started for the first time, updating the interface parameter value and the CRC check code stored in the local storage space of the mobile terminal according to the received first combination parameter value.
Optionally, the processor is further configured to execute the application program interface merge program to implement the following steps:
when the application program is in a login state and operates, sending a corresponding second merging interface request to the server according to user operation and receiving a second merging parameter value returned by the server;
and updating the interface parameter value and the CRC code stored in the local storage space of the mobile terminal according to the second combined parameter value.
Optionally, the step of executing the application program interface merging program by the processor to send the first merging interface request carrying the first merging interface parameter to the server specifically includes:
judging whether the local storage space has an interface parameter value corresponding to the interface with the login information;
if yes, obtaining a local CRC (cyclic redundancy check) code of an interface parameter value corresponding to the local interface with the login information;
and simultaneously writing the local CRC codes into the request header of the first merging interface request so that the server determines whether the interface parameter value corresponding to the interface with the login information needs to be returned or not according to the comparison result of the local CRC codes and the CRC codes at the server side.
Meanwhile, the invention also provides an application program interface merging method which is applied to the mobile terminal and comprises the following steps:
when an application program is started, intercepting a plurality of starting interfaces for sending requests to a server, wherein the starting interfaces comprise common interfaces and interfaces with login information;
merging the starting interfaces to obtain a first merging interface and corresponding first merging interface parameters;
sending a first merging interface request carrying the first merging interface parameter to the server and receiving a first merging parameter value returned by the server, wherein a request header of the first merging interface request carries the login information to identify the interface with the login information;
and decomposing the first merged parameter value into a plurality of interface parameter values corresponding to the starting interfaces and distributing the interface parameter values to the starting interfaces so that the starting interfaces complete the starting of the application program.
Optionally, the method further comprises:
judging whether the current application program is started for the first time;
if the starting is the first time, calculating the CRC of the interface parameter value of each interface with the login information;
saving the interface parameter value of the interface with the login information and the CRC check code in the local storage space of the mobile terminal;
and if the mobile terminal is not started for the first time, updating the interface parameter value and the CRC check code stored in the local storage space of the mobile terminal according to the received first combination parameter value.
Optionally, the method further comprises:
when the application program is in a login state and operates, sending a corresponding second merging interface request to the server according to user operation and receiving a second merging parameter value returned by the server;
and updating the interface parameter value and the CRC code stored in the local storage space of the mobile terminal according to the second combined parameter value.
Optionally, the step of sending the first merge interface request carrying the first merge interface parameter to the server specifically includes:
judging whether an interface parameter value corresponding to the interface with the login information exists locally;
if yes, obtaining a local CRC (cyclic redundancy check) code of an interface parameter value corresponding to the local interface with the login information;
and simultaneously writing the local CRC codes into the request header of the first merging interface request so that the server determines whether the interface parameter value corresponding to the interface with the login information needs to be returned or not according to the comparison result of the local CRC codes and the CRC codes at the server side.
Optionally, the step of decomposing the first merged parameter value into a plurality of interface parameter values corresponding to the starting interfaces and distributing the interface parameter values to the starting interfaces so that the starting interfaces complete the starting of the application program specifically includes:
decomposing the first merged parameter value into a plurality of interface parameter values corresponding to the starting interface;
when the interface parameter value corresponding to any starting interface is a null value, searching the interface parameter value corresponding to the starting interface with the interface parameter value being the null value from the local storage space of the mobile terminal and updating the interface parameter value corresponding to the starting interface to be the searched value;
and distributing the interface parameter values corresponding to each starting interface so as to enable each starting interface to finish the starting of the application program.
In addition, to achieve the above object, the present invention further provides a computer readable storage medium, on which an application program interface merge program is stored, which when executed by a processor implements the steps of the application program interface merge method as described above.
Compared with the prior art, the application program interface merging method, the mobile terminal and the computer readable storage medium provided by the invention have the advantages that when the application program is started, a plurality of starting interfaces for sending requests to the server are intercepted; merging the starting interfaces to obtain a first merging interface and corresponding first merging interface parameters; sending a first merging interface request carrying a first merging interface parameter to a server and receiving a first merging parameter value returned by the server; and decomposing the merged parameter value into a plurality of interface parameter values corresponding to the starting interfaces and distributing the interface parameter values to each starting interface so as to enable each starting interface to finish the starting of the application program. Compared with the prior art, the method and the device realize real-time dynamic automatic start interface combination, and combine the interface with the login information during interface combination, thereby improving the integration level and comprehensiveness of interface combination, reducing the calling times of the interface and obviously improving the start speed of the application program.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of an optional mobile terminal for implementing various embodiments of the present invention;
fig. 2 is a diagram of a communication network system architecture according to an embodiment of the present invention;
FIG. 3 is a functional block diagram of a first embodiment of an API merge process according to the present invention;
FIG. 4 is a functional block diagram of a second embodiment of an API merge process according to the present invention;
FIG. 5 is a flowchart illustrating a first embodiment of an API merge method according to the present invention;
FIG. 6 is a flowchart illustrating a second embodiment of a method for starting and merging application programs according to the present invention;
fig. 7 is a schematic diagram of an interface merging process when the application a is started.
Reference numerals:
Figure BDA0001444324970000051
Figure BDA0001444324970000061
Figure BDA0001444324970000071
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the construction according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: RF (Radio Frequency) unit 101, WiFi module 102, audio output unit 103, a/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 1 is not intended to be limiting of mobile terminals, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA2000(Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division duplex Long Term Evolution), and TDD-LTE (Time Division duplex Long Term Evolution).
WiFi belongs to short-distance wireless transmission technology, and the mobile terminal can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows the WiFi module 102, it is understood that it does not belong to the essential constitution of the mobile terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, the Graphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 may receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or a backlight when the mobile terminal 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, and are not limited to these specific examples.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although the touch panel 1071 and the display panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 108 serves as an interface through which at least one external device is connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and external devices.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power supply 111 (e.g., a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described in detail herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based is described below.
Referring to fig. 2, fig. 2 is an architecture diagram of a communication Network system according to an embodiment of the present invention, where the communication Network system is an LTE system of a universal mobile telecommunications technology, and the LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203, and an IP service 204 of an operator, which are in communication connection in sequence.
Specifically, the UE201 may be the terminal 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 and other eNodeBs 2022, among others. Among them, the eNodeB2021 may be connected with other eNodeB2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 access to the EPC 203.
The EPC203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving gateway) 2034, a PGW (PDN gateway) 2035, and a PCRF (Policy and Charging Rules Function) 2036, and the like. The MME2031 is a control node that handles signaling between the UE201 and the EPC203, and provides bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
The IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem), or other IP services, among others.
Although the LTE system is described as an example, it should be understood by those skilled in the art that the present invention is not limited to the LTE system, but may also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the hardware structure of the mobile terminal 100 and the communication network system, various embodiments of the method of the present invention are provided.
The first embodiment is as follows:
first, the present invention provides a mobile terminal, which includes a memory, a processor, and an application program interface merge program 400 stored in the memory and operable on the processor.
Fig. 3 is a functional block diagram of a first embodiment of an application start-up merge process 400 according to the present invention. In this embodiment, the application launching and merging procedure 400 may be divided into one or more modules, and the one or more modules are stored in the memory 109 of the mobile terminal 100 and executed by one or more processors (in this embodiment, the controller 110) to complete the present invention. For example, in fig. 3, the application launching merge process 400 can be partitioned into an intercept module 401, a merge module 402, a request module 403, and a distribution module 404. The module referred to in the present invention refers to a series of instruction segments of the fetcher program that can perform specific functions, and is more suitable than the fetcher program for describing the execution process of the software in the mobile terminal 100. The detailed description of the functions of the functional modules 401 and 404 will be described below. Wherein:
an interception module 401, configured to intercept, when an application program is started, a plurality of start interfaces that send requests to a server;
specifically, the application program may call a plurality of interfaces (i.e., start interfaces) in a start stage, the plurality of start interfaces initiate requests to the server, and then each start interface may complete a start process of the application program after receiving an interface parameter value returned by the server. One is a user-independent interface, i.e. a generic interface, and one is a user-dependent interface, i.e. an interface with login information. The interface merging in the prior art is to hard code the interface merging methods of different application programs in the application programs, and since the login information of each user is different, the interfaces with the login information are not merged generally, but are merged only for common interfaces. Specifically, when the application program is started, the method and the device can intercept a plurality of starting interfaces which send requests to the server so as to prevent each starting interface from sending the requests to the server. Such as: when the starting interface 1, the starting interface 2 and the starting interface 3 need to be called in the starting stage of the application program A, the application program interface merging method intercepts the starting interfaces after scanning the starting interfaces, and enables the starting interfaces to enter a waiting state to wait for the returned interface parameter values. In this embodiment, the request sent by the start interface to the server is specifically an http request.
A merging module 402, configured to merge the multiple start interfaces to obtain a first merged interface and a corresponding first merged interface parameter;
a request module 403, configured to send a first merge interface request carrying the first merge interface parameter to the server, and receive a first merge parameter value returned by the server;
specifically, after a plurality of starting interfaces are intercepted, the starting interfaces are merged into one interface, the merged interface is marked as a first merged interface, and when the starting interfaces are merged, the interface parameters of the starting interfaces are merged after eliminating login information, so that corresponding first merged interface parameters are obtained. The format of the first merged interface parameter is as follows: { starting interface 1: parameter 1, start interface 2: parameter 2, start interface 3: parameter 3, … … starts interface n: and n represents that n starting interfaces are required to be called when the application program is started. For the interface with login information, the login information is generally also contained in the interface parameters of the interface, for example, the starting interface 1 carrying the login information has the interface parameter of parameter 1+ login information, and when the same application program is started at the same time, the login information carried by all the interfaces with login information is the same, so that in order to avoid redundant space occupied by repeated information, reduce the space occupied by merging parameters and improve the efficiency of interface merging, the login information which is the same for each interface can be placed in the request header of the first merging interface request sent to the server, and the interface with login information is marked by carrying the login information in the request header. Suppose there are 5 start interfaces, which are start interface 1, start interface 2, start interface 3, start interface 4, and start interface 5. Wherein the starting interface 1, the starting interface 3 and the starting interface 5 are required to be provided with user login information. Then in the request header such information can be added: { login information: user ID, API: { starting interface 1, starting interface 3, starting interface 5} }, and then merging the 5 starting interfaces, and maintaining a general description in merged interface parameters, such as { starting interface 1: parameter 1, start interface 2: parameter 2, start interface 3: parameter 3, start interface 4: parameter 4, start interface 5: parameter 5 }. After receiving a first merging interface request carrying merging interface parameters and login information, the server searches corresponding interface parameter values according to the first merging interface parameters and the login information, merges the searched interface parameter values according to the format of the merging interface parameters, obtains a merging parameter value as a first merging parameter value, and returns the merging parameter value. Such as: the format of the first combined parameter value is as follows: { starting interface 1: parameter value 1, start interface 2: parameter value 2, start interface 3: parameter value 3, … … starts interface n: parameter n, where parameter n represents the interface parameter value required to start interface n. Meanwhile, the server separately caches the common interface and the interface with the login information in the first merging interface according to the mark of the login information carried in the request header, and taking the 5 starting interfaces as an example, the merging interface cache key (key) without the login information is the starting interface 2_ parameter 2_ starting interface 4_ parameter 4; the merging interface cache key with the login information is a user ID _ starting interface 1_ parameter 1_ user ID _ starting interface 3_ parameter 3_ starting interface 5_ parameter 5, and corresponding parameter values are stored, such as a starting interface 2_ parameter value 2_ starting interface 4_ parameter value 4 and a user ID _ starting interface 1_ parameter value 1_ user ID _ starting interface 3_ parameter value 3_ starting interface 5_ parameter value 5, so that when the mobile terminal executes the merging interface again, the mobile terminal can directly read from the cache of the server side, the server does not need to repeatedly calculate the parameter values, and the system performance and the return speed can be greatly improved.
A distributing module 404, configured to decompose the merged parameter value into a plurality of interface parameter values corresponding to the starting interfaces and correspondingly distribute the interface parameter values to the starting interfaces, so that each starting interface completes the starting of the application program.
Specifically, after receiving the merged parameter value returned by the server, the mobile terminal decomposes the merged parameter value to obtain an interface parameter value required by each starting interface, and correspondingly distributes the interface parameter value to each waiting starting interface. If the merged parameter value returned by the server is { starting interface 1: parameter value 1, start interface 2: parameter value 2, start interface 3: parameter value 3, start interface 4: parameter value 4, start interface 5: and 5, decomposing the merged parameter value by the mobile terminal to obtain a parameter value 1, a parameter value 2, a parameter value 3, a parameter value 4 and a parameter value 5, then distributing the parameter value 1 to the starting interface 1, distributing the parameter value 2 to the starting interface 2, distributing the parameter value 3 to the starting interface 3, distributing the parameter value to the starting interface 4, and distributing the parameter value 5 to the starting interface 5, wherein the starting of the application program can be completed after each starting interface receives the return value.
Referring to fig. 7, fig. 7 is a schematic diagram of an interface merging process when an application program a is started, as shown in fig. 7, when the application program a is started, a start interface 1, a start interface 2, a start interface 3, a start interface 4, and a start interface 5 need to be called, where the start interfaces 1, 3, and 5 need to have login information, and in the starting process, the start interface 1, the start interface 2, the start interface 3, the start interface 4, and the start interface 5 are merged to obtain a merged interface X and merged interface parameters, the server has a uniform calling address, and if the uniform calling address is http:// app Returning to the application program A, then the application program A decomposes the merged parameters into an interface parameter value 1, an interface parameter value 2, an interface parameter value 3, an interface parameter value 4 and an interface parameter value 5, and respectively distributes the interface parameter values to the corresponding starting interface 1, starting interface 2, starting interface 3, starting interface 4 and starting interface 5. The merging interface parameter is in a json character string format.
Through the module 401 and 404, the application program interface merging program intercepts a plurality of starting interfaces for sending requests to a server when the application program is started; merging the starting interfaces to obtain a first merging interface and corresponding first merging interface parameters; sending a first merging interface request carrying a first merging interface parameter to a server and receiving a first merging parameter value returned by the server; the merged parameter value is decomposed into a plurality of interface parameter values corresponding to the starting interfaces and distributed to the starting interfaces so that the starting interfaces complete the starting of the application program, and therefore the real-time dynamic automatic starting interface merging is achieved, the interfaces with the login information are merged during the interface merging, the integration level and the comprehensiveness of the interface merging are improved, the calling times of the interfaces are reduced, and the starting speed of the application program is obviously improved.
Example two:
further, based on the above-mentioned first embodiment of the api merging program 400 of the present invention, a second embodiment of the api merging program 400 of the present invention is proposed. Referring to fig. 4, fig. 4 is a functional block diagram illustrating an application program interface merging procedure 400 according to a second embodiment of the present invention, wherein the application program interface merging procedure 400 further includes a checking module 405 and a saving module 406 in this embodiment. In this embodiment, each functional module is described as follows:
a checking module 405, configured to determine whether the current application is started for the first time; if the starting is the first time, calculating the CRC of the interface parameter value of each interface with the login information;
a saving module 406, configured to save the interface parameter value of the interface with login information and the CRC check code in the local storage space of the mobile terminal; and
and when the application program is not started for the first time, updating the interface parameter value and the CRC check code stored in the local storage space of the mobile terminal according to the received first combination parameter value.
In this embodiment, it is considered that the user does not operate the application program before starting, but the application program is generally in a login state after starting, that is, the operation of the user on the application program in the login state is already stored in the server side. However, there are some scenarios where a user has multiple mobile terminals, and an application is logged in to each of the multiple mobile terminals, and the mobile terminal logged in later may need to synchronize user operation information of the server. In order to further improve the starting speed of the application program, the interface parameter values of each interface with login information, which are decomposed from the first merged interface merged parameter values received for the first time in the login state of the user, can be stored in the storage space of the mobile terminal, and the CRC check codes for calculating each interface parameter value are attached to the tail of the interface parameter values and are stored together. Meanwhile, for the stored interface parameter values and the CRC check codes corresponding to the interface parameter values, the new combined parameter values received each time subsequently are compared through the CRC check codes to confirm whether the updating is needed or not, and the updating is carried out at any time if the updating is needed.
In this embodiment, the request module 403 is further configured to: when the application program is in a login state and operates, sending a corresponding second merging interface request to the server according to user operation and receiving a second merging parameter value returned by the server;
correspondingly, the saving module 406 is further configured to update the interface parameter value and the CRC check code saved in the local storage space of the mobile terminal according to the second merged parameter value.
Specifically, after the application program runs in the login state, in order to respond to the operation of the user, the mobile terminal may also call some interfaces to send requests to the server, and at this time, the above-described method is also used for merging different interfaces to obtain a second merging interface and a corresponding second merging parameter, and then the second merging interface request is sent to the server and a returned merging parameter value is received. The second merged parameter value may also carry an interface parameter value of an interface with login information, at this time, the storage module 406 needs to calculate a CRC of each interface parameter value according to the interface parameter values of the interfaces with login information in the received second merged parameter value, and determines whether updating is needed by comparing the CRC with a local CRC check code, and updates the CRC at any time if updating is needed.
Further, in this embodiment, the sending, by the request module 403, the first merge interface request carrying the first merge interface parameter to the server specifically includes:
judging whether the local storage space has an interface parameter value corresponding to the interface with the login information;
if yes, obtaining a local CRC (cyclic redundancy check) code of an interface parameter value corresponding to the local interface with the login information;
and simultaneously writing the local CRC codes into the request header of the first merging interface request so that the server determines whether the interface parameter value corresponding to the interface with the login information needs to be returned or not according to the comparison result of the local CRC codes and the CRC codes at the server side.
Specifically, when the application program is started, the request module 403 may put the locally stored CRC check codes together in the request header with the login information, and after the server receives the first merged interface request, the server may compare whether the obtained CRC check code of the interface parameter value with the login information interface is consistent with the local CRC check code carried by the request header, and if so, it indicates that the part of the interface parameter value in the server is not different from the interface parameter value locally stored in the mobile terminal, and does not need to be updated, so the server does not return the part of the interface parameter value, and may replace the part with a null value; if the two parameters are not consistent, the result shows that the user possibly operates when logging in the application program from other mobile terminals, the user operation is stored in the server, and at the moment, the mobile terminal needs to synchronize the user operation, so that the server normally returns the interface parameter value of the part, after receiving the first combined parameter value, the mobile terminal compares the computed CRC code with the local check code, and updates the new interface parameter value to the local storage space.
Further, in this embodiment, the decomposing, by the distributing module 404, the merged parameter value into a plurality of interface parameter values corresponding to the starting interfaces and correspondingly distributing the merged parameter values to the starting interfaces so that each starting interface completes the starting of the application specifically includes:
decomposing the first merged parameter value into a plurality of interface parameter values corresponding to the starting interface;
when the interface parameter value corresponding to any starting interface is a null value, searching the interface parameter value corresponding to the starting interface with the interface parameter value being the null value from the local storage space of the mobile terminal and updating the interface parameter value corresponding to the starting interface to be the searched value;
and distributing the interface parameter values corresponding to each starting interface so as to enable each starting interface to finish the starting of the application program.
Specifically, as described above, when the interface parameter value with the login information in the server is consistent with the part of the interface parameter values stored locally by the mobile terminal, the server does not return the part of the interface parameter values, and replaces the part of the interface parameter values with null values. Therefore, after the distribution module 404 decomposes the first merged parameter value, there may be an interface parameter value corresponding to a certain starting interface as a null value, which indicates that the interface parameter value server of the starting interface does not return, and the distribution module 404 needs to search the interface parameter value corresponding to the starting interface from the local storage space and update the null value as the searched value, so as to obtain an integral interface parameter value corresponding to each starting interface, and then distribute each obtained interface parameter value to each starting interface, and the starting interface completes the starting of the application program.
Through the module 401 and 406, the application program interface merging program of the present invention stores the interface parameter values of the interface with the login information in the local storage space, and keeps updating through comparison of the CRC check code, so that if the part of the interface parameter values of the server end is not updated, the mobile terminal may directly read the interface from the local without obtaining the part of the interface parameter values from the server end, and the starting speed may be further increased. And the merging interface carries the CRC check code, so that the synchronism of the interface parameter value of the interface with the login information on the mobile terminal and the server side can be further ensured, and the accuracy and synchronism of the data acquired by the user are ensured.
Example three:
in addition, the present invention provides an application program interface merging method, which is applied to the mobile terminal shown in fig. 1 to 2, where the mobile terminal includes a memory and a processor.
Fig. 5 is a flowchart illustrating an implementation of the api merging method according to the first embodiment of the present invention. In this embodiment, the execution order of the steps in the flowchart shown in fig. 5 may be changed and some steps may be omitted according to different requirements. The application program interface merging method comprises the following steps:
step S501, when an application program is started, a plurality of starting interfaces for sending requests to a server are intercepted;
specifically, the application program may call a plurality of interfaces (i.e., start interfaces) in a start stage, the plurality of start interfaces initiate requests to the server, and then each start interface may complete a start process of the application program after receiving an interface parameter value returned by the server. One is a user-independent interface, i.e. a generic interface, and one is a user-dependent interface, i.e. an interface with login information. The interface merging in the prior art is to hard code the interface merging methods of different application programs in the application programs, and since the login information of each user is different, the interfaces with the login information are not merged generally, but are merged only for common interfaces. Specifically, when the application program is started, the method and the device can intercept a plurality of starting interfaces which send requests to the server so as to prevent each starting interface from sending the requests to the server. Such as: when the starting interface 1, the starting interface 2 and the starting interface 3 need to be called in the starting stage of the application program A, the application program interface merging method intercepts the starting interfaces after scanning the starting interfaces, and enables the starting interfaces to enter a waiting state to wait for the returned interface parameter values. In this embodiment, the request sent by the start interface to the server is specifically an http request.
Step S502, merging the starting interfaces to obtain a first merging interface and corresponding first merging interface parameters;
step S503, sending a first merge interface request carrying the first merge interface parameter to the server, and receiving a first merge parameter value returned by the server;
specifically, after a plurality of starting interfaces are intercepted, the starting interfaces are merged into one interface, the merged interface is marked as a first merged interface, and when the starting interfaces are merged, the interface parameters of the starting interfaces are merged after eliminating login information, so that corresponding first merged interface parameters are obtained. The format of the first merged interface parameter is as follows: { starting interface 1: parameter 1, start interface 2: parameter 2, start interface 3: parameter 3, … … starts interface n: and n represents that n starting interfaces are required to be called when the application program is started. For the interface with login information, the login information is generally also contained in the interface parameters of the interface, for example, the starting interface 1 carrying the login information has the interface parameter of parameter 1+ login information, and when the same application program is started at the same time, the login information carried by all the interfaces with login information is the same, so that in order to avoid redundant space occupied by repeated information, reduce the space occupied by merging parameters and improve the efficiency of interface merging, the login information which is the same for each interface can be placed in the request header of the first merging interface request sent to the server, and the interface with login information is marked by carrying the login information in the request header. Suppose there are 5 start interfaces, which are start interface 1, start interface 2, start interface 3, start interface 4, and start interface 5. Wherein the starting interface 1, the starting interface 3 and the starting interface 5 are required to be provided with user login information. Then in the request header such information can be added: { login information: user ID, API: { starting interface 1, starting interface 3, starting interface 5} }, and then merging the 5 starting interfaces, and maintaining a general description in merged interface parameters, such as { starting interface 1: parameter 1, start interface 2: parameter 2, start interface 3: parameter 3, start interface 4: parameter 4, start interface 5: parameter 5 }. After receiving a first merging interface request carrying merging interface parameters and login information, the server searches corresponding interface parameter values according to the first merging interface parameters and the login information, merges the searched interface parameter values according to the format of the merging interface parameters, obtains a merging parameter value as a first merging parameter value, and returns the merging parameter value. Such as: the format of the first combined parameter value is as follows: { starting interface 1: parameter value 1, start interface 2: parameter value 2, start interface 3: parameter value 3, … … starts interface n: parameter n, where parameter n represents the interface parameter value required to start interface n. Meanwhile, the server separately caches the common interface and the interface with the login information in the first merging interface according to the mark of the login information carried in the request header, and taking the 5 starting interfaces as an example, the merging interface cache key (key) without the login information is the starting interface 2_ parameter 2_ starting interface 4_ parameter 4; the merging interface cache key with the login information is a user ID _ starting interface 1_ parameter 1_ user ID _ starting interface 3_ parameter 3_ starting interface 5_ parameter 5, and corresponding parameter values are stored, such as a starting interface 2_ parameter value 2_ starting interface 4_ parameter value 4 and a user ID _ starting interface 1_ parameter value 1_ user ID _ starting interface 3_ parameter value 3_ starting interface 5_ parameter value 5, so that when the mobile terminal executes the merging interface again, the mobile terminal can directly read from the cache of the server side, the server does not need to repeatedly calculate the parameter values, and the system performance and the return speed can be greatly improved.
Step S504, decomposing the merged parameter value into a plurality of interface parameter values corresponding to the starting interfaces and distributing the interface parameter values to the starting interfaces correspondingly, so that the starting interfaces complete the starting of the application program.
Specifically, after receiving the merged parameter value returned by the server, the mobile terminal decomposes the merged parameter value to obtain an interface parameter value required by each starting interface, and correspondingly distributes the interface parameter value to each waiting starting interface. If the merged parameter value returned by the server is { starting interface 1: parameter value 1, start interface 2: parameter value 2, start interface 3: parameter value 3, start interface 4: parameter value 4, start interface 5: and 5, decomposing the merged parameter value by the mobile terminal to obtain a parameter value 1, a parameter value 2, a parameter value 3, a parameter value 4 and a parameter value 5, then distributing the parameter value 1 to the starting interface 1, distributing the parameter value 2 to the starting interface 2, distributing the parameter value 3 to the starting interface 3, distributing the parameter value to the starting interface 4, and distributing the parameter value 5 to the starting interface 5, wherein the starting of the application program can be completed after each starting interface receives the return value.
Referring to fig. 7, fig. 7 is a schematic diagram of an interface merging process when an application program a is started, as shown in fig. 7, when the application program a is started, a start interface 1, a start interface 2, a start interface 3, a start interface 4, and a start interface 5 need to be called, where the start interfaces 1, 3, and 5 need to have login information, and in the starting process, the start interface 1, the start interface 2, the start interface 3, the start interface 4, and the start interface 5 are merged to obtain a merged interface X and merged interface parameters, the server has a uniform calling address, and if the uniform calling address is http:// app And (3) the application program A decomposes the merged parameters into an interface parameter value 1, an interface parameter value 2, an interface parameter value 3, an interface parameter value 4 and an interface parameter value 5, and respectively distributes the interface parameter values to the corresponding starting interface 1, starting interface 2, starting interface 3, starting interface 4 and starting interface 5. The merging interface parameter is in a json character string format.
Through the steps S501-S504, the application program interface merging method intercepts a plurality of starting interfaces for sending requests to a server when an application program is started; merging the starting interfaces to obtain a first merging interface and corresponding first merging interface parameters; sending a first merging interface request carrying a first merging interface parameter to a server and receiving a first merging parameter value returned by the server; the merged parameter value is decomposed into a plurality of interface parameter values corresponding to the starting interfaces and distributed to the starting interfaces so that the starting interfaces complete the starting of the application program, and therefore the real-time dynamic automatic starting interface merging is achieved, the interfaces with the login information are merged during the interface merging, the integration level and the comprehensiveness of the interface merging are improved, the calling times of the interfaces are reduced, and the starting speed of the application program is obviously improved.
Further, based on the first embodiment, a second embodiment of the application program interface merging method of the present invention is provided. Fig. 6 is a flowchart illustrating an implementation of the api merging method according to a second embodiment of the present invention. In this embodiment, the execution order of the steps in the flowchart shown in fig. 6 may be changed and some steps may be omitted according to different requirements. The application program interface merging method comprises the following steps:
step S601, when an application program is started, intercepting a plurality of starting interfaces for sending requests to a server, wherein the starting interfaces comprise common interfaces and interfaces with login information;
step S602, merging the plurality of starting interfaces to obtain a first merging interface and corresponding first merging interface parameters;
step S603, sending a first merge interface request carrying the first merge interface parameter to the server, and receiving a first merge parameter value returned by the server, where a request header of the first merge interface request carries the login information to identify the interface with login information;
step S604, decomposing the first merged parameter value into a plurality of interface parameter values corresponding to the starting interfaces and distributing the interface parameter values to the starting interfaces so that the starting interfaces complete the starting of the application program.
Step S605, judging whether the current application program is started for the first time; if the first start is performed, step S606 is performed, and a CRC check code of the interface parameter value of each interface with login information is calculated; if not, go to step S608;
step S607, saving the interface parameter value of the interface with the login information and the CRC check code in the local storage space of the mobile terminal;
step S608, updating the interface parameter value and the CRC check code stored in the local storage space of the mobile terminal according to the received first merged parameter value.
In this embodiment, it is considered that the user does not operate the application program before starting, but the application program is generally in a login state after starting, that is, the operation of the user on the application program in the login state is already stored in the server side. However, there are some scenarios where a user has multiple mobile terminals, and an application is logged in to each of the multiple mobile terminals, and the mobile terminal logged in later may need to synchronize user operation information of the server. In order to further improve the starting speed of the application program, the interface parameter values of each interface with login information, which are decomposed from the first merged interface merged parameter values received for the first time in the login state of the user, can be stored in the storage space of the mobile terminal, and the CRC check codes for calculating each interface parameter value are attached to the tail of the interface parameter values and are stored together. Meanwhile, for the stored interface parameter values and the CRC check codes corresponding to the interface parameter values, the new combined parameter values received each time subsequently are compared through the CRC check codes to confirm whether the updating is needed or not, and the updating is carried out at any time if the updating is needed.
Step S609, when the application program is in a login state and is running, sending a corresponding second merging interface request to the server according to user operation and receiving a second merging parameter value returned by the server;
step S610, updating the interface parameter value and the CRC check code stored in the local storage space of the mobile terminal according to the second merged parameter value.
Specifically, after the application program runs in the login state, in order to respond to the operation of the user, the mobile terminal may also call some interfaces to send requests to the server, and at this time, the above-described method is also used for merging different interfaces to obtain a second merging interface and a corresponding second merging parameter, and then the second merging interface request is sent to the server and a returned merging parameter value is received. The second merged parameter value may also carry an interface parameter value of an interface with login information, at this time, the storage module 406 needs to calculate a CRC of each interface parameter value according to the interface parameter values of the interfaces with login information in the received second merged parameter value, and determines whether updating is needed by comparing the CRC with a local CRC check code, and updates the CRC at any time if updating is needed.
Further, in this embodiment, the step of sending the first merge interface request carrying the first merge interface parameter to the server specifically includes the following steps:
judging whether the local storage space has an interface parameter value corresponding to the interface with the login information;
if yes, obtaining a local CRC (cyclic redundancy check) code of an interface parameter value corresponding to the local interface with the login information;
and simultaneously writing the local CRC codes into the request header of the first merging interface request so that the server determines whether the interface parameter value corresponding to the interface with the login information needs to be returned or not according to the comparison result of the local CRC codes and the CRC codes at the server side.
Specifically, when the application program is started, the mobile terminal will put the locally stored CRC check code together in the request header with the login information, and after receiving the first merged interface request, the server will compare whether the obtained CRC check code of the interface parameter value with the login information interface is consistent with the local CRC check code carried by the request header, and if so, it indicates that the part of the interface parameter value in the server is not different from the locally stored interface parameter value of the mobile terminal, and does not need to be updated, so the server does not return the part of the interface parameter value, and can replace the part with a null value; if the two parameters are not consistent, the result shows that the user possibly operates when logging in the application program from other mobile terminals, the user operation is stored in the server, and at the moment, the mobile terminal needs to synchronize the user operation, so that the server normally returns the interface parameter value of the part, after receiving the first combined parameter value, the mobile terminal compares the computed CRC code with the local check code, and updates the new interface parameter value to the local storage space.
Further, in this embodiment, the step S604 specifically includes the following steps:
decomposing the first merged parameter value into a plurality of interface parameter values corresponding to the starting interface;
when the interface parameter value corresponding to any starting interface is a null value, searching the interface parameter value corresponding to the starting interface with the interface parameter value being the null value from the local storage space of the mobile terminal and updating the interface parameter value corresponding to the starting interface to be the searched value;
and distributing the interface parameter values corresponding to each starting interface so as to enable each starting interface to finish the starting of the application program.
Specifically, as described above, when the interface parameter value with the login information in the server is consistent with the part of the interface parameter values stored locally by the mobile terminal, the server does not return the part of the interface parameter values, and replaces the part of the interface parameter values with null values. Therefore, after the mobile terminal decomposes the first merged parameter value, there may be an interface parameter value corresponding to a certain starting interface as a null value, which indicates that the interface parameter value server of the starting interface does not return, and the mobile terminal needs to search the interface parameter value corresponding to the starting interface from the local storage space and update the null value as the searched value, so as to obtain the complete interface parameter value corresponding to each starting interface, and then distribute each obtained interface parameter value to each starting interface, and the starting interface completes the starting of the application program.
Through the steps S601-S610, the method for merging application program interfaces of the present invention stores the interface parameter values of the interface with login information in the local storage space, and keeps updating through comparing the CRC check codes, so that if the part of the interface parameter values at the server end is not updated, the mobile terminal can directly read the interface from the local without obtaining the part of the interface parameter values from the server end, and the starting speed can be further increased. And the merging interface carries the CRC check code, so that the synchronism of the interface parameter value of the interface with the login information on the mobile terminal and the server side can be further ensured, and the accuracy and synchronism of the data acquired by the user are ensured.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (7)

1. A mobile terminal comprising a memory, a processor, and an application program interface merge stored on the memory and operable on the processor, the application program interface merge when executed by the processor implementing the steps of:
when an application program is started, intercepting a plurality of starting interfaces for sending requests to a server, wherein the starting interfaces comprise common interfaces and interfaces with login information;
merging the starting interfaces to obtain a first merging interface and corresponding first merging interface parameters;
sending a first merging interface request carrying the first merging interface parameter to the server and receiving a first merging parameter value returned by the server, wherein a request header of the first merging interface request carries the login information to identify the interface with the login information;
decomposing the first merged parameter value into a plurality of interface parameter values corresponding to the starting interfaces and distributing the interface parameter values to the starting interfaces so that the starting interfaces complete the starting of the application program, wherein the method comprises the following steps: decomposing the first merged parameter value into a plurality of interface parameter values corresponding to the starting interface;
when the interface parameter value corresponding to any starting interface is a null value, searching the interface parameter value corresponding to the starting interface with the interface parameter value being the null value from the local storage space of the mobile terminal and updating the interface parameter value corresponding to the starting interface to be the searched value;
distributing the interface parameter values corresponding to the starting interfaces so that the starting interfaces complete the starting of the application program;
the step of sending the first merge interface request carrying the first merge interface parameter to the server specifically includes:
judging whether the local storage space has an interface parameter value corresponding to the interface with the login information;
if yes, obtaining a local CRC (cyclic redundancy check) code of an interface parameter value corresponding to the local interface with the login information;
and simultaneously writing the local CRC codes into the request header of the first merging interface request so that the server determines whether the interface parameter value corresponding to the interface with the login information needs to be returned or not according to the comparison result of the local CRC codes and the CRC codes at the server side.
2. The mobile terminal of claim 1, wherein the processor is further configured to execute the application program interface merge program to implement the steps of:
judging whether the current application program is started for the first time;
if the starting is the first time, calculating the CRC of the interface parameter value of each interface with the login information;
saving the interface parameter value of the interface with the login information and the CRC check code in the local storage space of the mobile terminal;
and if the mobile terminal is not started for the first time, updating the interface parameter value and the CRC check code stored in the local storage space of the mobile terminal according to the received first combination parameter value.
3. The mobile terminal of claim 2, wherein the processor is further configured to execute the application program interface merge program to implement the steps of:
when the application program is in a login state and operates, sending a corresponding second merging interface request to the server according to user operation and receiving a second merging parameter value returned by the server;
and updating the interface parameter value and the CRC code stored in the local storage space of the mobile terminal according to the second combined parameter value.
4. An application program interface merging method applied to a mobile terminal is characterized by comprising the following steps:
when an application program is started, intercepting a plurality of starting interfaces for sending requests to a server, wherein the starting interfaces comprise common interfaces and interfaces with login information;
merging the starting interfaces to obtain a first merging interface and corresponding first merging interface parameters;
sending a first merging interface request carrying the first merging interface parameter to the server and receiving a first merging parameter value returned by the server, wherein a request header of the first merging interface request carries the login information to identify the interface with the login information;
decomposing the first merged parameter value into a plurality of interface parameter values corresponding to the starting interfaces and distributing the interface parameter values to the starting interfaces so that the starting interfaces complete the starting of the application program, wherein the method comprises the following steps: decomposing the first merged parameter value into a plurality of interface parameter values corresponding to the starting interface;
when the interface parameter value corresponding to any starting interface is a null value, searching the interface parameter value corresponding to the starting interface with the interface parameter value being the null value from the local storage space of the mobile terminal and updating the interface parameter value corresponding to the starting interface to be the searched value;
distributing the interface parameter values corresponding to the starting interfaces so that the starting interfaces complete the starting of the application program;
the step of sending the first merge interface request carrying the first merge interface parameter to the server specifically includes:
judging whether the local storage space has an interface parameter value corresponding to the interface with the login information;
if yes, obtaining a local CRC (cyclic redundancy check) code of an interface parameter value corresponding to the local interface with the login information;
and simultaneously writing the local CRC codes into the request header of the first merging interface request so that the server determines whether the interface parameter value corresponding to the interface with the login information needs to be returned or not according to the comparison result of the local CRC codes and the CRC codes at the server side.
5. The application program interface consolidation method of claim 4, wherein the method further comprises:
judging whether the current application program is started for the first time;
if the starting is the first time, calculating the CRC of the interface parameter value of each interface with the login information;
saving the interface parameter value of the interface with the login information and the CRC check code in the local storage space of the mobile terminal;
and if the mobile terminal is not started for the first time, updating the interface parameter value and the CRC check code stored in the local storage space of the mobile terminal according to the received first combination parameter value.
6. The application program interface consolidation method of claim 5, wherein the method further comprises:
when the application program is in a login state and operates, sending a corresponding second merging interface request to the server according to user operation and receiving a second merging parameter value returned by the server;
and updating the interface parameter value and the CRC code stored in the local storage space of the mobile terminal according to the second combined parameter value.
7. A computer-readable storage medium, having an application program interface merge program stored thereon, which when executed by a processor implements the steps of the application program interface merge method of any one of claims 4 to 6.
CN201711005557.4A 2017-10-25 2017-10-25 Application program interface merging method, mobile terminal and computer readable storage medium Active CN107818022B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711005557.4A CN107818022B (en) 2017-10-25 2017-10-25 Application program interface merging method, mobile terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711005557.4A CN107818022B (en) 2017-10-25 2017-10-25 Application program interface merging method, mobile terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107818022A CN107818022A (en) 2018-03-20
CN107818022B true CN107818022B (en) 2021-08-24

Family

ID=61607569

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711005557.4A Active CN107818022B (en) 2017-10-25 2017-10-25 Application program interface merging method, mobile terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107818022B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108512924B (en) * 2018-03-29 2022-06-03 努比亚技术有限公司 Interface merging method, apparatus, system, and computer-readable storage medium
CN109344050B (en) * 2018-08-20 2023-07-21 中国平安人寿保险股份有限公司 Interface parameter analysis method and device based on structure tree
CN110062274A (en) * 2019-04-30 2019-07-26 深圳市迅雷网络技术有限公司 A kind of video file caching method, device, equipment and readable storage medium storing program for executing
CN112565056B (en) * 2020-11-11 2022-09-09 中国软件与技术服务股份有限公司 Method and device for processing group sending on-line and off-line messages through instant messaging

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012171133A1 (en) * 2011-06-13 2012-12-20 Telefonaktiebolaget L M Ericsson (Publ) Method and device for rate matching
CN103345420A (en) * 2013-06-03 2013-10-09 百度在线网络技术(北京)有限公司 Method for massively calling API interfaces, system for massively calling API interfaces and device for massively calling API interfaces
CN104580501A (en) * 2015-01-23 2015-04-29 广东能龙教育股份有限公司 Http interface dynamic publishing method and system based on reflex mechanism
CN105989070A (en) * 2015-02-10 2016-10-05 阿里巴巴集团控股有限公司 Method and system for requesting data from middleware and middleware client

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012171133A1 (en) * 2011-06-13 2012-12-20 Telefonaktiebolaget L M Ericsson (Publ) Method and device for rate matching
CN103345420A (en) * 2013-06-03 2013-10-09 百度在线网络技术(北京)有限公司 Method for massively calling API interfaces, system for massively calling API interfaces and device for massively calling API interfaces
CN104580501A (en) * 2015-01-23 2015-04-29 广东能龙教育股份有限公司 Http interface dynamic publishing method and system based on reflex mechanism
CN105989070A (en) * 2015-02-10 2016-10-05 阿里巴巴集团控股有限公司 Method and system for requesting data from middleware and middleware client

Also Published As

Publication number Publication date
CN107818022A (en) 2018-03-20

Similar Documents

Publication Publication Date Title
CN107038245B (en) Page switching method, mobile terminal and storage medium
CN108768775B (en) Information processing method, electronic device, and computer storage medium
CN109195143B (en) Network access method, mobile terminal and readable storage medium
CN107749919B (en) Application program page display method and device and computer readable storage medium
CN107818022B (en) Application program interface merging method, mobile terminal and computer readable storage medium
CN107862217B (en) Position information acquisition method, mobile terminal and computer storage medium
CN107124466B (en) Method and device for preventing cache from penetrating and computer readable storage medium
CN107317855B (en) Data caching method, data requesting method and server
CN109766119B (en) Recovery partition upgrade method, terminal and computer readable storage medium
CN112822538A (en) Screen projection display method, screen projection device, terminal and storage medium
CN108011937B (en) Message pushing method, server, intelligent terminal and computer readable storage medium
CN109254972B (en) Offline command word bank updating method, terminal and computer readable storage medium
CN112494932A (en) Game frame supplementing method and device, terminal and computer readable storage medium
CN112346824A (en) Screen projection application control method and device and computer readable storage medium
CN109684020B (en) Theme switching method, device and computer readable storage medium
CN109462829B (en) Call transfer method, device and computer readable storage medium
CN107678794B (en) Application program starting interface merging method and mobile terminal
CN109062688B (en) Memory allocation method, server and mobile terminal
CN110955397A (en) Method for setting frame rate of game terminal, game terminal and storage medium
CN108183833B (en) Response processing method and device and computer readable storage medium
CN107404568B (en) Control switch management method and mobile terminal
CN107153688B (en) Data query method, equipment and computer storage medium
CN110287381B (en) Page control node searching method, terminal and computer readable storage medium
CN108304302B (en) Interface merging method, equipment and computer readable storage medium
CN108037959B (en) Intelligent interface merging method, mobile terminal and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant