Method for secure patrol inspection based on Android mobile device under no network
By using the Pretty Good Privacy library and Apache Commons Compress for data encryption and compression in offline environments, combined with SQLite database and QR code/RFID tag information acquisition, the problem of data not being uploaded in a timely manner and leakage during mobile device security inspections is solved, achieving data security and efficient management.
Patent Information
- Application Number
- CN202411860892.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2044-12-17
AI Technical Summary
In environments without a network, security inspection data from mobile devices cannot be uploaded in a timely manner, posing a risk of data leakage. Furthermore, existing technologies are complex and inefficient, failing to guarantee the integrity and security of the data.
It employs the Pretty Good Privacy library for asymmetric encryption, combines Apache Commons Compress for data compression and decompression, uses the SHA-256 algorithm to generate digests, transmits and stores data via USB connection, utilizes an SQLite database for management, and combines QR codes and RFID tags to obtain inspection point information, achieving local encrypted storage and management, and using digital signatures to ensure data integrity and source reliability.
It ensures data security and integrity in a network-free environment, improves inspection efficiency, reduces equipment costs, avoids the complexity of manual data entry and the risk of data confusion, and ensures the security and integrity of data during transmission.
Smart Images

Figure CN119961948B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of security inspection technology, and is particularly applicable to a method for security inspection based on Android mobile devices in the absence of a network. Background Technology
[0002] During engineering inspections, some enterprises with encryption requirements need to use isolation technology to separate inspection equipment from public networks such as the internet to prevent the leakage of confidential information. Currently, most enterprises and institutions use intranet management. The intranet separates information from the internet to prevent leakage. For mobile inspection equipment, VPN technology or methods such as inspection personnel filling out paper forms and taking photos are commonly used to prevent information leakage. However, VPN technology cannot completely prevent the leakage of information already stored on mobile devices. Methods such as inspection personnel filling out paper forms and taking photos require them to return to the management office, organize the forms or photos, and then manually enter them into the system, which is complex, inefficient, and prone to data errors. Summary of the Invention
[0003] The purpose of this invention is to provide a method for security inspection of Android mobile devices without a network, aiming to solve the problems of poor data confidentiality and low work efficiency of mobile devices in security inspection work.
[0004] To achieve the above objectives, the present invention adopts the following technical solution:
[0005] The method for security inspection of Android mobile devices without network access as described in this invention includes the following steps:
[0006] S1, Generate an inspection task compressed package on the inspection data processing server; The inspection task compressed package uses the Pretty Good Privacy library for asymmetric encryption;
[0007] S2 connects the mobile device to the inspection data storage server via USB and transmits the inspection task compressed package to the mobile device.
[0008] S3, decompress and decrypt the inspection task compressed package, and write the inspection task to the database of the mobile device;
[0009] S4: Obtain inspection point information by scanning the inspection point QR code and retrieve the inspection task sheet of the inspection point from the database.
[0010] S5: Record the inspection information item by item according to the inspection task sheet, and then encrypt and save it to the specified file;
[0011] S6. Repeat steps S4 and S5 until the inspection task is completed.
[0012] S7 compresses the specified file and transmits it to the inspection data storage server via USB connection for data decryption and storage.
[0013] Further, step S1 specifically includes creating a temporary file, writing the serialized inspection task JSON data into the temporary file, encrypting and compressing the temporary file, and applying the SHA-256 algorithm to generate a digest.
[0014] Furthermore, after the inspection task compressed package in step S2 is transferred to the mobile device, the temporary files on the inspection data storage server are deleted.
[0015] Furthermore, in step S3, the inspection task compressed package is decompressed to a specified directory using Apache Commons Compress technology. During decompression, the SHA-256 algorithm is applied to generate a digest, which is then compared with the expected checksum provided by the inspection task compressed package. After decompression, the file size and attributes are checked.
[0016] Furthermore, in step S3, Pretty Good Privac is used to decrypt the decompressed file, the corresponding table structure is constructed using the SQLite database, and the decrypted data is written into the database according to a predetermined format.
[0017] Furthermore, the inspection point QR code in S4 contains the name, number, and location information of the equipment to be inspected at the inspection point; the inspection task sheet for the inspection point is obtained by querying the database based on the name, number, and location of the equipment to be inspected.
[0018] Furthermore, RFID tags can be used in step S4 to obtain inspection point information by scanning the RFID tags.
[0019] Furthermore, in step S5, the images and videos in the inspection information are automatically added with timestamps and inspector watermarks, and then saved to a specified path on the mobile device, carrying the name, number, location, and inspection items of the equipment to be inspected at the inspection point.
[0020] Furthermore, the S5 step also includes recording the digital signature of the inspector, the signing time, and the unique identifier of the mobile device.
[0021] Furthermore, the mobile device has a built-in GPS module that generates an inspection route map during the inspection process.
[0022] The advantages of this invention are:
[0023] 1. This invention designs a mechanism for encrypting and managing security inspection data locally on mobile devices in a network-free environment. This not only solves the problem of inspection data not being able to be uploaded in a timely manner in remote or poorly covered water conservancy facilities areas, but also improves the flexibility and coverage of inspections, ensuring the integrity and security of data, and enabling inspection tasks to be completed even when the network is unavailable.
[0024] 2. This invention uses an Android device to realize functions such as data input, encryption, compression and summary generation, which improves inspection efficiency and reduces equipment costs.
[0025] 3. Throughout the entire data acquisition process, this invention employs Pretty Good Privacy for data encryption and Apache Commons Compress for data compression, ensuring data security and transmission efficiency during the data acquisition process.
[0026] 4. This invention uses the SHA-256 algorithm to generate data digests and combines it with KeyPairGenerator's digital signature technology to ensure data integrity and source reliability, effectively preventing data from being unintentionally or maliciously modified during transmission.
[0027] 5. In this invention, the mobile device and the data server transmit data directly, eliminating the need for a network and the need for manual data processing and entry, thus avoiding the complexity, inefficiency, and risk of data confusion caused by manual data entry. Attached Figure Description
[0028] Figure 1 This is a flowchart of the method for security inspection of Android mobile devices without network access as described in this invention. Detailed Implementation
[0029] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0030] The method for security inspection of Android mobile devices without network access described in this invention, such as... Figure 1 As shown, it includes the following steps:
[0031] S1. Generate a compressed package of inspection tasks on the inspection data processing server. Specifically, create a temporary file, write the serialized inspection task JSON data into the temporary file, use the Apache Commons Compress library to perform asymmetric encryption and compression on the temporary file using the Pretty Good Privacy library, and simultaneously apply the SHA-256 algorithm to generate a digest of the compressed package of inspection tasks.
[0032] S2 connects the mobile device to the inspection data storage server via USB and transmits the inspection task compressed package to the mobile device.
[0033] Before transmission, it is essential to ensure that the inspection task compressed package is not locked by other processes and that the transmission protocol used (such as MTP or PTP) is compatible with both the computer and mobile device to guarantee that the file can be correctly identified and accessed. It is also crucial to ensure that the file system of the inspection data processing server is compatible with the file system on the Android mobile device (such as FAT32, NTFS, or exFAT) to avoid problems caused by file system incompatibility. Throughout the transmission process, connection stability should be monitored, and the connection should be properly disconnected after transmission to prevent file corruption or data loss. After the inspection task compressed package is transmitted to the mobile device, temporary files on the inspection data storage server should be deleted.
[0034] S3, decompress and decrypt the inspection task archive, and write the inspection task to the database of the mobile device.
[0035] The Apache Commons Compress technology is used to decompress the inspection task archive, and the decompressed files are stored in a pre-specified directory. During decompression, the SHA-256 algorithm is applied to generate a digest of the decompressed files. This digest is compared with the expected checksum provided in the inspection task archive to ensure that the files have not been corrupted or tampered with during decompression. After decompression is complete, the file structure is verified by checking the size and attributes of the decompressed files, thereby ensuring the integrity and consistency of the files.
[0036] Then, the encrypted file is decrypted using the corresponding JcaPGPObjectFacto, JcePublicKeyDataDecryptorFactory, and implicit public key from the Pretty Good Privacy library. By configuring the same key and algorithm, the decryption process is ensured to match the encryption process. The decrypted data is read as a stream and processed line by line or block by block. Subsequently, a database is created or opened using an SQLite database operation interface (such as SQLiteOpenHelper), and the corresponding table structure is constructed. The decrypted data is inserted into the inspection record table according to a predetermined format to ensure data integrity and accuracy. In this way, the encrypted file is successfully decrypted and stored in the SQLite database.
[0037] S4 obtains inspection point information by scanning the inspection point's QR code and retrieves the inspection task sheet for the inspection point from the database.
[0038] Specifically, upon arriving at the inspection point, inspection personnel use the camera of their Android mobile device to activate the QR code scanning function. The Android mobile device uses image acquisition technology to recognize the QR code image of the inspection point, and then uses image processing and decoding technology to identify the location marker in the QR code and determine its direction. The built-in decoding algorithm decodes and corrects the feature information, ultimately extracting the identification information within the QR code. The entire process requires no network connection, achieving rapid and accurate identification even in a network-free environment.
[0039] For areas where QR code scanning at inspection points is relatively difficult to access (e.g., high-altitude data collection equipment), RFID tags can be used to identify equipment information and obtain inspection point information. RFID tags can be identified remotely within a certain distance. The tag chip stores a unique electronic code, which represents specific information about the object to which the tag is attached. An RFID reader identifies the information carried by the RFID tag and transmits it to an Android mobile device.
[0040] The inspection point QR code contains the name, number, and location information of the equipment to be inspected at the inspection point. Based on the equipment name, number, and location information parsed from the inspection point QR code, these are used as keywords to query the database. An SQLite database query is then used to retrieve the corresponding inspection task order for the inspection point matching the keywords from the local database of the Android mobile device. The search results include basic information about the equipment at the inspection point, historical inspection records, and key points to focus on during the current inspection, for inspection personnel to view and refer to when performing the inspection task.
[0041] S5 records the inspection information item by item according to the inspection task sheet, and then encrypts and saves it to a specified file on the mobile device.
[0042] Inspection personnel can take relevant photos or videos to record the inspection site. To ensure that each photo or video is closely associated with a specific inspection item, information such as the name, number, location, and inspection item of the equipment to be inspected at the current inspection point will be embedded in the information carried by the photo or video. These photos and videos will then be saved to a specified storage path on the Android mobile device. Furthermore, detailed information about the inspection items at the inspection point and their corresponding photo or video paths will be stored in a local SQLite database to ensure the comprehensiveness and accuracy of the inspection work.
[0043] When recording image and video information, the Android Canvas and Bitmap classes are used to embed the current time, inspector's name or unique identifier, and the Android mobile device's unique identifier during image rendering. This automatically adds a timestamp and inspector watermark to each image to prevent tampering and repudiation. The time information is obtained via System.currentTimeMillis() to ensure accuracy; the inspector information is preset based on the logged-in account. The watermark content is overlaid in a semi-transparent manner in the corner of the image, without affecting the original image content.
[0044] Simultaneously, a personal digital certificate is installed on the Android mobile device of this invention. Inspection personnel can sign and confirm the inspection information at each inspection point.
[0045] This technology is based on Public Key Infrastructure (PKI). When an inspector signs, they retrieve the private key from the KeyStore API by calling an Android KeyPairGenerator instance, encrypt the inspection message digest, and generate a digital signature. Simultaneously, a timestamp and the unique identifier of the Android mobile device are recorded to enhance the non-repudiation of the signature. The signature data, along with the inspection information, is stored in a local SQLite database, ensuring the integrity, authenticity, and traceability of the information. This process requires no network connection, guaranteeing secure verification even in offline environments.
[0046] After all the inspection tasks at this inspection point are completed, the inspection data in the inspection tasks is encrypted using the Pretty Good Privacy library to ensure data security.
[0047] First, a `PGPSecretKeyRingCollection` instance is created based on an encryption algorithm (such as ECC) to read the key ring file. Then, a `PGPSecretKeyDecryptor` object is initialized using the inspector's key ring for asymmetric encryption. Next, a `FileOutputStream` is created pointing to the file storing the encrypted data. The `PGP` and `FileOutputStream` are combined to write the inspector data through the `FileOutputStream`, automatically completing the encryption process. After encryption is complete, all streaming resources are closed.
[0048] S6. Repeat steps S4 and S5 until the inspection task is completed.
[0049] Once all tasks on the inspection task sheet at one inspection point are completed (including data encryption, signing, and adding watermarks to images), the process will automatically move to the next inspection point. Steps S4 and S5 are repeated. Upon arrival at the inspection point, the inspection personnel activate the QR code scanning function to obtain equipment and inspection information. During the inspection, inspection items are recorded, along with images and videos. The inspection personnel sign to confirm the inspection information. After the inspection task sheet is completed, the data is encrypted to ensure data security.
[0050] S7 compresses the specified file and transmits it to the inspection data storage server via USB connection for data decryption and storage.
[0051] Using the Apache Commons Compress library in Java, all inspection information files storing this inspection task on the Android mobile device are compressed into a single compressed package containing all inspection information. This saves storage space, prevents information corruption, and improves data transmission efficiency. During compression, the Android mobile device simultaneously uses the SHA-256 hash algorithm to calculate a unique message digest for the compressed package content. This digest serves as the digital fingerprint of the compressed package for subsequent data integrity verification, ensuring that the information has not been tampered with during transmission or storage.
[0052] Back at the management office, the compressed file was transferred to the inspection data storage server via USB connection, and the data encryption result and summary information were verified.
[0053] On the inspection data storage server, the compressed package is decompressed. Then, the SHA-256 algorithm is used to regenerate a message digest from the decompressed data, which is compared with the message digest previously generated by the device and transmitted along with the compressed package. If the two are completely identical, the verification passes, confirming that the data has not been tampered with or corrupted during transmission, thus ensuring the integrity and authenticity of the inspection data.
[0054] After data transmission and digest verification are completed, data decryption and parsing are performed. First, using the decryption algorithm corresponding to the encryption algorithm, the encrypted data in the compressed package is decrypted through the JcePublicKeyDataDecryptorFactory to recover the original inspection data. During decryption, data integrity is verified to ensure that no errors or data loss are introduced. After decryption, the decrypted data is parsed to extract specific content such as inspection records, trajectory information, images, and videos. Finally, this decrypted and parsed inspection data is securely submitted to the data storage management system on the inspection data storage server.
[0055] After receiving the submitted inspection data, the data storage management system on the inspection data storage server first performs a secondary verification of data integrity. This step involves recalculating the hash value of the data and comparing it with the previously submitted digest information to ensure that the data has not been tampered with or damaged during transmission to the server. Once verification is successful, the system writes the data into the database according to a preset data structure for subsequent data storage, analysis, report generation, and decision support, thus completing the entire water conservancy industry safety inspection process based on Android devices in a network-free environment.
[0056] Meanwhile, to ensure the reliability and non-repudiation of the data source, the data storage management system on the inspection data storage server checks and verifies the digital signature generated by KeyPairGenerator that is submitted along with the data. This signature is generated using a private key on the Android mobile device and attached to the data packet before data submission. The inspection data storage server verifies the signature using the corresponding public key to confirm that the data was indeed sent by a legitimate inspection device and has not been maliciously tampered with by a third party. Only after both data integrity verification and digital signature verification pass will the data storage management system on the inspection data storage server securely store the data in the database, providing reliable assurance for subsequent data analysis and applications.
[0057] Once data integrity verification and digital signature verification are both successful, and the data has been securely written to the database, the system will perform a cleanup operation on the original data. This step involves completely deleting the original inspection data and its encrypted compressed package from the temporary storage area of the Android mobile device and the inspection data storage server to prevent the leakage or improper retention of sensitive information.
[0058] After the deletion operation is completed, the connection between the Android device and the internal network server is securely disconnected, ensuring the communication link is closed and further protecting data security. Simultaneously, a complete log of the data submission, verification, and deletion process is recorded for subsequent auditing and tracking, ensuring the traceability and compliance of the entire data processing flow.
[0059] This concludes the security inspection process for Android devices in a network-free environment, preparing for the smooth execution of the next inspection task.
[0060] Furthermore, the Android mobile device of this invention has a built-in GPS module that collects and records all location information during the inspection process, including latitude and longitude, timestamps, etc. This data is encrypted and stored locally on the device to ensure information security. Simultaneously, these location points are used to generate an inspection route map, visually displaying the movement trajectory of the inspection personnel. Users can view a summary of the trajectory even without a network connection.
Claims
1. A method for Android mobile device security patrol under no network, characterized in that, The method comprises the following steps: S1, generating an inspection task compressed package on a data processing server; the inspection task compressed package is asymmetrically encrypted by using a Pretty Good Privacy library; S2, transmitting the inspection task compressed package to a mobile device through a USB connection between the mobile device and a data storage server; after the inspection task compressed package is transmitted to the mobile device, a temporary file on the data storage server is deleted; S3, decompressing and decrypting the inspection task compressed package, creating or opening a database by using a SQLite database operation interface, constructing a corresponding table structure, and writing the inspection task into the database of the mobile device; the inspection task compressed package is decompressed to a specified directory by using Apache CommonsCompress technology; when decompressing, a SHA-256 algorithm is used to generate a digest; the digest is compared with an expected check value provided by the inspection task compressed package; after decompression, the file size and attributes are checked; S4, obtaining inspection point information by scanning an inspection point two-dimensional code, and calling an inspection task sheet of the inspection point from the database; The inspection point two-dimensional code comprises a to-be-inspected equipment name, number, and location information of the inspection point; The to-be-inspected equipment name, number, and location are used to query the database to obtain the inspection task sheet of the inspection point; S5, recording inspection information according to the inspection task sheet, and then encrypting and saving the inspection information to a specified file; S6, repeating S4 and S5 until the inspection task is completed; S7, compressing the specified file, and then transmitting the specified file to the data storage server through the USB connection to decrypt and store the data.
2. The method of claim 1, wherein the method is characterized by: S1 specifically comprises creating a temporary file, writing serialized inspection task JSON data into the temporary file, encrypting and compressing the temporary file, and generating a digest by using a SHA-256 algorithm.
3. The method of claim 1, wherein the method is characterized by: In S3, the decompressed file is decrypted by using a Pretty Good Privacy, and a corresponding table structure is constructed by using a SQLite database; the decrypted data is written into the database according to a predetermined format.
4. The method of claim 1, wherein the method is characterized by: In S4, an RFID tag can also be used to obtain the inspection point information by scanning the RFID tag.
5. The method of claim 1, wherein the method is characterized by: In S5, pictures and videos in the inspection information are automatically added with a timestamp and an inspector watermark, and the to-be-inspected equipment name, number, location, and detection item of the inspection point are saved to a specified path.
6. The method of claim 1, wherein the method is based on a secure inspection of an Android mobile device without a network. S5 further comprises recording a digital signature of an inspector, a signature time, and a unique identifier of the mobile device.
7. The method of claim 1, wherein the method is based on a secure inspection of an Android mobile device without a network. A GPS module is built in the mobile device, and an inspection path map is generated during the inspection process.
Citation Information
Patent Citations
Polling system and polling method based on NFC (noise feedback coding) mobile terminal
CN103268645A
Universal patrol system and patrol method thereof
CN104751532A
Polling management system and method based on Internet of things
CN106056281A