[Android] android communication protocol and android communication protocol
1. Data Differentiation
Mobile Phone: constant Storage
Server: Database Table creation and storage
2. Data Source
Android, ios, pc, wap
3. Data collection and data mining
IMEI: device ID
IMSI: SIM card number
4. Data Encryption
4.1RSA Algorithm
4.2 simple code processing: SimpleDateFormat + Random value (Random)
4.3 Data Digest: MD5 (know the original data before MD5), MD5 features (if the encrypted raw data is the same, the encrypted results are also the same, therefore, the time stamp is used to ensure that the tokens of each request are different)
Unique ID of the request
5. Verify data
The server needs to verify the data received by the mobile phone.
5.1 parse plaintext data
5.2 mainly compares token and token composition: Timestamp + agreed random Value
Sent by mobile phone: Timestamp, assembled token
Server receiving: Timestamp, receiving token
The server combines token and received token comparison based on the timestamp + agreed random Value
6. Protocol Generalization
6.1 formulation of new protocols and encapsulation of existing protocols
6.2 protocol format: xml and json
6.3 protocol compression: wbxml and massive data compression
New Protocol:
1. Implementation of basic functions
2. Data collection
3. scalability
4. Information Integrity Verification
5. Convenient Programming
Wbxml:
The xml compression maintains a corresponding relationship such:
<Message >=====> M
<Header >=======> H
Saves a lot of data space
Processing of large data packets:
You can splice all the data to be transmitted to save unnecessary data and retrieve the data according to certain rules.