CN116015940A - Log mobile phone, method and system for storing and uploading - Google Patents

Log mobile phone, method and system for storing and uploading Download PDF

Info

Publication number
CN116015940A
CN116015940A CN202211730549.7A CN202211730549A CN116015940A CN 116015940 A CN116015940 A CN 116015940A CN 202211730549 A CN202211730549 A CN 202211730549A CN 116015940 A CN116015940 A CN 116015940A
Authority
CN
China
Prior art keywords
log
encrypted
acquisition system
mobile phone
uploading
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
CN202211730549.7A
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.)
Shanghai Trustkernel Information Technology Co ltd
Original Assignee
Shanghai Trustkernel Information Technology 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 Shanghai Trustkernel Information Technology Co ltd filed Critical Shanghai Trustkernel Information Technology Co ltd
Priority to CN202211730549.7A priority Critical patent/CN116015940A/en
Publication of CN116015940A publication Critical patent/CN116015940A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method and a system for mobile phone, storage and uploading of logs, comprising the following steps: step S1: each end pre-processes the log to obtain a pre-processed log; step S2: encrypting the preprocessed log to obtain an encrypted log; step S3: uploading the encrypted log to a log acquisition system in real time, and decrypting the encrypted log by the log acquisition system to obtain a decrypted log.

Description

Log mobile phone, method and system for storing and uploading
Technical Field
The invention relates to the technical field of information processing, in particular to a method and a system for mobile phone, storage and uploading of logs.
Background
In the prior art, when logs of all end devices are needed, such as market problems or the situations that the logs are needed to carry out data statistics and the like. For example: when the log of the APP is needed, the user needs to manually click a button to trigger log uploading, and the user experience is unfriendly. When the log of the server is needed, an operation and maintenance person is needed to log in the cloud server to check the log. In addition, in the clear text transmission process of the log, any person can see the original text of the log, and some sensitive logs are easy to expose. For a third party, the log is obtained too depended on each end of the stored log, and the log cannot be obtained independently and completely.
Therefore, a log collection and uploading system independent of the device is needed, so that each end can independently and completely obtain the log of the test/on-line environment.
In the prior art, each end collects and stores the logs within a certain time range, and after each end collects the logs, the logs are stored locally in a file form, and because each end has limited magnetic disks, the logs can not be stored without limitation, and only the logs within the latest time range, such as a week, a month and the like, can be stored. When the log of the corresponding time is needed, the operation and maintenance personnel are connected with the equipment at each end to acquire the log. The prior art has the defects that: the time range is limited, and when the logs outside the time range are required to be analyzed and processed, the logs cannot be taken; meanwhile, if the equipment for storing the log is down, the log is not taken so fast.
In the prior art, each end collects and stores the logs within a certain time range, and periodically uploads the logs to a log acquisition system, and each end collects the logs and stores the logs locally in a file form, for example, a single log file has a size of 1M. And uploading the complete log file to a log acquisition system by each end at regular intervals. The prior art has the defects that: the log uploading process is clear, sensitive information is easy to expose, the log uploading process is easy to be hijacked and tampered by a third party, and the integrity cannot be ensured; in the log-forming process, if the file size has not reached 1M. Then it is not uploaded to the log collection system. If the equipment storing the log is down at this time, the log files which are not uploaded can be only triggered to be uploaded when the next file size reaches 1M. Timeliness cannot be guaranteed; meanwhile, the log forms a file, which needs to be removed at regular time, otherwise, the log occupies disk resources.
Patent document CN110932918A (application number: 201911368492.9) discloses a log data acquisition method, apparatus and storage medium, the method comprising: the method comprises the steps of receiving log data information corresponding to each service node sent by each service node, obtaining basic information of each service node and calling states of each service node through analyzing the log data information, obtaining running state information of each service node when the calling states are abnormal states, and storing the basic information and the running state information of each service node in a storage system as log information.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a method and a system for log mobile phone, storage and uploading.
The method for storing and uploading the log mobile phone provided by the invention comprises the following steps:
step S1: each end pre-processes the log to obtain a pre-processed log;
step S2: encrypting the preprocessed log to obtain an encrypted log;
step S3: uploading the encrypted log to a log acquisition system in real time, and decrypting the encrypted log by the log acquisition system to obtain a decrypted log.
Preferably, the step S1 employs: and each end compresses the cached log to obtain a compressed log.
Preferably, the step S2 employs:
step S2.1: each end generates an asymmetric key pair and sends a public key to a log acquisition system;
step S2.2: the log acquisition system generates a certificate and sends the generated certificate to each end;
step S2.3: each end generates a random symmetric key and encrypts the generated symmetric key by using a certificate of a log acquisition system;
step S2.4: each end log is encrypted by using a symmetric key and signed by using a private key generated by each end.
Preferably, each end generates log blocks for continuous logs, encrypts different log blocks by using encrypted symmetric keys, and uses different IV as offset vectors according to the serial numbers of the log blocks, so as to ensure different encryption modes for each log block.
Preferably, the step S3 employs: and the log acquisition system decrypts the encrypted log by utilizing the public key in the asymmetric key pair to obtain the decrypted log.
Preferably, the log acquisition system decrypts the encrypted log by using the public key in the asymmetric key pair, and then calculates the used IV offset vector according to the log block serial number to decrypt the decrypted log block.
The system for mobile phone, storage and uploading of the log provided by the invention comprises the following steps:
module M1: each end pre-processes the log to obtain a pre-processed log;
module M2: encrypting the preprocessed log to obtain an encrypted log;
module M3: uploading the encrypted log to a log acquisition system in real time, and decrypting the encrypted log by the log acquisition system to obtain a decrypted log.
Preferably, the module M2 employs:
module M2.1: each end generates an asymmetric key pair and sends a public key to a log acquisition system;
module M2.2: the log acquisition system generates a certificate and sends the generated certificate to each end;
module M2.3: each end generates a random symmetric key and encrypts the generated symmetric key by using a certificate of a log acquisition system;
module M2.4: each end log is encrypted by using a symmetric key and signed by using a private key generated by each end.
Preferably, the module M3 employs: and the log acquisition system decrypts the encrypted log by utilizing the public key in the asymmetric key pair to obtain the decrypted log.
Preferably, each end generates log blocks for continuous logs, encrypts different log blocks by using encrypted symmetric keys, and uses different IV as offset vectors according to the serial numbers of the log blocks, so as to ensure that the encryption modes of each log block are different;
the log acquisition system decrypts the encrypted log by utilizing the public key in the asymmetric key pair, and then calculates an IV offset vector used according to the serial number of the log block to decrypt the encrypted log block.
Compared with the prior art, the invention has the following beneficial effects:
1. the log is uploaded in real time, and the log file can be stored in a disk or can be uploaded in real time in a cache, so that uploading failure caused by service downtime or other reasons in the process of forming the file is avoided. The timeliness of uploading is guaranteed;
2. encryption and signature are carried out in the uploading process, so that privacy and integrity are guaranteed, and the situations of log loss, log replacement and the like are prevented;
3. each end is independently in butt joint with the acquisition system, so that the method is convenient and quick;
4. each end is independently in butt joint with the acquisition system, and privacy, safety and integrity are protected in the log uploading process.
Drawings
Other features, objects and advantages of the present invention will become more apparent upon reading of the detailed description of non-limiting embodiments, given with reference to the accompanying drawings in which:
fig. 1 is a flow chart of a method for log mobile phone, saving and uploading.
FIG. 2 is a schematic diagram of log blocks at each end.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the present invention, but are not intended to limit the invention in any way. It should be noted that variations and modifications could be made by those skilled in the art without departing from the inventive concept. These are all within the scope of the present invention.
In the existing scene, the device for storing the log needs to support file caching and batch uploading, and magnetic disk resources are very occupied. And privacy, security and integrity in log transmission cannot be guaranteed. The invention can meet the condition of access of each end; packaging and uploading the logs to a log acquisition system in a form of cache or file storage, standardizing log output, and compressing before transmission; meanwhile, encryption signature is carried out in the transmission process, so that privacy and safety are guaranteed.
Example 1
According to the method for log mobile phone, saving and uploading provided by the invention, as shown in fig. 1 to 2, the method comprises the following steps:
step S1: each end pre-processes the log to obtain a pre-processed log;
step S2: encrypting the preprocessed log to obtain an encrypted log;
step S3: uploading the encrypted log to a log acquisition system in real time, and decrypting the encrypted log by the log acquisition system to obtain a decrypted log.
Specifically, the logs are generated at each end, namely the logs can be stored at each end in a form of a buffer or a file and can be uploaded to a log acquisition system in real time, so that uploading failure caused by service downtime or other reasons in the process of forming the file is avoided. And the timeliness of uploading is ensured.
Specifically, the log acquisition system can directly encrypt and send the log to the log acquisition system through a network request by a device end for storing the log.
Specifically, the supporting each end access:
each end presets the certificate of the log acquisition system in advance and is used in a encrypting manner in the user log transmission process.
And generating an asymmetric key, reporting the public key to an acquisition system, and signing and using the public key in a log file.
The method meets the access of all ends of APP, cloud server and the like, can separate and control, and does not cross each other.
More specifically, each terminal generates a corresponding public and private key to be configured on the system, and the system needs to manage each terminal uniformly.
Specifically, log output is standardized, and the log is compressed and cached:
the collection log of each end needs to be continuously cached and then written into the file. In general, the logs are collected as much as possible, so that each end operation and maintenance personnel is required to clean the logs regularly, which would otherwise occupy the disk resources very much. And the general log contains a large amount of repeated text, so that the cached log needs to be compressed into a JSON character string, and the compressed format (space removal and line feed) is used, so that the size of the log is reduced to the maximum. A compression algorithm supporting streaming is used, supporting flush. The log is ensured to be generated and compressed. The logs are cached one by one while being compressed. Meanwhile, the logs are stored one by one, and are immediately updated to the cache.
Specifically, the upload process encrypts and signs:
in log transmission, the transmitted data is encrypted, if not encrypted, and intercepted by a third party, the log can be directly seen in a plaintext form, and if the log is designed to be confidential data of a company, the log is exposed. And the encrypted data is signed and uploaded, so that the situations of log loss, log replacement and the like are prevented.
More specifically, each end generates log blocks for consecutive logs, and encrypts log blocks in the same file using a consecutive encryption flow.
In the data processing process, a random symmetric key is generated first, and the key is encrypted by using a certificate of the log acquisition system, so that only the log acquisition system can decrypt the symmetric key. And signing the encrypted file header by using the asymmetric key of each end, so as to ensure the integrity of uploading the file header data. The log acquisition system can use public keys preset in advance by each end to carry out signature verification. The symmetric key can be safely, privately and completely acquired by the log acquisition system.
Symmetric key encryption is used for different log blocks and different IVs are used as offset vectors according to log block sequence numbers (e.g., sequentially +1 according to log block sequence numbers, etc.). The encryption mode of each log block is ensured to be different.
Because each log block is subjected to data encryption processing, the log blocks can be uploaded singly or integrally. The log acquisition system only needs to decrypt to obtain a symmetric key, and then calculates an IV offset vector used according to the serial number of the log block, so that the content of each log block can be decrypted.
The system for mobile phone, storage and uploading of the log provided by the invention comprises the following steps:
module M1: each end pre-processes the log to obtain a pre-processed log;
module M2: encrypting the preprocessed log to obtain an encrypted log;
module M3: uploading the encrypted log to a log acquisition system in real time, and decrypting the encrypted log by the log acquisition system to obtain a decrypted log.
Specifically, the logs are generated at each end, namely the logs can be stored at each end in a form of a buffer or a file and can be uploaded to a log acquisition system in real time, so that uploading failure caused by service downtime or other reasons in the process of forming the file is avoided. And the timeliness of uploading is ensured.
Specifically, the log acquisition system can directly encrypt and send the log to the log acquisition system through a network request by a device end for storing the log.
Specifically, the supporting each end access:
each end presets the certificate of the log acquisition system in advance and is used in a encrypting manner in the user log transmission process.
And generating an asymmetric key, reporting the public key to an acquisition system, and signing and using the public key in a log file.
The method meets the access of all ends of APP, cloud server and the like, can separate and control, and does not cross each other.
More specifically, each terminal generates a corresponding public and private key to be configured on the system, and the system needs to manage each terminal uniformly.
Specifically, log output is standardized, and the log is compressed and cached:
the collection log of each end needs to be continuously cached and then written into the file. In general, the logs are collected as much as possible, so that each end operation and maintenance personnel is required to clean the logs regularly, which would otherwise occupy the disk resources very much. And the general log contains a large amount of repeated text, so that the cached log needs to be compressed into a JSON character string, and the compressed format (space removal and line feed) is used, so that the size of the log is reduced to the maximum. A compression algorithm supporting streaming is used, supporting flush. The log is ensured to be generated and compressed. The logs are cached one by one while being compressed. Meanwhile, the logs are stored one by one, and are immediately updated to the cache.
Specifically, the upload process encrypts and signs:
in log transmission, the transmitted data is encrypted, if not encrypted, and intercepted by a third party, the log can be directly seen in a plaintext form, and if the log is designed to be confidential data of a company, the log is exposed. And the encrypted data is signed and uploaded, so that the situations of log loss, log replacement and the like are prevented.
More specifically, each end generates log blocks for consecutive logs, and encrypts log blocks in the same file using a consecutive encryption flow.
In the data processing process, a random symmetric key is generated first, and the key is encrypted by using a certificate of the log acquisition system, so that only the log acquisition system can decrypt the symmetric key. And signing the encrypted file header by using the asymmetric key of each end, so as to ensure the integrity of uploading the file header data. The log acquisition system can use public keys preset in advance by each end to carry out signature verification. The symmetric key can be safely, privately and completely acquired by the log acquisition system.
Symmetric key encryption is used for different log blocks and different IVs are used as offset vectors according to log block sequence numbers (e.g., sequentially +1 according to log block sequence numbers, etc.). The encryption mode of each log block is ensured to be different.
Because each log block is subjected to data encryption processing, the log blocks can be uploaded singly or integrally. The log acquisition system only needs to decrypt to obtain a symmetric key, and then calculates an IV offset vector used according to the serial number of the log block, so that the content of each log block can be decrypted.
Those skilled in the art will appreciate that the systems, apparatus, and their respective modules provided herein may be implemented entirely by logic programming of method steps such that the systems, apparatus, and their respective modules are implemented as logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc., in addition to the systems, apparatus, and their respective modules being implemented as pure computer readable program code. Therefore, the system, the apparatus, and the respective modules thereof provided by the present invention may be regarded as one hardware component, and the modules included therein for implementing various programs may also be regarded as structures within the hardware component; modules for implementing various functions may also be regarded as being either software programs for implementing the methods or structures within hardware components.
The foregoing describes specific embodiments of the present invention. It is to be understood that the invention is not limited to the particular embodiments described above, and that various changes or modifications may be made by those skilled in the art within the scope of the appended claims without affecting the spirit of the invention. The embodiments of the present application and features in the embodiments may be combined with each other arbitrarily without conflict.

Claims (10)

1. The method for storing and uploading the log mobile phone is characterized by comprising the following steps:
step S1: each end pre-processes the log to obtain a pre-processed log;
step S2: encrypting the preprocessed log to obtain an encrypted log;
step S3: uploading the encrypted log to a log acquisition system in real time, and decrypting the encrypted log by the log acquisition system to obtain a decrypted log.
2. The method for log mobile phone, save and upload according to claim 1, wherein the step S1 adopts: and each end compresses the cached log to obtain a compressed log.
3. The method for log mobile phone, save and upload according to claim 1, wherein the step S2 uses:
step S2.1: each end generates an asymmetric key pair and sends a public key to a log acquisition system;
step S2.2: the log acquisition system generates a certificate and sends the generated certificate to each end;
step S2.3: each end generates a random symmetric key and encrypts the generated symmetric key by using a certificate of a log acquisition system;
step S2.4: each end log is encrypted by using a symmetric key and signed by using a private key generated by each end.
4. The method for log mobile phone, save and upload according to claim 3, wherein each end generates log blocks for continuous logs, encrypts different log blocks by using encrypted symmetric keys, and uses different IV as offset vectors according to log block serial numbers, so as to ensure different encryption modes for each log block.
5. The method for log mobile phone, save and upload according to claim 1, wherein the step S3 uses: and the log acquisition system decrypts the encrypted log by utilizing the public key in the asymmetric key pair to obtain the decrypted log.
6. The method for mobile phone, storage and uploading of log according to claim 5, wherein the log collection system decrypts the encrypted log by using the public key in the asymmetric key pair, and then calculates the IV offset vector used according to the log block sequence number to decrypt the decrypted log block.
7. A system for mobile phone, storing and uploading logs, comprising:
module M1: each end pre-processes the log to obtain a pre-processed log;
module M2: encrypting the preprocessed log to obtain an encrypted log;
module M3: uploading the encrypted log to a log acquisition system in real time, and decrypting the encrypted log by the log acquisition system to obtain a decrypted log.
8. The system for log mobile phone, save and upload according to claim 7, wherein the module M2 adopts:
module M2.1: each end generates an asymmetric key pair and sends a public key to a log acquisition system;
module M2.2: the log acquisition system generates a certificate and sends the generated certificate to each end;
module M2.3: each end generates a random symmetric key and encrypts the generated symmetric key by using a certificate of a log acquisition system;
module M2.4: each end log is encrypted by using a symmetric key and signed by using a private key generated by each end.
9. The system for log mobile phone, save and upload according to claim 7, wherein the module M3 adopts: and the log acquisition system decrypts the encrypted log by utilizing the public key in the asymmetric key pair to obtain the decrypted log.
10. The system for mobile phone, storage and uploading of logs according to claim 9, wherein each end generates log blocks for continuous logs, encrypts different log blocks by using encrypted symmetric keys, and uses different IV as offset vectors according to serial numbers of log blocks to ensure different encryption modes for each log block;
the log acquisition system decrypts the encrypted log by utilizing the public key in the asymmetric key pair, and then calculates an IV offset vector used according to the serial number of the log block to decrypt the encrypted log block.
CN202211730549.7A 2022-12-30 2022-12-30 Log mobile phone, method and system for storing and uploading Pending CN116015940A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211730549.7A CN116015940A (en) 2022-12-30 2022-12-30 Log mobile phone, method and system for storing and uploading

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211730549.7A CN116015940A (en) 2022-12-30 2022-12-30 Log mobile phone, method and system for storing and uploading

Publications (1)

Publication Number Publication Date
CN116015940A true CN116015940A (en) 2023-04-25

Family

ID=86027912

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211730549.7A Pending CN116015940A (en) 2022-12-30 2022-12-30 Log mobile phone, method and system for storing and uploading

Country Status (1)

Country Link
CN (1) CN116015940A (en)

Similar Documents

Publication Publication Date Title
US10764261B2 (en) System and method for enabling a scalable public-key infrastructure on a smart grid network
US20180260583A1 (en) In-situ data verification for the cloud
CN111079162B (en) Data encryption method, data decryption method and data encryption system based on block chain
US20090204817A1 (en) Communication system
EP3299988B1 (en) Secure communication method and system
KR20120071556A (en) Image secure tansmission apparatus, image data reception apparatus, and key generation method therefor
EP2856695A1 (en) A method and system for transferring firmware or software to a plurality of devices
US20210192551A1 (en) Using hashed media identifiers to determine audience measurement data including demographic data from third party providers
CN112632007B (en) Log storage and extraction method, device, equipment and storage medium
CN103617402B (en) A kind of multimedia electronic data forensic report and generation, methods of exhibiting and system
CN104506500A (en) GOOSE message authentication method based on transformer substation
CN112749232A (en) Production data monitoring method and device, block chain node and storage medium
CN114500064B (en) Communication security verification method and device, storage medium and electronic equipment
CN111181920A (en) Encryption and decryption method and device
CN113300999A (en) Information processing method, electronic device, and readable storage medium
CN113472722A (en) Data transmission method, storage medium, electronic device and automatic ticket selling and checking system
CN108769036B (en) Data processing system and processing method based on cloud system
CN116015940A (en) Log mobile phone, method and system for storing and uploading
CN104284237A (en) Video transmission method and system
CN116150088A (en) Data processing method, device, server and computer storage medium
CN111506913B (en) Audio encryption method and device, storage medium and electronic device
CN112073520B (en) Data processing method and device and electronic equipment
KR101790757B1 (en) Cloud system for storing secure data and method thereof
CN111917722A (en) CDS data security encryption system
CN113346999A (en) Splitting encryption-based brain central system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination