Project background
In 5 g era coming, at present there are still some places or some scenarios not network or weak network, the current business people at work and cannot leave the use of mobile app, especially staff at the time of aerial work, because no network or weak network lead to work not smooth, even hinder the work process, which can lead to business people laborious, Inefficient. Therefore, it is imperative that APP support can ensure the normal operation of business processes even in offline mode. The data cache management system in APP offline mode ensures that users have no perception experience and services run normally when there is no network or weak network.
Project introduction
Flowchart for offline file storage
First, the user in the app page photograph, recording, video call after the local storage method, the method according to the hash file hash value time-stamped through MD5 encryption, generate a unique string, splicing server address again the only address the URL generated file access, multimedia file related data in the local multimedia data in the table, The user operation page is displayed. Secondly, after the operation on app page, the user invokes the local storage method for the data information and method routing to be synchronized, and stores the text data and route method in JSON mode to the service data table, and returns the user’s operation success. Thirdly, the background automatic data synchronization mechanism detects whether there is any data to be synchronized, and invokes the data synchronization interface. After successful data synchronization, the database data status is updated. Below is the database file storage table.
Project characteristics
- In this solution, the data is stored on the SD card of the mobile phone preferentially, and the user does not need to determine whether the data is synchronized to the server, so as to achieve the same use experience with the network in the case of weak network or no network.
- The normal technical solution for multimedia files is that each file needs to visit the server once to generate the URL to access the server. This solution uses the APP to generate a unique URL to solve the problem of multiple access to the server, which can reduce the waiting time for users to access the server and improve user experience.
- In this scheme, the service data synchronization interface is associated with the service data by defining a route. After submitting the data to the local database, users do not need to worry about the mapping relationship between the data and the service interface.
- In this scheme, local data can be cleared within a specified time, which can effectively avoid the problem of insufficient storage of mobile phones, and the problem of low query efficiency caused by the number of local SQLite database files.
- In the scenario where there is no network or weak network, users can operate services by automatically storing and uploading user data, reducing data synchronization exceptions caused by network jitter, shortening the data synchronization time and improving data synchronization efficiency.
- Background data synchronization can realize synchronization of multiple files at a time, reduce the number of network requests, and reduce the power consumption of corporate network broadband and mobile phones
Project innovation
- The APP locally processes multimedia files and user operation data to reduce the impact of no-network, weak network, or network jitter on app operations.
- The data synchronization engine in the APP starts the Service, which monitors the network status of the mobile phone. When the mobile phone network is found to be in WIFI mode or 4G mode, the data can be automatically synchronized to the server.
- The data submitted by users is stored in the mobile phone database, and users can add, delete, modify and query data at any time without accessing the server for each modification, which reduces the dependence on the server and avoids the waste of network broadband resource side.
- This scheme associates the business data with the server interface through the business route, and the business route defined at present depends on the routing system in the current APP infrastructure
Author of this article: Yang Xiaojian, Freely Big front End R&D Center
Recruitment information
Free big front end R&D center recruiting new students!
FE/IOS/Android engineers look over
Company benefits include:
- Five insurances and one housing fund in full, plus commercial insurance
- Free gym + annual physical examination
- 10 percent discount for rent near the company
- 2 promotions per year
Office location: Beijing Jiuxianqiao Putian Industrial Science and Technology Park welcome you to join us! Please send your resume to [email protected], or add wechat V-nice-V for details!