CN-121985045-A - Data compression method, device, terminal equipment, server and storage medium
Abstract
The application discloses a data compression method, a data compression device, terminal equipment, a server and a storage medium, and belongs to the technical field of data compression. The method is applied to terminal equipment and comprises the steps of receiving an authorization certificate sent by a server, wherein the authorization certificate is used for indicating the terminal equipment to have the authority of signing a modified original compressed file, the original compressed file is a compressed file obtained by the terminal equipment after compressing data to be compressed, and under the condition of modifying the original compressed file, signing the modified original compressed file based on the authorization certificate to generate a target compressed file, and the target compressed file comprises signature information of signing the modified original compressed file by the terminal equipment. The method and the device directly sign the modified original compressed file at the local of the terminal equipment to generate the target compressed file, and the modified original compressed file is not required to be sent to the server, so that the server signs, and the local development autonomy of the terminal equipment is improved.
Inventors
- Guo Zilun
Assignees
- 成都欧珀通信科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20241031
Claims (20)
- 1. A data compression method, applied to a terminal device, the method comprising: Receiving an authorization certificate sent by a server, wherein the authorization certificate is used for indicating that the terminal equipment has the authority of signing the modified original compressed file, and the original compressed file is a compressed file obtained after the terminal equipment compresses data to be compressed; And under the condition of modifying the original compressed file, signing the modified original compressed file based on the authorization certificate to generate a target compressed file, wherein the target compressed file comprises signature information for signing the modified original compressed file by the terminal equipment.
- 2. The method of claim 1, wherein the authorization certificate comprises certificate information of a locally signed certificate of the terminal device, the certificate information comprising a certificate fingerprint and/or information of an application used to generate the original compressed file, the information of the application comprising a package name of the application and a fingerprint of the application.
- 3. The method of claim 1, wherein the modified original compressed file includes at least one region, the target compressed file includes the at least one region and a signature region, and the signature information is stored in the signature region.
- 4. A method according to claim 3, wherein the at least one area comprises a data area and a central directory area; the signature area is located between the data area and the central directory area.
- 5. The method of claim 1, wherein the signing the modified original compressed file based on the authorization credential generates a target compressed file, comprising: adding the signature information to the modified original compressed file; Determining the offset of target data after the signature information is added according to the data length corresponding to the signature information, wherein the target data is the data positioned behind the position of the signature information in the modified original compressed file; And correcting original position information according to the offset to generate the target compressed file, wherein the original position information is used for indicating the offset of the position of the target data in the modified original compressed file compared with the position of the target data in the original compressed file.
- 6. The method of claim 1, wherein the signature information comprises a hash signature of the modified total data volume of the original compressed file.
- 7. The method of claim 6, wherein the signature information further comprises a local signature certificate of the terminal device.
- 8. The method of claim 1, wherein the original compressed file further includes the authorization credential therein, and wherein prior to the generating the target compressed file further includes: And packaging the data to be compressed and the authorization certificate, and compressing the packaged data to be compressed to generate the original compressed file.
- 9. The method of any one of claims 1 to 8, wherein after the generating the target compressed file, the method further comprises: And sending the target compressed file to the server so that the server verifies the signature information in the target compressed file.
- 10. The method according to any one of claims 2 to 8, wherein prior to receiving the authorization credential sent by the server, the method further comprises: Generating a local signature certificate according to the local root certificate; And sending the certificate information of the local signature certificate to the server so that the server generates the authorization certificate according to the certificate information of the local signature certificate.
- 11. A method of data compression, applied to a server, the method comprising: Transmitting an authorization certificate, wherein the authorization certificate is used for indicating that the terminal equipment has the authority of signing the modified original compressed file, and the original compressed file is a compressed file obtained after the terminal equipment compresses data to be compressed; Receiving a target compressed file sent by the terminal equipment, wherein the target compressed file is generated by the terminal equipment by signing the modified original compressed file based on the authorization certificate under the condition of modifying the original compressed file, and the target compressed file comprises signature information of signing the modified original compressed file by the terminal equipment.
- 12. The method of claim 11, wherein the authorization certificate comprises certificate information of a locally signed certificate of the terminal device, the certificate information comprising a certificate fingerprint and/or information of an application used to generate the original compressed file, the information of the application comprising a package name of the application and a fingerprint of the application.
- 13. The method of claim 11, wherein the signature information comprises a hash signature of the modified total data volume of the original compressed file, or The signature information comprises a modified hash signature of the total data volume of the original compressed file and a local signature certificate of the terminal equipment.
- 14. The method of claim 12, further comprising, prior to said sending the authorization credential: Receiving certificate information of a local signature certificate sent by terminal equipment, wherein the local signature certificate is generated by the terminal equipment according to a local root certificate of the terminal equipment; and generating the authorization certificate according to the certificate information of the local signature certificate and the server root certificate.
- 15. The method of claim 11, wherein the method further comprises: and verifying the signature information in the target compressed file.
- 16. The method of claim 15, wherein the original compressed file further includes the authorization credential therein, the method further comprising, prior to the verifying the signature information in the target compressed file: acquiring the authorization certificate in the target compressed file; and verifying the authorization certificate in the original compressed file according to the server root certificate.
- 17. The method of claim 15, wherein the signature information comprises a hash signature of the modified total data volume of the original compressed file, and wherein verifying the signature information in the target compressed file comprises: And verifying the hash signature of the total data volume of the original compressed file after modification according to the server root certificate.
- 18. The method of claim 15, wherein the signature information includes a hash signature of the modified total data amount of the original compressed file and a local signature certificate of the terminal device; the verifying the signature information in the target compressed file comprises the following steps: Verifying the local signature certificate according to the authorization certificate; And under the condition that the local signature certificate passes verification, verifying the hash signature of the modified total data volume of the original compressed file according to the local signature certificate.
- 19. The method of any one of claims 11 to 18, further comprising, after said validating said target compressed file: and returning a verification result to the terminal equipment, wherein the verification result is used for indicating whether the target compressed file is legal or illegal.
- 20. A data compression apparatus for use in a terminal device, the apparatus comprising: The terminal equipment comprises a first receiving module, a first receiving module and a second receiving module, wherein the first receiving module is used for receiving an authorization certificate sent by a server, and the authorization certificate is used for indicating that the terminal equipment has the authority of signing a modified original compressed file; The first generation module is used for signing the modified original compressed file based on the authorization certificate under the condition of modifying the original compressed file, and generating a target compressed file, wherein the target compressed file comprises signature information for signing the modified original compressed file by the terminal equipment.
Description
Data compression method, device, terminal equipment, server and storage medium Technical Field The present application relates to the field of data compression technologies, and in particular, to a data compression method, a data compression device, a terminal device, a server, and a storage medium. Background With the development of science and technology, the scene that users use terminal equipment to transmit data is very common, and when data transmission is performed, data needs to be compressed, so that the data transmission efficiency is improved. Currently, in terms of data compression, a user directly compresses data to be transmitted according to a format specified by a compression application program, and transmits a compressed file. However, in the terminal device that needs to develop software, it is often necessary to modify the content of the compressed file, and send the modified compressed file to the server of the compression application to perform signature authentication, so as to recognize the validity of the modification. In the mode, if the user modifies a plurality of compressed files, the compressed files are required to be sent to the server for signature authentication, and the server is required to perform signature authentication every time in the whole process, so that the process is complicated, the data volume transmitted between the terminal equipment and the server is increased, and the problem of low development autonomy of the local terminal equipment exists. Disclosure of Invention In order to solve the problems of the related art, simplify the signature authentication process when the compressed file is modified in the local development process of the terminal equipment, and improve the local development autonomy of the terminal equipment, the embodiment of the application provides a data compression method, a device, the terminal equipment, a server and a storage medium. The technical scheme is as follows: in one aspect, the present application provides a data compression method, applied to a terminal device, the method comprising: Receiving an authorization certificate sent by a server, wherein the authorization certificate is used for indicating that the terminal equipment has the authority of signing the modified original compressed file; And under the condition of modifying the original compressed file, signing the modified original compressed file based on the authorization certificate to generate a target compressed file, wherein the target compressed file comprises signature information for signing the modified original compressed file by the terminal equipment. In another aspect, the present application provides a data compression method, applied to a server, the method comprising: Transmitting an authorization certificate, wherein the authorization certificate is used for indicating that the terminal equipment has the authority of signing the modified original compressed file, and the original compressed file is a compressed file obtained after the terminal equipment compresses data to be compressed; Receiving a target compressed file sent by the terminal equipment, wherein the target compressed file is generated by the terminal equipment by signing the modified original compressed file based on the authorization certificate under the condition of modifying the original compressed file, and the target compressed file comprises signature information of signing the modified original compressed file by the terminal equipment. In one aspect, the present application provides a data compression apparatus, applied to a terminal device, the apparatus comprising: The terminal equipment comprises a first receiving module, a first receiving module and a second receiving module, wherein the first receiving module is used for receiving an authorization certificate sent by a server, and the authorization certificate is used for indicating that the terminal equipment has the authority of signing a modified original compressed file; The first generation module is used for signing the modified original compressed file based on the authorization certificate under the condition of modifying the original compressed file, and generating a target compressed file, wherein the target compressed file comprises signature information for signing the modified original compressed file by the terminal equipment. In another aspect, the present application provides a data compression apparatus for use with a server, the apparatus comprising: The first sending module is used for sending an authorization certificate, wherein the authorization certificate is used for indicating that the terminal equipment has the authority of signing the modified original compressed file, and the original compressed file is a compressed file obtained after the terminal equipment compresses data to be compressed; The second receiving module is configured to receive a target compressed file sent by the terminal d