Movatterモバイル変換


[0]ホーム

URL:


CN112433867A - Method for optimizing APP request equipment list of Android internet of things - Google Patents

Method for optimizing APP request equipment list of Android internet of things
Download PDF

Info

Publication number
CN112433867A
CN112433867ACN202011337444.6ACN202011337444ACN112433867ACN 112433867 ACN112433867 ACN 112433867ACN 202011337444 ACN202011337444 ACN 202011337444ACN 112433867 ACN112433867 ACN 112433867A
Authority
CN
China
Prior art keywords
device list
app
time
list
server
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.)
Pending
Application number
CN202011337444.6A
Other languages
Chinese (zh)
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.)
Sichuan Changhong Electric Co Ltd
Original Assignee
Sichuan Changhong Electric 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 Sichuan Changhong Electric Co LtdfiledCriticalSichuan Changhong Electric Co Ltd
Priority to CN202011337444.6ApriorityCriticalpatent/CN112433867A/en
Publication of CN112433867ApublicationCriticalpatent/CN112433867A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

The invention discloses a method for optimizing an APP request device list of an Android internet of things, which comprises the steps of obtaining a timestamp of a device list obtained last time from local when obtaining the device list from a server; and comparing the current time with the timestamp of the device list acquired last time, judging whether the time interval is greater than the specified time, if so, executing to acquire the remote interface of the device list from the server, returning the device list to the APP interface by the server to complete interface data updating, storing the device list to the local and adding a timestamp mark, and otherwise, acquiring the device list and the time information stored last time from the local and returning the APP interface to complete interface data updating. The invention adds time interval judgment, and selects to execute local acquisition or acquisition from the server interface according to the time interval. Alleviate the pressure that the server side obtained the equipment list, APP end reduces the time that the user waited for simultaneously, promotes user experience.

Description

Method for optimizing APP request equipment list of Android internet of things
Technical Field
The invention relates to the technical field of Internet of things, in particular to a method for optimizing an APP request device list of an Android Internet of things.
Background
Can involve equipment management in thing networking APP, the equipment list comprises a series of equipment to the thing networking family is looked after as the example, and the thing networking equipment that probably includes has air conditioner, desk lamp, socket, (window) curtain etc.. In the actual production process, the internet of things devices are not always connected to the same internet of things platform, for example, a table lamp is from a millet internet of things platform, an air conditioner is from an ali internet of things platform, and the air conditioner is from a factory built-in platform, so that when a service server retrieves the device lists, great network communication pressure is generated, and the load of a service end is seriously improved by frequent device list acquisition. In the internet of things APP, due to the reason that a user frequently switches pages, the problem that the equipment list of the internet of things is frequently requested, the pressure of a server is too high, the waiting time of the user is long, and the equipment list cannot be acquired when the request is overtime is caused.
Disclosure of Invention
The invention aims to provide a method for optimizing an APP request device list of an Android internet of things, which is used for solving the problems of high server pressure and overtime request caused by frequent device list acquisition or frequent page switching of an APP user side of the internet of things in the prior art.
The invention solves the problems through the following technical scheme:
a method for optimizing an APP request device list of an Android Internet of things comprises the following steps:
step S1: when the equipment list is acquired from the server, acquiring a timestamp of the equipment list acquired last time from the local;
step S2: comparing the current time with the timestamp of the device list acquired last time, judging whether the time interval is greater than the specified time, if so, executing the step S3, otherwise, executing the step S4;
step S3: the remote interface of the equipment list is obtained from the server side, the server side returns the equipment list to the APP interface to complete interface data updating, and meanwhile the equipment list is stored to the local and a timestamp mark is added;
step S4: and acquiring the last stored equipment list and time information from the local and returning to the APP interface to complete interface data updating.
The invention adds time interval judgment, and selects to execute local acquisition or acquisition from the server interface according to the time interval. Alleviate the pressure that the server side obtained the equipment list, APP end reduces the time that the user waited for simultaneously, promotes user experience.
And the server returns the device list to the APP interface by calling the getDevice () method.
Storing the device list to local is accomplished by calling the setDevice () method.
Compared with the prior art, the invention has the following advantages and beneficial effects:
according to the method and the device, a timestamp adding mode is adopted, the device list data is stored to the local, if the device calls the acquisition device list again within a specified interval (for example, 10 seconds), the device list is acquired from the local storage, the pressure of the server side for acquiring the device list can be relieved through the judgment of the timestamp, meanwhile, the waiting time of a user is reduced by the APP side, and the user experience is improved.
Drawings
FIG. 1 is a flow chart of the present invention.
Detailed Description
The present invention will be described in further detail with reference to examples, but the embodiments of the present invention are not limited thereto.
Example (b):
with reference to fig. 1, a method for optimizing an Android internet of things APP request device list is disclosed, where when an internet of things APP switches an interface or performs other operations, a getDevice () method is called many times in a short time, when an internet of things APP page switches, a device list needs to be obtained to update an interface display, at this time, a getDevice () method is adopted to obtain a device list and a timestamp obtained last time from local data, and a method for obtaining the timestamp and the device list can be implemented by using the following codes:
SharedPreferences sp=AppManager.appContext().getSharedPreferences
(SHARED_NAME,Context.MODE_PRIVATE);
String timestamp=sp.getString("timestamp",time);
String devices=sp.getString("devices",devices);
wherein timestamp is a timestamp, and devises is a json character string corresponding to the device list.
If the acquired time interval (currenttime-time) is greater than the specified time (such as 10s), acquiring a device list from the acquisition server, wherein the device list is usually a device list interface provided by an http access server; the server returns the data list to the upper-layer getDevice () method, calls the setDevice () method to store the device list to the local, and adds a timestamp mark, wherein the specific android implementation code is as follows:
SharedPreferences
sp=AppManager.appContext().getSharedPreferences(SHARED_NAME,Context.MODE_PRIVATE);
SharedPreferences.Editor editor=sp.edit();
editor.putString("timestamp",time);
editor.putString("devices",devices);
wherein timestamp is a timestamp, and devices is a json character string corresponding to the device list; returning the getDevice () method to the APP interface, completing the interface data update, and ending the process;
if the time interval is less than the specified time interval 10s, the Internet of things APP locally acquires the last stored equipment list and time information and returns the list and the time information to the getDevice () method, the getDevice () method returns the interface of the Internet of things APP, the interface data updating is completed, and the process is finished.
Although the present invention has been described herein with reference to the illustrated embodiments thereof, which are intended to be preferred embodiments of the present invention, it is to be understood that the invention is not limited thereto, and that numerous other modifications and embodiments can be devised by those skilled in the art that will fall within the spirit and scope of the principles of this disclosure.

Claims (3)

CN202011337444.6A2020-11-252020-11-25Method for optimizing APP request equipment list of Android internet of thingsPendingCN112433867A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202011337444.6ACN112433867A (en)2020-11-252020-11-25Method for optimizing APP request equipment list of Android internet of things

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202011337444.6ACN112433867A (en)2020-11-252020-11-25Method for optimizing APP request equipment list of Android internet of things

Publications (1)

Publication NumberPublication Date
CN112433867Atrue CN112433867A (en)2021-03-02

Family

ID=74697709

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202011337444.6APendingCN112433867A (en)2020-11-252020-11-25Method for optimizing APP request equipment list of Android internet of things

Country Status (1)

CountryLink
CN (1)CN112433867A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115099979A (en)*2022-06-282022-09-23中国银行股份有限公司 A financial product recommendation system

Citations (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101232467A (en)*2008-02-222008-07-30中兴通讯股份有限公司Method for obtaining information using time jab in real time communicating business
CN102281309A (en)*2010-06-112011-12-14腾讯科技(深圳)有限公司Network information issuing method, network information issuing system and client
CN106254529A (en)*2016-09-202016-12-21郑州云海信息技术有限公司A kind of client-side data cache method and apparatus
CN106612263A (en)*2015-10-272017-05-03阿里巴巴集团控股有限公司Method and device used for processing application access request
US20190114086A1 (en)*2017-10-182019-04-18Adobe Inc.Cloud-synchronized local storage management
CN110209976A (en)*2019-06-102019-09-06南威互联网科技集团有限公司A kind of buffering updating method and computer equipment of front end resource
CN110535889A (en)*2019-10-152019-12-03四川长虹电器股份有限公司A kind of Internet of Things interactive system
CN111142996A (en)*2019-12-132020-05-12深圳拓邦股份有限公司Page display method, system, mobile terminal and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101232467A (en)*2008-02-222008-07-30中兴通讯股份有限公司Method for obtaining information using time jab in real time communicating business
CN102281309A (en)*2010-06-112011-12-14腾讯科技(深圳)有限公司Network information issuing method, network information issuing system and client
CN106612263A (en)*2015-10-272017-05-03阿里巴巴集团控股有限公司Method and device used for processing application access request
CN106254529A (en)*2016-09-202016-12-21郑州云海信息技术有限公司A kind of client-side data cache method and apparatus
US20190114086A1 (en)*2017-10-182019-04-18Adobe Inc.Cloud-synchronized local storage management
CN110209976A (en)*2019-06-102019-09-06南威互联网科技集团有限公司A kind of buffering updating method and computer equipment of front end resource
CN110535889A (en)*2019-10-152019-12-03四川长虹电器股份有限公司A kind of Internet of Things interactive system
CN111142996A (en)*2019-12-132020-05-12深圳拓邦股份有限公司Page display method, system, mobile terminal and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115099979A (en)*2022-06-282022-09-23中国银行股份有限公司 A financial product recommendation system

Similar Documents

PublicationPublication DateTitle
CN102761736A (en)Video decoding method and device
CN110362598B (en)Data query method and device, storage medium and electronic equipment
CN102065413B (en)Database updating method and system, and base station self-starting method and system
CN106649771A (en)Data model updating method and system for database
CN104579873A (en)Method and system for controlling intelligent home equipment
WO2016173348A1 (en)Network access method and mobile communications terminal
CN105808702A (en)Page content refreshing method and system, and page content synchronous refreshing management system
JP2017076430A (en) Server, control method and program
CN105868196A (en)Method for generating industrial data report in server
CN110839171A (en)Method and device for applying television screen saver and computer storage medium
CN112433867A (en)Method for optimizing APP request equipment list of Android internet of things
CN101150534A (en)Method and system for obtaining updated image resources of contacts
CN102148887A (en)Method for displaying region and weather of cellphone incoming call contacter
CN102236707A (en)Method, device and system for obtaining update data of database
CN112003976B (en)Hard-coding and hard-decoding test method and device
CN112764874A (en)CMDB configuration management system-based virtual machine server information acquisition method
KR20170022062A (en)Management server, telematics terminal and method thereof to support and provide optimum delta update
US20130091093A1 (en)Method and device for managing information of a universal integrated circuit card
CN112114864B (en)Cocoapods code pulling optimization method and system
US20110038471A1 (en)Dialing Plan Analysis and Cleanup
CN107819688B (en)Method, system and device for realizing forwarding processing
WO2015106495A1 (en)Method and device for split-screen presentation of applications and terminal
CN110099179B (en)Number updating method and device
CN112351064B (en)Method for redirecting network request by iOS (Internet operating System) by using AFNetworking
CN114666329B (en)APP management method, intelligent terminal and computer readable storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication
RJ01Rejection of invention patent application after publication

Application publication date:20210302


[8]ページ先頭

©2009-2025 Movatter.jp