The entire complete code is only about 425KB after compression (code + 501,000 segment data);
The data is publicly downloaded from the Internet: the query results are for learning and reference only.
Security suggestion: Change the database name DB to the name of your own guidance (parameters on this page + two file names)
Or pseudo-static rules to limit the download of .json format and .db format files
Response time: 501,000 data: It takes about 0.001 seconds to check one item, which is as expected; it takes about 0.014 seconds to check 30 items;
Data compression: compress 59MB of SQL data on the network to less than 2.5MB;
Compression method: 7-digit mobile phone number segment -1299999 and converted to 4-digit hexadecimal (each number is shortened by 3 digits);
Highly repetitive content: province + city + postal code + area code. Many Chinese characters are represented by 2-digit letters, see Db.json;
Highly repetitive content: Several Chinese characters for operator are shortened to 1 letter to represent it, see Db.json;
The 501000 line number segment information is divided into 1296 lines; the last two digits of the four letters are indexed into each line, see Db.json.
Query optimization: remove duplicate number segments and query again to reduce repeated queries for the same number segment; and maintain the original order of call display.
The last / after the query URL is index.php?x=cha&m=Mobile phone number. If there is a result, explain the parsing process. If there is no result, tell you how to add data