Document previewing method and device

By negotiating the generation of keys and encrypting documents on the mobile terminal, security and performance issues when previewing encrypted documents are solved, and a safe and efficient document preview is achieved.

CN119885237APending Publication Date: 2025-04-25HANGZHOU AKEY ME CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411973867.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

When previewing encrypted documents on mobile terminals, the prior art can easily lead to document content leakage, data security cannot be guaranteed, and third-party applications need to be downloaded, resulting in traffic and time consumption.

Method used

By negotiating the generation of the first key and the second key between the first terminal and the second terminal, the document to be previewed is encrypted using the second key and sent to the server. After waiting for the second terminal to decrypt, the document is directly previewed using the target operating system, without downloading a third-party application.

Benefits of technology

It effectively prevents the content of the document to be previewed, ensures the security of the document, avoids traffic and time consumption caused by downloading third-party applications, and improves the processor running speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119885237A_ABST
    Figure CN119885237A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of document previewing, and discloses a document previewing method and device.A first terminal and a second terminal which share a document negotiate a first secret key to encrypt a second secret key, then a to-be-previewed document is encrypted through the second secret key, and the first terminal sends the second secret key and the encrypted to-be-previewed document to a server; after the second terminal decrypts the to-be-previewed document through the second secret key, the shared document (the to-be-previewed document) of the first terminal is previewed directly through the target operating system of the second terminal, it is not needed to download a third-party application to preview document content, the content of the to-be-previewed document is prevented from being leaked, the safety of the to-be-previewed document is guaranteed, and the user experience is improved. And moreover, the problem of flow and time consumption caused by downloading the third-party application is avoided, and finally, the running speed of the processor is also improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of document preview, and in particular to a document preview method and device. Background Art

[0002] Document preview is a function for viewing document content on a mobile terminal. In the application scenario of mobile terminals in the related art, encrypted documents usually need to be decrypted first, and then previewed with the help of a third-party application or by integrating a software development kit (SDK) provided by a third party. However, this preview method is prone to leakage of encrypted document content and cannot guarantee data security. In addition, it is necessary to guide users to download third-party applications, which consumes traffic and time. Summary of the invention

[0003] In view of this, the present invention provides a document preview method and device to solve the problem that the encrypted document content is easily leaked due to downloading third-party applications, data security cannot be guaranteed, and traffic and time consumption are caused.

[0004] In a first aspect, an embodiment of the present disclosure provides a document preview method, the method comprising:

[0005] In response to the first terminal and the second terminal successfully establishing a communication connection through the server, the first terminal generates a first key and a second key, wherein the second key is used to encrypt the document to be previewed, the first key is used to encrypt the second key, the first key is generated based on a target identifier and a target salt value, the target salt value is a common salt value of the first terminal and the second terminal, the target identifier is a common identifier of the first terminal and the second terminal, and the second key is generated based on the target identifier and the document to be previewed;

[0006] The first terminal sends the second key and the encrypted document to be previewed to the server, and waits for the second terminal to decrypt the document to be previewed using the second key and then preview the document to be previewed using the target operating system.

[0007] In the disclosed embodiment, a first terminal and a second terminal that share a document negotiate in advance to encrypt a second key with a first key, and then encrypt the document to be previewed with the second key. The first terminal then sends the second key and the encrypted document to be previewed to the server, and after waiting for the second terminal to decrypt the document to be previewed with the second key, directly uses its own target operating system to preview the shared document (document to be previewed) of the first terminal, without downloading a third-party application to preview the document content, thereby preventing the content of the document to be previewed from being leaked, thereby not only ensuring the security of the document to be previewed, but also avoiding the problems of traffic and time consumption caused by downloading third-party applications, and ultimately improving the processor running speed.

[0008] In some optional implementations, the first terminal sends the second key and the encrypted document to be previewed to the server, and waits for the second terminal to decrypt the document to be previewed using the second key and then preview the document to be previewed using the target operating system, including:

[0009] The first terminal sends the second key and the encrypted document to be previewed to the server, so that the server stores the document to be previewed and generates a document identifier corresponding to the document to be previewed;

[0010] The first terminal shares the document identifier with the second terminal through the server, so that the second terminal downloads the encrypted document to be previewed from the server, and the second terminal uses the second key to decrypt the document to be previewed and then uses the target operating system to preview the document to be previewed.

[0011] The disclosed embodiment shares the document identifier with the second terminal through the server, which is beneficial for the second terminal to quickly access the document to be previewed stored in the server, and use the second key to decrypt the document to be previewed and then use the target operating system to directly and quickly preview the document to be previewed, thereby avoiding the situation where the security of the document to be previewed cannot be guaranteed due to the use of a third-party application to preview the document to be previewed.

[0012] In some optional implementations, the first terminal successfully establishes a connection with the second terminal through the server, including:

[0013] The first terminal sends a first request instruction to the server, where the first request instruction is used to request the first terminal to establish a communication connection with the second terminal;

[0014] The first terminal receives a first response instruction sent by the server, where the first response instruction is used to respond to the first terminal establishing a communication connection with the second terminal;

[0015] The first terminal successfully establishes a communication connection between the first terminal and the second terminal based on the communication response instruction.

[0016] The disclosed embodiments are conducive to successfully establishing a communication connection.

[0017] In some optional implementations, the document preview method in the embodiment of the present disclosure further includes:

[0018] The first terminal stores the second key in an encrypted database within the sandbox.

[0019] The disclosed embodiment stores the second key in a sandbox to ensure the security of the second key and prevent the second key from being lost.

[0020] In a second aspect, an embodiment of the present disclosure provides a document preview method, the method comprising:

[0021] In response to the second terminal successfully establishing a communication connection with the first terminal through the server, the second terminal obtains the second key generated by the first terminal and the encrypted document to be previewed from the server;

[0022] The second terminal generates a first key and a second key, the first key is generated based on the target identifier and the target salt value, wherein the second key is used to decrypt the document to be previewed, the first key is used to decrypt the second key, the first key is generated based on the target identifier and the target salt value, the target salt value is a common salt value of the first terminal and the second terminal, the target identifier is a common identifier of the first terminal and the second terminal, and the second key is generated based on the target identifier and the document to be previewed;

[0023] The second terminal decrypts the second key using the first key;

[0024] The second terminal decrypts the document to be previewed using the second key to obtain the document to be previewed;

[0025] The second terminal previews the document to be previewed using the target operating system.

[0026] The disclosed embodiment negotiates a first key in advance with a first terminal and a second terminal that share a document with each other, and then decrypts the second key using the first key. After the second terminal decrypts the second key using the shared key (first key), it directly uses its own target operating system to preview the shared document (document to be previewed) of the first terminal without downloading a third-party application to preview the document content, thereby preventing the content of the document to be previewed from being leaked, thereby not only ensuring the security of the document to be previewed, but also avoiding the problems of traffic and time consumption caused by downloading third-party applications, and ultimately improving the processor running speed.

[0027] In some optional implementations, the second terminal previews the document to be previewed using the target operating system, including:

[0028] The second terminal obtains the document identifier shared by the first terminal through the server;

[0029] The second terminal downloads the encrypted document to be previewed from the server based on the document identifier;

[0030] The second terminal decrypts the document to be previewed using the second key.

[0031] Through the above-mentioned implementation manner, the disclosed embodiment is conducive to the second terminal quickly accessing the document to be previewed stored in the server, and directly and quickly previewing the document to be previewed using the target operating system after decrypting the document to be previewed using the second key, thereby avoiding the situation where the security of the document to be previewed cannot be guaranteed due to the use of a third-party application to preview the document to be previewed.

[0032] In some optional implementations, the target operating system includes an Android operating system, and the second terminal previews the document to be previewed using the target operating system, including:

[0033] The second terminal uses the container of the Android operating system to create a target executable file;

[0034] The second terminal obtains the current document format of the document to be previewed;

[0035] The second terminal uses the target execution file to obtain a target parsing plug-in corresponding to the current document format;

[0036] The second terminal parses the document to be previewed using the target parsing plug-in, and renders the document content of the document to be previewed in the container;

[0037] The second terminal previews the document content of the document to be previewed, wherein the second terminal supports editing the document to be previewed and converting the document to be previewed into a picture format for preview during the process of previewing the document content of the document to be previewed.

[0038] The disclosed embodiment, based on the establishment of a communication connection between the first terminal and the second terminal, directly uses its own target operating system to preview the shared document (document to be previewed) of the first terminal in advance, without downloading a third-party application to preview the document content, thereby preventing the content of the document to be previewed from being leaked, thereby not only ensuring the security of the document to be previewed, but also avoiding the problems of traffic and time consumption caused by downloading third-party applications, and ultimately improving the processor running speed. At the same time, since the second terminal supports editing and converting the document to be previewed during the preview of the document content of the document to be previewed, it avoids the problems of traffic and time consumption caused by downloading third-party applications, and ultimately improves the processor running speed, and at the same time supports editing the document to be previewed and supporting converting the document to be previewed into a picture format, which brings great convenience to users.

[0039] In some optional implementations, during the process of previewing the document to be previewed by the target operating system, the second terminal deletes the document to be previewed in response to successfully receiving a document closing instruction.

[0040] By executing the above-mentioned implementation methods, the disclosed embodiment is conducive to timely and thorough clearing of cached data in the memory, eliminating any possible data residue, and comprehensively ensuring the confidentiality of the document content.

[0041] In a third aspect, an embodiment of the present disclosure provides a document preview system, including: a first terminal, a second terminal and a server, wherein after the first terminal successfully establishes a communication connection with the second terminal through the server, the first terminal generates a first key and a second key, wherein the second key is used to encrypt the document to be previewed, the first key is used to encrypt the second key, the first key is generated based on a target identifier and a target salt value, the target salt value is a common salt value of the first terminal and the second terminal, the target identifier is a common identifier of the first terminal and the second terminal, and the second key is generated based on the target identifier and the document to be previewed; after the first terminal sends the second key and the encrypted document to be previewed to the server, the second terminal generates the first key and the second key, decrypts the document to be previewed using the second key, and then previews the document to be previewed using the target operating system.

[0042] In a fourth aspect, an embodiment of the present disclosure provides a document preview device, the device comprising:

[0043] A first key generation module, configured to generate a first key and a second key by the first terminal in response to the first terminal successfully establishing a communication connection with the second terminal through the server, wherein the second key is used to encrypt the document to be previewed, the first key is used to encrypt the second key, the first key is generated based on a target identifier and a target salt value, the target salt value is a common salt value of the first terminal and the second terminal, the target identifier is a common identifier of the first terminal and the second terminal, and the second key is generated based on the target identifier and the document to be previewed;

[0044] The encrypted document sending module is used for the first terminal to send the second key and the encrypted document to be previewed to the server, and wait for the second terminal to decrypt the document to be previewed using the second key and then preview the document to be previewed using the target operating system.

[0045] In a fifth aspect, an embodiment of the present disclosure provides a computer device, including:

[0046] The memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the document preview method of the first aspect or any corresponding implementation method thereof by executing the computer instructions.

[0047] In a sixth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to enable a computer to execute the document preview method of the first aspect or any corresponding implementation manner thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0049] Figure 1 is a schematic diagram of the structure of a document preview system according to an embodiment of the present invention;

[0050] Figure 2 is a flowchart of a document preview method according to an embodiment of the present invention;

[0051] Figure 3 is a flowchart of another document preview method according to an embodiment of the present invention;

[0052] Figure 4 is a structural block diagram of a document preview device according to an embodiment of the present invention;

[0053] Figure 5 4 is a hardware structure block diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0055] According to an embodiment of the present invention, a document preview method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0056] A document preview method is provided in the disclosed embodiment. The document in the disclosed embodiment may be a WORD document, a PDF document, an EXCEL document, a PPT document, or other types of documents. The document preview method in the disclosed embodiment may be applied to the first terminal 11, and may also be applied to the second terminal 12. Figure 1 FIG. 1 is a schematic diagram of the structure of the document preview system in the embodiment of the present disclosure. Figure 1In the system, the first terminal 11, the second terminal 12 and the server 13 are connected to each other through the server 13. That is, the first terminal 11 and the server 13 are connected through a wireless transmission network, and the second terminal 12 and the server 13 are also connected through a wireless transmission network. The first terminal 11 is used to encrypt the document to be previewed, transmit it to the server 13 for storage, and wait for the second terminal 12 to decrypt the document to be previewed and preview it normally. For details, please refer to the document preview method on the first terminal 11 side and the document recognition method on the second terminal 12 side in the following embodiments. Figure 1 In the embodiment, the first terminal 11 and the second terminal 12 can both be mobile terminals or tablet computers. It can be understood that the document preview system in the embodiment of the present disclosure can be applied in application scenarios of teaching, lecturing or training using the document to be previewed.

[0057] The document preview system in the embodiment of the present disclosure, Figure 1 The method comprises: a first terminal 11, a second terminal 12 and a server 13, wherein after the first terminal 11 successfully establishes a communication connection with the second terminal 12 through the server 13, the first terminal 11 generates a first key and a second key, wherein the second key is used to encrypt the document to be previewed, the first key is used to encrypt the second key, the first key is generated based on a target identifier and a target salt value, the target salt value is a common salt value of the first terminal 11 and the second terminal 12, the target identifier is a common identifier of the first terminal 11 and the second terminal 12, the second key is generated based on the target identifier and the document to be previewed, and after the first terminal 11 sends the second key and the encrypted document to be previewed to the server 13, the second terminal 12 generates the first key and the second key, decrypts the document to be previewed using the second key, and then previews the document to be previewed using the target operating system.

[0058] In a specific example, the document preview system in the embodiment of the present disclosure may further include a management device, which is used to manage the system (such as managing the connection status between the first terminal or the second terminal and the server, etc.). Optionally, the communication network is a wired network or a wireless network.

[0059] Optionally, the above-mentioned wireless network or wired network uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any other network, including but not limited to any combination of local area network, metropolitan area network, wide area network, mobile, limited or wireless network, private network or virtual private network. In some embodiments, the technology and / or format including hypertext markup language, extensible markup language, etc. are used to represent the data exchanged through the network. In addition, conventional encryption technologies such as secure socket layer, transport layer security, virtual private network, Internet protocol security, etc. can also be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technology can also be used to replace or supplement the above-mentioned data communication technology.

[0060] In this embodiment, a document preview method is provided, which can be used in mobile terminals, such as mobile phones, tablet computers, etc. Figure 2 is a flowchart of a document preview method according to an embodiment of the present invention, which is mainly used in the first terminal in the embodiment, such as Figure 2 As shown, the process of the first terminal includes the following steps:

[0061] Step S201, in response to the first terminal and the second terminal successfully establishing a communication connection through the server, the first terminal generates a first key and a second key, wherein the second key is used to encrypt the document to be previewed, the first key is used to encrypt the second key, the first key is generated based on a target identifier and a target salt value, the target salt value is a common salt value of the first terminal and the second terminal, the target identifier is a common identifier of the first terminal and the second terminal, and the second key is generated based on the target identifier and the document to be previewed.

[0062] Specifically, the first terminal and the second terminal are two different terminals. For example, a first client of the first terminal wants to share document information with a client of the second terminal, while also ensuring the security of the shared document. Therefore, the first terminal and the second terminal need to secretly negotiate encryption information of the shared document through a server as a communication bridge. The first terminal can be represented by A, and the second terminal can be represented by B.

[0063] In some optional implementations, the above step S201, in which the first terminal successfully establishes a connection with the second terminal through the server, includes:

[0064] In step a1, the first terminal sends a first request instruction to the server, where the first request instruction is used to request the first terminal to establish a communication connection with the second terminal.

[0065] Step a2: the first terminal receives a first response instruction sent by the server, where the first response instruction is used to respond to the first terminal establishing a communication connection with the second terminal.

[0066] Step a3: The first terminal successfully establishes a communication connection between the first terminal and the second terminal based on the communication response instruction.

[0067] Specifically, here the first terminal sends a request to the server, wanting to establish a communication relationship with the second terminal to achieve the purpose of sharing documents.

[0068] Furthermore, the target identifier is a common identifier of the first terminal and the second terminal, that is, the common identifier is a unique identifier information known to each other by the first terminal and the second terminal, and the target salt value is also the salt value information shared by the first terminal and the second terminal, and the salt value information can be some randomly generated characters, letters or numbers. Therefore, the first terminal and the second terminal know each other the first key (key1) generated by the target identifier and the target salt value, and the first key (key1) is equivalent to the common key formed by the secret negotiation between the first terminal and the second terminal, and the server is unaware. The document to be previewed is encrypted by the negotiated first key (key1) to ensure the security of the document to be previewed during the data transmission process. The second key (key2) is generated based on the target identifier and the document to be previewed. For example, the second key (key2) is generated by the common identifier of the first terminal and the message digest information (md5 information) of the entire content of the document, combined with a symmetric encryption algorithm or an elliptic curve algorithm. The security of the document to be previewed is ensured by the second key (key2).

[0069] Step S202: The first terminal sends the second key and the encrypted document to be previewed to the server, and waits for the second terminal to decrypt the document to be previewed using the second key and then preview the document to be previewed using the target operating system.

[0070] When previewing documents through third-party applications or integrating software development kits (SDKs) provided by third parties, the encrypted document content may be easily leaked and data security cannot be guaranteed. In addition, downloading third-party applications will lead to traffic and time consumption.

[0071] Therefore, the embodiment of the present disclosure negotiates in advance between the first terminal and the second terminal that share the document with each other to encrypt the second key with the first key, and then encrypts the document to be previewed with the second key. The first terminal then sends the second key and the encrypted document to be previewed to the server, and after waiting for the second terminal to decrypt the document to be previewed with the second key, directly uses its own target operating system to preview the shared document (document to be previewed) of the first terminal, without downloading a third-party application to preview the document content, thereby preventing the content of the document to be previewed from being leaked, thereby not only ensuring the security of the document to be previewed, but also avoiding the problems of traffic and time consumption caused by downloading third-party applications, and ultimately improving the processor running speed.

[0072] In some optional implementations, during the process of previewing the document to be previewed by the second terminal through the target operating system, the document to be previewed is supported to be edited and converted into a picture format for preview.

[0073] Specifically, the target operating system of the embodiment of the present disclosure may give priority to the Android operating system. When the second terminal is configured with the Android operating system, the second terminal may be considered to be an Android terminal.

[0074] Furthermore, after the second terminal decrypts the document to be previewed by adapting the Android operating system, it can directly preview the document to be previewed without downloading a third-party application, and the Android operating system can also support the second terminal to edit the document to be previewed and support previewing the document to be previewed in picture format, thereby enhancing the convenience of previewing the document to be previewed. At the same time, because it supports converting the document content into picture format, it not only improves the processor running speed, but also ensures the picture resolution.

[0075] Of course, in other optional implementations, the target operating system may be a Windows operating system, a MacOS operating system, or a Linux operating system.

[0076] In some optional implementations, the above step S202, in which the first terminal sends the second key and the encrypted document to be previewed to the server, and waits for the second terminal to decrypt the document to be previewed using the second key and then preview the document to be previewed using the target operating system, includes:

[0077] Step b1: The first terminal sends the second key and the encrypted document to be previewed to the server, so that the server stores the document to be previewed and generates a document identifier corresponding to the document to be previewed.

[0078] Specifically, the server stores the document to be previewed and generates a corresponding document identifier (filed), so as to back up the document to be previewed on the one hand, and facilitate the second terminal to quickly search for the corresponding document to be previewed on the other hand.

[0079] Step b2, the first terminal shares the document identifier with the second terminal through the server, so that the second terminal downloads the encrypted document to be previewed from the server, and the second terminal uses the second key to decrypt the document to be previewed and then uses the target operating system to preview the document to be previewed.

[0080] Specifically, the first terminal shares the document identifier (filed) with the second terminal through the server, which is beneficial for the second terminal to quickly access the document to be previewed stored in the server, and use the second key to decrypt the document to be previewed and then use the target operating system to directly and quickly preview the document to be previewed, avoiding the situation where the security of the document to be previewed cannot be guaranteed due to the use of a third-party application to preview the document to be previewed.

[0081] In some optional implementations, the document preview method in the embodiment of the present disclosure further includes: the first terminal storing the second key in an encrypted database in the sandbox.

[0082] Specifically, the sandbox is the sandbox of the first terminal itself, and the first terminal stores the second key in an encrypted database in the first sandbox to ensure the security of the second key and prevent the second key from being lost.

[0083] In this embodiment, a document preview method is provided, which can be used in the above-mentioned mobile terminals, such as mobile phones, tablet computers, etc. Figure 3 is a flowchart of a document preview method according to an embodiment of the present invention. Figure 3 As shown, the embodiment here is mainly used for the second terminal, and the process of the second terminal includes the following steps:

[0084] Step S301: In response to the second terminal successfully establishing a communication connection with the first terminal through the server, the second terminal obtains the second key generated by the first terminal and the encrypted document to be previewed from the server.

[0085] Specifically, the first terminal and the second terminal are two different terminals. For example, the second client of the second terminal wants to obtain the shared document information from the client of the first terminal, while ensuring the security of the shared document. Therefore, the first terminal and the second terminal need to use the server as a communication bridge to secretly negotiate the encryption information of the shared document. The first terminal can be represented by A, and the second terminal can be represented by B.

[0086] In some optional implementations, the above step S201, in which the second terminal successfully establishes a connection with the first terminal through the server, includes:

[0087] Step c1: The second terminal sends a second request instruction to the server, where the second request instruction is used to request the second terminal to establish a communication connection with the first terminal.

[0088] Step c2: the second terminal receives a second response instruction sent by the server, where the second response instruction is used to respond to the second terminal establishing a communication connection with the first terminal.

[0089] Step c3: The second terminal successfully establishes a communication connection with the first terminal based on the communication response instruction.

[0090] Specifically, the manner in which the second terminal establishes a communication connection with the first terminal is the same as the above manner, which will not be described in detail herein.

[0091] Step S302, the second terminal generates a first key and a second key, the first key is generated based on a target identifier and a target salt value, wherein the second key is used to decrypt the document to be previewed, the first key is used to decrypt the second key, the first key is generated based on the target identifier and the target salt value, the target salt value is a common salt value of the first terminal and the second terminal, the target identifier is a common identifier of the first terminal and the second terminal, and the second key is generated based on the target identifier and the document to be previewed.

[0092] Specifically, the target identifier is a common identifier of the first terminal and the second terminal, that is, the common identifier is a unique identifier information known to each other by the first terminal and the second terminal, and the target salt value is also the salt value information shared by the first terminal and the second terminal, and the salt value information can be some randomly generated characters, letters or numbers. Therefore, the first terminal and the second terminal know each other the first key (key1) generated by the target identifier and the target salt value, and the first key (key1) is equivalent to the common key formed by the secret negotiation between the first terminal and the second terminal, and the server is not aware of it. The second key (key) is encrypted by the negotiated first key (key) to ensure the security of the second key during data transmission. The second key (key2) is generated based on the target identifier and the document to be previewed. For example, the second key (key2) is generated by the common identifier of the first terminal and the message digest information (md5 information) of the entire content of the document, combined with a symmetric encryption algorithm or an elliptic curve algorithm. The security of the document to be previewed is ensured by the second key (key2).

[0093] Step S303: The second terminal decrypts the second key using the first key.

[0094] Step S304: The second terminal decrypts the document to be previewed using the second key to obtain the document to be previewed.

[0095] Specifically, since the first key is a common key negotiated between the first terminal and the second terminal, the second terminal can safely decrypt the second key using the common key, and the server cannot learn the first key, thereby preventing the second key from being leaked.

[0096] Step S305: The second terminal previews the document to be previewed using the target operating system.

[0097] When previewing documents through third-party applications or integrating software development kits (SDKs) provided by third parties, the encrypted document content may be easily leaked and data security cannot be guaranteed. In addition, downloading third-party applications will lead to traffic and time consumption.

[0098] Therefore, the embodiment of the present disclosure negotiates a first key in advance through the first terminal and the second terminal that share the document with each other, and then decrypts the second key by using the first key. After the second terminal decrypts the second key by using the common key (the first key), it directly uses its own target operating system to preview the shared document (the document to be previewed) of the first terminal, without downloading a third-party application to preview the document content, thereby preventing the content of the document to be previewed from being leaked, thereby not only ensuring the security of the document to be previewed, but also avoiding the problems of traffic and time consumption caused by downloading third-party applications, and ultimately improving the processor running speed.

[0099] In some optional implementations, the second terminal previews the document to be previewed using the target operating system, including:

[0100] Step d1: The second terminal obtains the document identifier shared by the first terminal through the server.

[0101] Specifically, the server stores the document to be previewed and generates a corresponding document identifier (filed), so as to back up the document to be previewed on the one hand, and facilitate the second terminal to quickly search for the corresponding document to be previewed on the other hand.

[0102] Step d2: the second terminal downloads the encrypted document to be previewed from the server based on the document identifier.

[0103] Step d3: The second terminal decrypts the document to be previewed using the second key.

[0104] Specifically, the second terminal obtains the document identifier (filed) shared by the first terminal through the server, which is conducive to the second terminal quickly accessing the document to be previewed stored in the server, and decrypting the document to be previewed using the second key and then directly and quickly previewing the document to be previewed using the target operating system, avoiding the situation where the security of the document to be previewed cannot be guaranteed due to the use of a third-party application to preview the document to be previewed.

[0105] In some optional implementations, the target operating system includes an Android operating system, and the second terminal previews the document to be previewed using the target operating system, including:

[0106] In step e1, the second terminal uses the container of the Android operating system to create a target executable file.

[0107] Specifically, for example, when the user of the second terminal initiates opening of the document to be previewed, the second terminal uses the container (WebView) of the Android operating system to create a target execution file (HTML file), and the execution code is loaded in the target execution file.

[0108] Step e2: the second terminal obtains the current document format of the document to be previewed.

[0109] Step e3: The second terminal uses the target execution file to obtain a target parsing plug-in corresponding to the current document format.

[0110] Specifically, the second terminal uses the target execution file (HTML file) to obtain the target parsing plug-in (JS parsing plug-in) corresponding to the current document format.

[0111] In step e4, the second terminal uses the target parsing plug-in to parse the document to be previewed, and renders the document content of the document to be previewed in the container.

[0112] Step e5: The second terminal previews the document content of the document to be previewed, wherein the second terminal supports editing and converting the document to be previewed during the process of previewing the document content of the document to be previewed.

[0113] Specifically, the document to be previewed is parsed with the help of a JS parsing plug-in, and rendering is completed in a container (WebView) to convert the document content into a form that can be intuitively previewed by the user.

[0114] The disclosed embodiment, based on the establishment of a communication connection between the first terminal and the second terminal, directly uses its own target operating system to preview the shared document (document to be previewed) of the first terminal in advance, without downloading a third-party application to preview the document content, thereby preventing the content of the document to be previewed from being leaked, thereby not only ensuring the security of the document to be previewed, but also avoiding the problems of traffic and time consumption caused by downloading third-party applications, and ultimately improving the processor running speed. At the same time, since the second terminal supports editing and converting the document to be previewed during the preview of the document content of the document to be previewed, it avoids the problems of traffic and time consumption caused by downloading third-party applications, and ultimately improves the processor running speed, and at the same time supports editing the document to be previewed and supporting converting the document to be previewed into a picture format, which brings great convenience to users.

[0115] In some optional implementations, during the process of previewing the document to be previewed by the target operating system, the second terminal deletes the document to be previewed in response to successfully receiving a document closing instruction.

[0116] Specifically, when the user of the second terminal closes the document to be previewed, that is, when the second terminal successfully receives the document closing instruction, the document to be previewed is deleted, which is conducive to timely and thoroughly clearing the cached data in the memory, eliminating any possible data residue, and comprehensively ensuring the confidentiality of the document content.

[0117] In some optional implementations, the document preview method in the embodiment of the present disclosure further includes: the second terminal stores the document to be previewed in the sandbox space.

[0118] The disclosed embodiment stores the document to be previewed in its own sandbox space, which ensures the security of the document to be previewed in the sandbox space on the one hand, and facilitates the user to preview the document to be previewed again on the other hand.

[0119] In this embodiment, a file preview device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0120] This embodiment provides a file preview device, such as Figure 4 As shown, including:

[0121] A first key generation module 401 is configured to generate a first key and a second key by the first terminal in response to the first terminal successfully establishing a communication connection with the second terminal through the server, wherein the second key is used to encrypt the document to be previewed, the first key is used to encrypt the second key, the first key is generated based on a target identifier and a target salt value, the target salt value is a common salt value of the first terminal and the second terminal, the target identifier is a common identifier of the first terminal and the second terminal, and the second key is generated based on the target identifier and the document to be previewed;

[0122] The encrypted document sending module 402 is used for the first terminal to send the second key and the encrypted document to be previewed to the server, and wait for the second terminal to decrypt the document to be previewed using the second key and then preview the document to be previewed using the target operating system.

[0123] In some optional implementations, the encrypted document sending module includes:

[0124] The document identification generation submodule is used for the first terminal to send the second key and the encrypted document to be previewed to the server, so that the server stores the document to be previewed and generates a document identification corresponding to the document to be previewed;

[0125] The document identification sending submodule is used for the first terminal to share the document identification with the second terminal through the server, so that the second terminal downloads the encrypted document to be previewed from the server, and enables the second terminal to decrypt the document to be previewed using the second key and then preview the document to be previewed using the target operating system.

[0126] In some optional implementations, the second key generation module includes:

[0127] A request submodule, used for the first terminal to send a first request instruction to the server, where the first request instruction is used to request the first terminal to establish a communication connection with the second terminal;

[0128] A response submodule, used for the first terminal to receive a first response instruction sent by the server, the first response instruction is used to respond to the first terminal to establish a communication connection with the second terminal;

[0129] The communication submodule is used for the first terminal to successfully establish a communication connection between the first terminal and the second terminal based on the communication response instruction.

[0130] In some optional implementations, the document preview device in the embodiment of the present disclosure further includes: a first storage module, which is used for the first terminal to store the second key in an encrypted database in the sandbox.

[0131] In a second aspect, the present disclosure provides a document preview device, the device comprising:

[0132] The encrypted document acquisition module is used for, in response to the second terminal successfully establishing a communication connection with the first terminal through the server, the second terminal acquiring the second key generated by the first terminal and the encrypted document to be previewed from the server;

[0133] A second key generation module, the second terminal generates a first key and a second key, the first key is generated based on a target identifier and a target salt value, wherein the second key is used to decrypt the document to be previewed, the first key is used to decrypt the second key, the first key is generated based on the target identifier and the target salt value, the target salt value is a common salt value of the first terminal and the second terminal, the target identifier is a common identifier of the first terminal and the second terminal, and the second key is generated based on the target identifier and the document to be previewed;

[0134] A first document decryption module, used for the second terminal to decrypt the second key using the first key;

[0135] The second document decryption module is used for the second terminal to decrypt the document to be previewed using the second key to obtain the document to be previewed;

[0136] The encrypted document preview module is used for the second terminal to preview the document to be previewed using the target operating system.

[0137] In some optional implementations, the target operating system includes an Android operating system, and the encrypted document preview module includes:

[0138] A file creation unit, used for the second terminal to create a target executable file using a container of the Android operating system;

[0139] A format acquisition unit, used for the second terminal to acquire the current document format of the document to be previewed;

[0140] A plug-in acquisition unit, used for the second terminal to acquire a target parsing plug-in corresponding to the current document format using the target execution file;

[0141] A document rendering unit, configured for the second terminal to parse the document to be previewed using the target parsing plug-in, and render the document content of the document to be previewed in the container;

[0142] The document preview unit is used for the second terminal to preview the document content of the document to be previewed, wherein the second terminal supports editing the document to be previewed and converting the document to be previewed into a picture format for preview during the process of previewing the document content of the document to be previewed.

[0143] In some optional implementations, the encrypted document preview module includes: a document deletion unit, which is used to delete the document to be previewed in response to successfully receiving a document closing instruction during the process of the second terminal previewing the document to be previewed using the target operating system.

[0144] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0145] The document preview device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0146] The embodiment of the present invention further provides a computer device having a document preview device.

[0147] See also Figure 5 , Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.

[0148] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0149] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0150] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0151] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0152] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.

[0153] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0154] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0155] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A document preview method, characterized in that: The method comprises: In response to the first terminal successfully establishing a communication connection with the second terminal through the server, the first terminal generates a first key and a second key, wherein the second key is used to encrypt the document to be previewed, the first key is used to encrypt the second key, the first key is generated based on a target identifier and a target salt value, the target salt value is a common salt value of the first terminal and the second terminal, the target identifier is a common identifier of the first terminal and the second terminal, and the second key is generated based on the target identifier and the document to be previewed; The first terminal sends the second key and the encrypted document to be previewed to the server, and waits for the second terminal to decrypt the document to be previewed using the second key and then preview the document to be previewed using a target operating system.

2. The method according to claim 1, characterized in that The first terminal sends the second key and the encrypted document to be previewed to the server, and waits for the second terminal to decrypt the document to be previewed using the second key and then preview the document to be previewed using the target operating system, including: The first terminal sends the second key and the encrypted document to be previewed to the server, so that the server stores the document to be previewed and generates a document identifier corresponding to the document to be previewed; The first terminal shares the document identifier with the second terminal through the server, so that the second terminal downloads the encrypted document to be previewed from the server, and the second terminal uses the second key to decrypt the document to be previewed and then uses the target operating system to preview the document to be previewed.

3. The method according to claim 1, characterized in that The first terminal successfully establishes a connection with the second terminal through the server, including: The first terminal sends a first request instruction to the server, where the first request instruction is used to request the first terminal to establish a communication connection with the second terminal; The first terminal receives a first response instruction sent by the server, where the first response instruction is used to respond to the first terminal establishing a communication connection with the second terminal; The first terminal successfully establishes a communication connection between the first terminal and the second terminal based on the communication response instruction.

4. The method according to claim 1, characterized in that: Also includes: The first terminal stores the second key in an encrypted database within the sandbox.

5. A document preview method, characterized in that: The method comprises: In response to the second terminal successfully establishing a communication connection with the first terminal through the server, the second terminal obtains the second key generated by the first terminal and the encrypted document to be previewed from the server; The second terminal generates a first key and a second key, the first key is generated based on a target identifier and a target salt value, wherein the second key is used to decrypt the document to be previewed, the first key is used to decrypt the second key, the first key is generated based on the target identifier and the target salt value, the target salt value is a common salt value of the first terminal and the second terminal, the target identifier is a common identifier of the first terminal and the second terminal, and the second key is generated based on the target identifier and the document to be previewed; The second terminal decrypts the second key using the first key; The second terminal decrypts the document to be previewed using the second key to obtain the document to be previewed; The second terminal previews the document to be previewed using the target operating system.

6. The method according to claim 5, characterized in that: The second terminal previews the document to be previewed by using the target operating system, including: The second terminal obtains, through the server, an identifier of the document shared by the first terminal; The second terminal downloads the encrypted document to be previewed from the server based on the document identifier; The second terminal decrypts the document to be previewed using the second key.

7. The method according to claim 5, characterized in that The target operating system includes an Android operating system, and the second terminal previews the document to be previewed using the target operating system, including: The second terminal creates a target executable file using a container of the Android operating system; The second terminal obtains the current document format of the document to be previewed; The second terminal uses the target execution file to obtain a target parsing plug-in corresponding to the current document format; The second terminal parses the document to be previewed using the target parsing plug-in, and renders the document content of the document to be previewed in the container; The second terminal previews the document content of the document to be previewed, wherein the second terminal supports editing the document to be previewed and converting the document to be previewed into a picture format for preview during the process of previewing the document content of the document to be previewed.

8. The method according to claim 5, 6 or 7, characterized in that: During the process of previewing the document to be previewed by the target operating system, the second terminal deletes the document to be previewed in response to successfully receiving a document closing instruction.

9. A document preview system, characterized in that: include: A first terminal, a second terminal and a server, wherein after the first terminal successfully establishes a communication connection with the second terminal through the server, the first terminal generates a first key and a second key, wherein the second key is used to encrypt a document to be previewed, the first key is used to encrypt the second key, the first key is generated based on a target identifier and a target salt value, the target salt value is a common salt value of the first terminal and the second terminal, the target identifier is a common identifier of the first terminal and the second terminal, and the second key is generated based on the target identifier and the document to be previewed; after the first terminal sends the second key and the encrypted document to be previewed to the server, the second terminal generates the first key and the second key, decrypts the document to be previewed using the second key, and then previews the document to be previewed using a target operating system.

10. A document preview device, characterized in that: The device comprises: A first key generation module, configured to generate, in response to a successful communication connection between a first terminal and a second terminal through a server, a first terminal generating a first key and a second key, wherein the second key is used to encrypt a document to be previewed, the first key is used to encrypt the second key, the first key is generated based on a target identifier and a target salt value, the target salt value is a common salt value of the first terminal and the second terminal, the target identifier is a common identifier of the first terminal and the second terminal, and the second key is generated based on the target identifier and the document to be previewed; The encrypted document sending module is used for the first terminal to send the second key and the encrypted document to be previewed to the server, and wait for the second terminal to decrypt the document to be previewed using the second key and then preview the document to be previewed using the target operating system.

11. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the document preview method according to any one of claims 1 to 8 by executing the computer instructions.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the document preview method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method and device for protecting internal resources of Android hybrid mode mobile application

    CN108965573A

  • Data encryption transmission method and device, and electronic equipment

    CN114978746A

  • Shared file encryption and decryption method and device and electronic equipment

    CN116305236A

  • System and method for managing encryption and decryption of cloud disk file

    CN117061126A