CN107864276B - Method and device for reading interface return value and computer readable storage medium - Google Patents

Method and device for reading interface return value and computer readable storage medium Download PDF

Info

Publication number
CN107864276B
CN107864276B CN201711029407.7A CN201711029407A CN107864276B CN 107864276 B CN107864276 B CN 107864276B CN 201711029407 A CN201711029407 A CN 201711029407A CN 107864276 B CN107864276 B CN 107864276B
Authority
CN
China
Prior art keywords
interface
return value
server
mobile terminal
updated
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
CN201711029407.7A
Other languages
Chinese (zh)
Other versions
CN107864276A (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.)
Information and Telecommunication Branch of State Grid Hubei Electric Power Co Ltd
Original Assignee
Information and Telecommunication Branch of State Grid Hubei Electric Power 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 Information and Telecommunication Branch of State Grid Hubei Electric Power Co Ltd filed Critical Information and Telecommunication Branch of State Grid Hubei Electric Power Co Ltd
Priority to CN201711029407.7A priority Critical patent/CN107864276B/en
Publication of CN107864276A publication Critical patent/CN107864276A/en
Application granted granted Critical
Publication of CN107864276B publication Critical patent/CN107864276B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality

Abstract

The invention discloses a method for reading interface return values, which is applied to a mobile terminal, configures an identification mark for each interface of the mobile terminal, and enables a server to store the corresponding relation between the interface and the configuration mark, and the method comprises the following steps: receiving an interface and a corresponding return value sent by the server based on the identification mark to obtain an updated return value of the interface; and storing the updated return value into a local storage of the mobile terminal so as to read the corresponding return value from the local storage when an interface is called. In addition, the embodiment of the invention also provides reading equipment and a computer readable storage medium for the interface return value, and the embodiment of the invention optimizes the cache of the interface by the push service, thereby effectively utilizing the larger and larger storage space of the mobile phone, improving the starting and running speed of the application and bringing better use experience to users.

Description

Method and device for reading interface return value and computer readable storage medium
Technical Field
The present invention relates to the field of interface application technology for mobile terminals, and in particular, to a method, a system, and a device for reading an interface return value and a computer-readable storage medium.
Background
An interface generally refers to an abstraction that an entity provides itself to the outside, or another entity, which separates an external communication method from an internal operation, so that the external communication method can be modified internally without affecting the way other entities interact with the external communication method. Such exchanges may occur between computer software, hardware, external devices or persons performing the operations, or a combination thereof.
The interaction between the existing terminal and the server is also performed by transmitting the return value through the interface, and basically, the return value is cached in the cache service on the server side. When the interface is called, firstly judging whether a return value of the interface exists in the cache service, and if so, directly returning; if not, the interface is called and the return value is written into the cache service. The problems with this solution are: each interface call still consumes time for interacting with the server, and the larger and larger storage space of the mobile phone cannot be effectively utilized.
Disclosure of Invention
The invention mainly aims to provide a method and equipment for reading an interface return value and a computer readable storage medium, aiming at optimizing the cache of an interface by a push service, effectively utilizing the larger and larger storage space of a mobile phone, improving the starting and running speed of an application and bringing better use experience to a user.
In order to achieve the above object, the present invention provides a method for reading an interface return value, which is applied to a mobile terminal, configures an identification flag for each interface of the mobile terminal, and enables a server to store a corresponding relationship between an interface and a configuration flag, and the method includes:
receiving an interface and a corresponding return value sent by the server based on the identification mark to obtain an updated return value of the interface;
and storing the updated return value into a local storage of the mobile terminal so as to read the corresponding return value from the local storage when an interface is called.
Optionally, the configuring an identifier for each interface of the mobile terminal includes:
sending an interface configuration command to a server so that the server configures an identification mark for each interface;
and receiving the corresponding relation between the interface and the identification mark sent by the server.
Optionally, the sending an interface configuration command to the server, so that the server configures an identifier for each interface, includes:
the sending interface configuration command to a server;
the server judges whether the interface belongs to a combined calling interface or not;
if yes, configuring the interfaces called by merging with the same identification mark;
if not, respectively configuring an identification mark for each interface.
Optionally, the receiving, based on the identification flag, the interface and the corresponding return value sent by the server to obtain the return value after the interface is updated includes:
sending a query request to the server based on the identification mark so that the server sends the updated return value to the server, wherein the query request is a request sent out according to whether the return value of each interface changes or not;
or the like, or, alternatively,
and the server sends the changed return value to the mobile terminal under the condition of judging that the return value of the interface changes so as to obtain the updated return value of the interface.
Optionally, the sending a query request to the server based on the identifier so that the server sends the updated return value to the server includes:
and sending a query request to the server based on a preset time interval and the identification mark so that the server sends the updated return value to the server.
Optionally, the sending a query request to the server based on the identifier so that the server sends the updated return value to the server includes:
and sending a query request to the server based on the identification marks, determining the version number of the return value corresponding to the interface according to the interface corresponding to each identification mark by the server, and updating the version number of the return value and the content of the return value when the version number in the server is different from the version number of the return value.
Optionally, the storing the updated return value into a local storage of the mobile terminal to read a corresponding return value from the local storage when the interface is called includes:
storing the updated return value into a preset storage area of the mobile terminal; judging whether the interface is called; and if so, reading the corresponding return value from the preset storage area.
Optionally, the storing the updated return value into a preset storage area of the mobile terminal includes:
determining an application program corresponding to an interface, and determining a cache area according to the application program;
and saving the updated return value to the cache region.
In addition, in order to achieve the above object, the present invention provides an interface return value reading apparatus, applied to a mobile terminal, the interface return value reading apparatus including: a memory, a processor, and a communication bus;
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is used for executing the reading program of the interface return value to realize the following steps:
calling image acquisition equipment, and acquiring an image to be displayed according to preset image processing parameters to obtain a display frame image;
receiving an interface and a corresponding return value sent by the server based on the identification mark to obtain an updated return value of the interface;
and storing the updated return value into a local storage of the mobile terminal so as to read the corresponding return value from the local storage when an interface is called.
Optionally, the processor is further configured to execute a reading program of the interface return value, so as to implement the following steps:
sending an interface configuration command to a server so that the server configures an identification mark for each interface;
and receiving the corresponding relation between the interface and the identification mark sent by the server.
Optionally, the processor is further configured to execute a reading program of the interface return value, so as to implement the following steps:
sending an interface configuration command to a server;
the server judges whether the interface belongs to a combined calling interface or not; if so, the server configures the interfaces called by the merging with the same identification mark; and if not, the server respectively configures an identification mark for each interface.
Optionally, the processor is configured to execute a reading procedure of the interface return value, so as to implement the following steps:
sending a query request to the server based on the identification mark so that the server sends the updated return value to the server, wherein the query request is a request sent out according to whether the return value of each interface changes or not;
or the like, or, alternatively,
and the server sends the changed return value to the mobile terminal under the condition of judging that the return value of the interface changes so as to obtain the updated return value of the interface.
Optionally, the processor is configured to execute a reading procedure of the interface return value, so as to implement the following steps:
and sending a query request to the server based on a preset time interval and the identification mark so that the server sends the updated return value to the server.
Optionally, the processor is configured to execute a reading procedure of the interface return value, so as to implement the following steps:
and sending a query request to the server based on the identification marks, determining the version number of the return value corresponding to the interface according to the interface corresponding to each identification mark by the server, and updating the version number of the return value and the content of the return value when the version number in the server is different from the version number of the return value.
Optionally, the processor is configured to execute a reading procedure of the interface return value, so as to implement the following steps:
storing the updated return value into a preset storage area of the mobile terminal; judging whether the interface is called; and if so, reading the corresponding return value from the preset storage area.
Optionally, the processor is configured to execute a reading procedure of the interface return value, so as to implement the following steps:
determining an application program corresponding to an interface, and determining a cache area according to the application program;
and saving the updated return value to the cache region.
To achieve the above object, the present invention proposes a computer-readable storage medium applied to a mobile terminal, the computer-readable storage medium storing one or more programs, which are executable by one or more processors to cause the one or more processors to perform the above steps.
Therefore, compared to the prior art, the method, the device, and the computer-readable storage medium for reading the interface return value provided by the present invention configure an identifier for each interface of the mobile terminal, and enable the server to store the correspondence between the interfaces and the configured identifier, and then receive the interface and the corresponding return value sent by the server based on the identifier each time the reading of the return value is performed, so as to obtain the return value after the interface is updated. Therefore, a large amount of interface interaction actions with the server are reduced, the calling time is reduced, the starting and running speed of the application can be improved to a large extent, and the problems that in the prior art, the interaction time with the server still needs to be consumed for interface calling every time, and the larger and larger storage space of the mobile phone cannot be effectively utilized are solved. Therefore, the cache of the interface is optimized through the push service, the larger and larger storage space of the mobile phone is effectively utilized, the starting and running speed of the application is improved, and better use experience is brought to a user.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of an optional mobile terminal in implementing various embodiments of the present invention;
FIG. 2 is a diagram of a wireless communication system for the mobile terminal shown in FIG. 1;
FIG. 3 is a flow chart illustrating a method for reading an interface return value according to the present invention;
fig. 4 is a schematic diagram of a first embodiment of a method for reading an interface return value according to the present invention;
fig. 5 is a schematic diagram of a second embodiment of a method for reading an interface return value according to the present invention;
FIG. 6 is a schematic diagram of an interface return value reading method according to the present invention;
fig. 7 is a schematic structural diagram of an interface return value reading device according to the present invention.
Reference numerals:
Figure BDA0001448315380000051
Figure BDA0001448315380000061
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 above mobile terminal hardware structure and communication network system, the present invention provides various embodiments of the method.
To solve the problems in the prior art, the present invention provides a method, a system, and a device for reading an interface return value, and a computer-readable storage medium, which are described in detail below.
As shown in fig. 3, in this embodiment, for a mobile terminal, configuring an identification flag for each interface of the mobile terminal, and enabling a server to store a corresponding relationship between an interface and a configuration flag, a method for reading an interface return value provided by the present invention may be divided into the following steps: step S310 is a reading step: and storing the updated return value into a local storage of the mobile terminal so as to read the corresponding return value from the local storage when an interface is called. The steps are adjusted in sequence according to different requirements, or certain steps are omitted. Or other steps may be supplemented as needed.
It can be understood that an execution main body of the interface return value reading method according to the embodiment of the present invention may be an interface return value reading device, where the interface return value reading device and the interface return value reading device are run in a mobile terminal, and are invoked when the mobile terminal needs to read the interface return value.
In this embodiment of the present invention, configuring an identification flag for each interface of the mobile terminal includes: sending an interface configuration command to a server so that the server configures an identification mark for each interface; and receiving the corresponding relation between the interface and the identification mark sent by the server. For example, the interface request is interface 1, interface 2, interface 3, and interface 4, the identification flag set by the server for each interface may be a number, and the specific numbers are: A. b, C, D are provided.
In addition, the sending an interface configuration command to the server to enable the server to configure the identifier for each interface includes: sending an interface configuration command to a server; the server judges whether the interface belongs to a combined calling interface or not; if so, the server configures the interfaces called by the merging with the same identification mark; and if not, the server respectively configures an identification mark for each interface.
A merge interface is an interface that can be used to execute the same request, for example, if for a request, the return values returned by interface 2 and interface 3 can be used as the response data of the request, then the two interfaces are made into a merge interface. Specifically, the number of merging interfaces may be 2, 3, 5, 10, and the like, and the embodiment of the present invention is merely exemplary and is not limited in particular.
It should be noted that, when the application is running, there are many interfaces to be called. Some of the interfaces can be merged, and some of the interfaces can be called independently. Whether a merged call or a separate call, the interface can be uniquely numbered and the server returns the number to the client in a return value. For example, the interface requests are interface 1, interface 2, interface 3 and interface 4. Wherein, the interface 1 is called independently, and the interface 2, the interface 3 and the interface 4 are called in a combined way. The server side numbers the interface 1 and the interfaces 2, 3 and 4, respectively, to be a and B, respectively. Both the server side and the client will record these numbers. And then the client stores the return value corresponding to the number in the storage space of the mobile phone, for example, the interface number 1 corresponds to the return value 1, and the interface number 2 corresponds to the return value 2.
S310, receiving the interface and the corresponding return value sent by the server based on the identification mark to obtain the return value after the interface is updated.
It should be noted that after each interface has set a corresponding identification flag, the mobile terminal uses the identification flag as the return value sent by the identification server to which interface the mobile terminal belongs. For example, if the server returns the interface identification flag bit a and the return value is 1, the interface 1 may be obtained according to the correspondence between the identification flag a and the interface pre-stored in the mobile terminal, and the return value 1 is used to replace the return value already stored in the mobile terminal, for example, if the originally stored return value is 0, then the return value of the interface 1 is updated to 1.
S320, storing the updated return value into a local storage of the mobile terminal, so as to read the corresponding return value from the local storage when the interface is called.
In the prior art, when a user has a new data request, the data request is sent to the server through the interface, and the waiting of the user is increased under the condition of poor network conditions, so that the user experience is poor.
In order to solve the problem, the return values of all the interfaces in the embodiment of the present invention are preferentially stored in the storage space of the mobile phone, so that when the application is started and run, the return values of the interfaces in the storage space are first loaded into the memory space for use by the application program, and the interfaces are directly used with the current return values, thereby reducing a large number of interface interaction actions with the server, reducing the call time, and greatly improving the starting and running speed of the application.
By the scheme, the cache of the interface is optimized through the push service, the larger and larger storage space of the mobile phone is effectively utilized, the starting and running speed of the application is improved, better use experience is brought to a user, the brand value of the mobile phone can be improved, and the power consumption of the mobile phone is reduced by reducing interface calling.
It will be understood by those skilled in the art that, in the case that the mobile terminal accesses the network, the interface return value request may be periodically sent to the server so as to determine whether the interface request has changed, and when the return value has changed, the new return value and the return value of the corresponding interface are directly updated. For example, if the return value of the interface 2 is changed to 1, the originally stored return value 0 in the mobile terminal is replaced, and when the mobile terminal needs to use the return value of the interface 2, the return value 1 is directly used without initiating a request to the server, so that the efficiency of data acquisition is improved, and the network pressure of the mobile terminal is also reduced.
Compared with the prior art, the interface return value reading method provided by the invention has the advantages that the identification mark is configured for each interface of the mobile terminal, the corresponding relation between the interface and the configuration mark is stored in the server, and the interface and the corresponding return value sent by the server can be received based on the identification mark every time the reading of the return value is executed, so that the return value after the interface is updated is obtained. Therefore, a large amount of interface interaction actions with the server are reduced, the calling time is reduced, the starting and running speed of the application can be improved to a large extent, and the problems that in the prior art, the interaction time with the server still needs to be consumed for interface calling every time, and the larger and larger storage space of the mobile phone cannot be effectively utilized are solved. Therefore, the cache of the interface is optimized through the push service, the larger and larger storage space of the mobile phone is effectively utilized, the starting and running speed of the application is improved, and better use experience is brought to a user.
In an embodiment of the present invention, the receiving, based on the identifier, the interface and the corresponding return value sent by the server to obtain an updated return value of the interface includes:
sending a query request to the server based on the identification mark so that the server sends the updated return value to the server, wherein the query request is a request sent out according to whether the return value of each interface changes or not;
or the like, or, alternatively,
and the server sends the changed return value to the mobile terminal under the condition of judging that the return value of the interface changes so as to obtain the updated return value of the interface.
In the embodiment of the invention, a cache service updating trigger can be realized at the server side, and when the cache of the interface is updated, the push service notification is called to the application client according to the serial number of the cache of the interface. For example, if the return value 1 of the number 1 is updated, the push service is called to notify the client, and the client receives the message, the client will automatically call the interface or the merged interface corresponding to the interface number 1 to update the return value and write the return value into the storage space. If a plurality of caches have updates in the same time, the messages are merged and pushed to the client. And the client calls each interface to update the return value according to the received message.
In an implementation manner of the present invention, the sending a query request to the server based on the identifier so that the server sends the updated return value to the server includes: and sending a query request to the server based on a preset time interval and the identification mark so that the server sends the updated return value to the server.
In order to prevent the push message from being missed, the mobile terminal also can realize a timing task, for example, the period is 1 hour, the server side is inquired about the current updated interface number, whether the interface return value corresponding to the number changes is determined, if so, the return value of the interface is directly obtained, otherwise, the return value is not obtained. This further improves the efficiency of obtaining the interface return value.
Specifically, the sending a query request to the server based on the identification flag to enable the server to send the updated return value to the server includes: and sending a query request to the server based on the identification marks, determining the version number of the return value corresponding to the interface according to the interface corresponding to each identification mark by the server, and updating the version number of the return value and the content of the return value when the version number in the server is different from the version number of the return value. The server side compares whether the version number of the cache value of each interface number changes or not in sequence after receiving the information, and directly merges and packs all return values to return to the client side if the version number of the cache value of each interface number changes.
In this embodiment of the present invention, the saving the updated return value to the local storage of the mobile terminal to read the corresponding return value from the local storage when the interface is called includes: storing the updated return value into a preset storage area of the mobile terminal; judging whether the interface is called; and if so, reading the corresponding return value from the preset storage area. By preferentially storing the return values of all the interfaces in the storage space of the mobile phone, the interface return values in the storage space are firstly loaded into the memory space when the application is started and operated, so that the starting and operating speeds of the application can be improved to a greater extent.
In addition, the saving the updated return value to the preset storage area of the mobile terminal includes: determining an application program corresponding to an interface, and determining a cache area according to the application program; and saving the updated return value to the cache region. The interface return values can be respectively corresponding to the application programs and stored in the cache areas corresponding to the application programs, so that the corresponding data identification can be conveniently carried out by a user.
Referring to fig. 4, fig. 4 is a schematic diagram of an embodiment of a method for reading an interface return value according to the present invention, including the following steps:
s410, determining a number corresponding to each interface of the mobile terminal;
s420, sending a query request of the interface return value to a server according to a preset period, and receiving a return value corresponding to the server;
and S430, storing the return value in a preset storage area.
Referring to fig. 5, fig. 5 is a schematic diagram of an embodiment of a method for reading an interface return value according to the present invention, including the following steps:
s510, determining a number corresponding to each interface of the mobile terminal;
s520, the server determines whether the return value of each interface changes;
and S530, if so, sending the corresponding interface and the return value to the mobile terminal.
Referring to fig. 7, fig. 7 is a device 700 for reading an interface return value, which is applied to a mobile terminal, and includes: processor 110, memory 109, and communication bus 730;
the communication bus 730 is used for realizing connection communication between the processor 110 and the memory 109;
the processor 110 is configured to execute an interface return value reading program to implement the following steps:
receiving an interface and a corresponding return value sent by the server based on the identification mark to obtain an updated return value of the interface;
and storing the updated return value into a local storage of the mobile terminal so as to read the corresponding return value from the local storage when an interface is called.
Further, the processor 110 is further configured to execute a reading procedure of the interface return value, so as to implement the following steps:
sending an interface configuration command to a server so that the server configures an identification mark for each interface;
and receiving the corresponding relation between the interface and the identification mark sent by the server.
Further, the processor 110 is further configured to execute a reading procedure of the interface return value, so as to implement the following steps:
sending an interface configuration command to a server;
the server judges whether the interface belongs to a combined calling interface or not; if so, the server configures the interfaces called by the merging with the same identification mark; and if not, the server respectively configures an identification mark for each interface.
Further, the processor 110 is configured to execute a reading procedure of the interface return value, so as to implement the following steps:
sending a query request to the server based on the identification mark so that the server sends the updated return value to the server, wherein the query request is a request sent out according to whether the return value of each interface changes or not;
or the like, or, alternatively,
and the server sends the changed return value to the mobile terminal under the condition of judging that the return value of the interface changes so as to obtain the updated return value of the interface.
Further, the processor 110 is configured to execute a reading procedure of the interface return value, so as to implement the following steps:
the sending a query request to the server based on the identification mark to cause the server to send the updated return value to the server includes:
and sending a query request to the server based on a preset time interval and the identification mark so that the server sends the updated return value to the server.
Further, the processor 110 is configured to execute a reading procedure of the interface return value, so as to implement the following steps:
and sending a query request to the server based on the identification marks, determining the version number of the return value corresponding to the interface according to the interface corresponding to each identification mark by the server, and updating the version number of the return value and the content of the return value when the version number in the server is different from the version number of the return value.
Further, the processor 110 is configured to execute a reading procedure of the interface return value, so as to implement the following steps:
storing the updated return value into a preset storage area of the mobile terminal; judging whether the interface is called; and if so, reading the corresponding return value from the preset storage area.
Further, the processor 110 is configured to execute a reading procedure of the interface return value, so as to implement the following steps:
determining an application program corresponding to an interface, and determining a cache area according to the application program;
and saving the updated return value to the cache region.
The interface return value reading device provided by the embodiment of the invention firstly configures the identification mark for each interface of the mobile terminal, enables the server to store the corresponding relation between the interface and the configuration mark, and then receives the interface and the corresponding return value sent by the server based on the identification mark when the reading of the return value is executed each time so as to obtain the return value after the interface is updated. Therefore, a large amount of interface interaction actions with the server are reduced, the calling time is reduced, the starting and running speed of the application can be improved to a large extent, and the problems that in the prior art, the interaction time with the server still needs to be consumed for interface calling every time, and the larger and larger storage space of the mobile phone cannot be effectively utilized are solved. Therefore, the cache of the interface is optimized through the push service, the larger and larger storage space of the mobile phone is effectively utilized, the starting and running speed of the application is improved, and better use experience is brought to a user.
Further, the present invention also provides a computer-readable storage medium applied to a mobile terminal, the computer-readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the steps of:
receiving an interface and a corresponding return value sent by the server based on the identification mark to obtain an updated return value of the interface;
and storing the updated return value into a local storage of the mobile terminal so as to read the corresponding return value from the local storage when an interface is called.
It should be noted that after each interface has set a corresponding identification flag, the mobile terminal uses the identification flag as the return value sent by the identification server to which interface the mobile terminal belongs. For example, if the server returns the interface identification flag bit a and the return value is 1, the interface 1 may be obtained according to the correspondence between the identification flag a and the interface pre-stored in the mobile terminal, and the return value 1 is used to replace the return value already stored in the mobile terminal, for example, if the originally stored return value is 0, then the return value of the interface 1 is updated to 1.
In the prior art, when a user has a new data request, the data request is sent to the server through the interface, and the waiting of the user is increased under the condition of poor network conditions, so that the user experience is poor.
In order to solve the problem, the return values of all the interfaces in the embodiment of the present invention are preferentially stored in the storage space of the mobile phone, so that when the application is started and run, the return values of the interfaces in the storage space are first loaded into the memory space for use by the application program, and the interfaces are directly used with the current return values, thereby reducing a large number of interface interaction actions with the server, reducing the call time, and greatly improving the starting and running speed of the application.
By the scheme, the cache of the interface is optimized through the push service, the larger and larger storage space of the mobile phone is effectively utilized, the starting and running speed of the application is improved, better use experience is brought to a user, the brand value of the mobile phone can be improved, and the power consumption of the mobile phone is reduced by reducing interface calling.
It will be understood by those skilled in the art that, in the case that the mobile terminal accesses the network, the interface return value request may be periodically sent to the server so as to determine whether the interface request has changed, and when the return value has changed, the new return value and the return value of the corresponding interface are directly updated. For example, if the return value of the interface 2 is changed to 1, the originally stored return value 0 in the mobile terminal is replaced, and when the mobile terminal needs to use the return value of the interface 2, the return value 1 is directly used without initiating a request to the server, so that the efficiency of data acquisition is improved, and the network pressure of the mobile terminal is also reduced.
Further, the one or more programs are also executable by the one or more processors to implement the steps of:
sending an interface configuration command to a server so that the server configures an identification mark for each interface;
and receiving the corresponding relation between the interface and the identification mark sent by the server.
Further, the one or more programs are also executable by the one or more processors to implement the steps of:
sending an interface configuration command to a server;
the server judges whether the interface belongs to a combined calling interface or not; if so, the server configures the interfaces called by the merging with the same identification mark; and if not, the server respectively configures an identification mark for each interface.
Further, the one or more programs are also executable by the one or more processors to implement the steps of:
sending a query request to the server based on the identification mark so that the server sends the updated return value to the server, wherein the query request is a request sent out according to whether the return value of each interface changes or not;
or the like, or, alternatively,
and the server sends the changed return value to the mobile terminal under the condition of judging that the return value of the interface changes so as to obtain the updated return value of the interface.
Further, the one or more programs are also executable by the one or more processors to implement the steps of:
and sending a query request to the server based on a preset time interval and the identification mark so that the server sends the updated return value to the server.
Further, the one or more programs are also executable by the one or more processors to implement the steps of:
and sending a query request to the server based on the identification marks, determining the version number of the return value corresponding to the interface according to the interface corresponding to each identification mark by the server, and updating the version number of the return value and the content of the return value when the version number in the server is different from the version number of the return value.
Further, the one or more programs are also executable by the one or more processors to implement the steps of:
storing the updated return value into a preset storage area of the mobile terminal; judging whether the interface is called; and if so, reading the corresponding return value from the preset storage area.
Further, the one or more programs are also executable by the one or more processors to implement the steps of:
determining an application program corresponding to an interface, and determining a cache area according to the application program;
and saving the updated return value to the cache region.
Compared with the prior art, the computer-readable storage medium provided by the invention firstly configures an identification mark for each interface of the mobile terminal, enables the server to store the corresponding relation between the interfaces and the configuration marks, and then receives the interfaces and the corresponding return values sent by the server based on the identification marks every time when reading the return values so as to obtain the return values after the interfaces are updated. Therefore, a large amount of interface interaction actions with the server are reduced, the calling time is reduced, the starting and running speed of the application can be improved to a large extent, and the problems that in the prior art, the interaction time with the server still needs to be consumed for interface calling every time, and the larger and larger storage space of the mobile phone cannot be effectively utilized are solved. Therefore, the cache of the interface is optimized through the push service, the larger and larger storage space of the mobile phone is effectively utilized, the starting and running speed of the application is improved, and better use experience is brought to a user.
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 solution 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, a robot, etc.) 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 (9)

1. A method for reading interface return value is applied to a mobile terminal, an identification mark is configured for each interface of the mobile terminal, and a server stores the corresponding relation between the interface and the configuration mark, wherein the method comprises the following steps:
receiving a return value which is sent by the server and corresponds to the interface based on the identification mark to obtain an updated return value of the interface;
storing the updated return value into a local storage of the mobile terminal so as to read the corresponding return value from the local storage when an interface is called;
the saving the updated return value to a local storage of the mobile terminal to read a corresponding return value from the local storage when an interface is called includes:
storing the updated return value into a preset storage area of the mobile terminal; judging whether the interface is called; and if so, reading the corresponding return value from the preset storage area.
2. The method for reading interface return value according to claim 1, wherein the configuring an identification flag for each interface of the mobile terminal includes:
sending an interface configuration command to a server so that the server configures an identification mark for each interface;
and receiving the corresponding relation between the interface and the identification mark sent by the server.
3. The method for reading the interface return value according to claim 2, wherein the sending an interface configuration command to the server to cause the server to configure the identifier for each interface comprises:
sending an interface configuration command to a server;
the server judges whether the interface belongs to a combined calling interface or not; if so, the server configures the interfaces called by the merging with the same identification mark; and if not, the server respectively configures an identification mark for each interface.
4. The method for reading the interface return value according to claim 1, wherein the receiving, based on the identification flag, the return value corresponding to the interface sent by the server to obtain the updated interface return value includes:
sending a query request to the server based on the identification mark so that the server sends the updated return value to the server, wherein the query request is a request sent out according to whether the return value of each interface changes or not;
or the like, or, alternatively,
and the server sends the changed return value to the mobile terminal under the condition of judging that the return value of the interface changes so as to obtain the updated return value of the interface.
5. The method for reading the interface return value according to claim 1, wherein the sending a query request to the server based on the identification flag to cause the server to send the updated return value to the server comprises:
and sending a query request to the server based on a preset time interval and the identification mark so that the server sends the updated return value to the server.
6. The method for reading the interface return value according to claim 1, wherein the sending a query request to the server based on the identification flag to cause the server to send the updated return value to the server comprises:
and sending a query request to the server based on the identification marks, determining the version number of the return value corresponding to the interface according to the interface corresponding to each identification mark by the server, and updating the version number of the return value and the content of the return value when the version number in the server is different from the version number of the return value.
7. The method for reading the interface return value according to claim 1, wherein the saving the updated return value to a preset storage area of the mobile terminal includes:
determining an application program corresponding to an interface, and determining a cache area according to the application program;
and saving the updated return value to the cache region.
8. An interface return value reading device, applied to a mobile terminal, for configuring an identification flag for each interface of the mobile terminal and enabling a server to store a correspondence between an interface and a configuration flag, the interface return value reading device comprising: a memory, a processor, and a communication bus;
the communication bus is used for realizing connection communication between the processor and the memory;
the interface returns a value reading program to implement the steps of:
receiving a return value which is sent by the server and corresponds to the interface based on the identification mark to obtain an updated return value of the interface;
storing the updated return value into a local storage of the mobile terminal so as to read the corresponding return value from the local storage when an interface is called;
the saving the updated return value to a local storage of the mobile terminal to read a corresponding return value from the local storage when an interface is called includes:
storing the updated return value into a preset storage area of the mobile terminal; judging whether the interface is called; and if so, reading the corresponding return value from the preset storage area.
9. A computer-readable storage medium applied to a mobile terminal, wherein the computer-readable storage medium stores one or more programs, which are executable by one or more processors to cause the one or more processors to perform the steps of the method for reading an interface return value according to any one of claims 1 to 7.
CN201711029407.7A 2017-10-27 2017-10-27 Method and device for reading interface return value and computer readable storage medium Active CN107864276B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711029407.7A CN107864276B (en) 2017-10-27 2017-10-27 Method and device for reading interface return value and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711029407.7A CN107864276B (en) 2017-10-27 2017-10-27 Method and device for reading interface return value and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107864276A CN107864276A (en) 2018-03-30
CN107864276B true CN107864276B (en) 2020-11-27

Family

ID=61697516

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711029407.7A Active CN107864276B (en) 2017-10-27 2017-10-27 Method and device for reading interface return value and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107864276B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103164270A (en) * 2011-12-12 2013-06-19 阿里巴巴集团控股有限公司 Java system application programming interface calling method and system using the same
CN103645940A (en) * 2013-12-04 2014-03-19 清华大学 Remote calling method and system
CN105867963A (en) * 2015-12-14 2016-08-17 乐视云计算有限公司 Application updating method and apparatus
CN106775830A (en) * 2016-11-25 2017-05-31 魏熙柠 A kind of web application page script resource automatic update method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090064200A1 (en) * 2007-08-30 2009-03-05 Wolfgang Walter Centralized Enhancement Service

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103164270A (en) * 2011-12-12 2013-06-19 阿里巴巴集团控股有限公司 Java system application programming interface calling method and system using the same
CN103645940A (en) * 2013-12-04 2014-03-19 清华大学 Remote calling method and system
CN105867963A (en) * 2015-12-14 2016-08-17 乐视云计算有限公司 Application updating method and apparatus
CN106775830A (en) * 2016-11-25 2017-05-31 魏熙柠 A kind of web application page script resource automatic update method and system

Also Published As

Publication number Publication date
CN107864276A (en) 2018-03-30

Similar Documents

Publication Publication Date Title
CN107749919B (en) Application program page display method and device and computer readable storage medium
CN108768775B (en) Information processing method, electronic device, and computer storage medium
CN112799577B (en) Method, terminal and storage medium for projecting small window
CN107862217B (en) Position information acquisition method, mobile terminal and computer storage medium
CN107317855B (en) Data caching method, data requesting method and server
CN107124466B (en) Method and device for preventing cache from penetrating and computer readable storage medium
CN109766119B (en) Recovery partition upgrade method, terminal and computer readable storage medium
CN107818022B (en) Application program interface merging method, mobile terminal and computer readable storage medium
CN111190559A (en) Screen projection control synchronization method, mobile terminal and computer readable storage medium
CN111158617A (en) Screen-casting content synchronization method, mobile terminal and computer-readable storage medium
CN112105057B (en) Method and equipment for locally brushing electronic price tag and computer readable storage medium
CN107360211B (en) Information flow information offline method, related equipment and computer storage medium
CN112494932A (en) Game frame supplementing method and device, terminal and computer readable storage medium
CN112612372A (en) Touch event regulation and control method and device and computer readable storage medium
CN112423211A (en) Multi-audio transmission control method, equipment and computer readable storage medium
CN109683796B (en) Interaction control method, equipment and computer readable storage medium
CN111970738A (en) Network switching control method, equipment and computer readable storage medium
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
CN110287381B (en) Page control node searching method, terminal and computer readable storage medium
CN109995937B (en) Application icon display method, mobile terminal and computer-readable storage medium
CN108279985B (en) Interface request protocol transformation method, equipment and computer readable storage medium
CN108304302B (en) Interface merging method, equipment and computer readable storage medium
CN107864276B (en) Method and device for reading interface return value 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
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Yu Mingyang

Inventor after: Zha Zhiyong

Inventor after: Liang Hanghan

Inventor before: Ni Bingju

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20201103

Address after: 430070, 341 East Main Street, Hongshan District, Hubei, Wuhan

Applicant after: STATE GRID HUBEI ELECTRIC POWER CO., LTD. INFORMATION AND COMMUNICATION Co.

Address before: 518057 Guangdong Province, Shenzhen high tech Zone of Nanshan District City, No. 9018 North Central Avenue's innovation building A, 6-8 layer, 10-11 layer, B layer, C District 6-10 District 6 floor

Applicant before: NUBIA TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant