File processing method and device, nonvolatile storage medium and electronic equipment

By obtaining and using the default opening program for office files, establishing associations, decrypting and encrypted file processing, the problem of declining operating system stability is solved, transparent reading and writing operations of encrypted files are realized, and system stability is improved.

CN118568779AInactive Publication Date: 2024-08-30BEIJING EETRUST TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411041308.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-08-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When the existing technology handles the read and write operations of encrypted files, the stability of the operating system is reduced, and the hook technology has the risk of inserting code into the system kernel and is prohibited from being used in certain environments.

Method used

By obtaining multiple file types of office files and their default opening programs, establishing an association, determining whether the target file is ciphertext and decrypting it, using the default opening program to open the decrypted file, and creating a copy of the file when the file is saved. Encryption processing enables encrypted files to overwrite original files, and pure application layer technology realizes transparent encryption and decryption processing.

Benefits of technology

It improves the operating stability of the operating system, avoids stability problems caused by hook technology, and enables users to transparently read and write encrypted files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568779A
    Figure CN118568779A
Patent Text Reader

Abstract

The invention discloses a file processing method and device, a nonvolatile storage medium and electronic equipment. The method comprises the following steps: acquiring a plurality of different file types corresponding to office files; establishing a first association relationship between each file type and a default opening program corresponding to each file type; obtaining a file path parameter of the target file, and decrypting the target file under the condition that the target file is a ciphertext to obtain a decrypted file; searching a target default opening program corresponding to the file type of the decrypted file, and opening the decrypted file by using the target default opening program; and if the file storage event is detected, establishing a copy file of the decrypted file, encrypting the copy file to obtain an encrypted file, and covering the target file with the encrypted file. According to the method and the device, the technical problem that the operation stability of an operation system is relatively low due to the fact that a hook technology is adopted to process read-write operation of a user on an encrypted file is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data security, and specifically, to a file processing method and device, a non-volatile storage medium, and an electronic device. Background Art

[0002] In data security systems, when processing user read and write operations on encrypted files, in order to maintain the user experience, a transparent opening and saving method is usually adopted, that is, the technical details of the encryption and decryption operations are hidden, so that users can get the same experience as when reading and writing plaintext files. User space file system technology can be used to achieve transparent opening and saving of files, but this technology requires the directory to be mounted on the disk first, and there is also the problem of inefficiency caused by frequent switching of file data between the kernel and application layers.

[0003] In addition, you can also use hook technology to implement encryption and decryption operations by hooking the system application layer or kernel layer's open, read, write and other system function interfaces. However, this technology requires inserting code into the host process or system kernel, which will lead to a decrease in the stability of the related application or operating system, and it is also prohibited to use on systems in specific environments.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide a file processing method and device, a non-volatile storage medium, and an electronic device to at least solve the technical problem of low operating stability of the operating system caused by using hook technology to process user read and write operations on encrypted files.

[0006] According to one aspect of an embodiment of the present application, a file processing method is provided, including: obtaining multiple different file types corresponding to office files, and obtaining a default opening program corresponding to each file type in the multiple different file types; establishing a first association relationship between each file type and the default opening program corresponding to each file type, and storing the first association relationship; obtaining a file path parameter of a target file, accessing the target file according to the file path parameter to determine whether the target file is ciphertext, and decrypting the target file if the target file is ciphertext to obtain a decrypted file, wherein the target file is an office file that triggers a file opening event of an operating system; searching for a target default opening program corresponding to the file type of the decrypted file in the first association relationship, and opening the decrypted file using the target default opening program; after opening the decrypted file using the target default opening program, if a file save event is detected, establishing a copy file of the decrypted file, encrypting the copy file to obtain an encrypted file, and overwriting the target file with the encrypted file.

[0007] Optionally, after opening the decrypted file using the target default opening program, the method further includes: establishing a second association relationship between the target file and the decrypted file; creating a copy file of the decrypted file, encrypting the copy file, and obtaining the encrypted file, the method further includes: establishing a third association relationship between the decrypted file and the encrypted file.

[0008] Optionally, overwriting the target file with the encrypted file includes: determining a decrypted file based on the third association relationship and the encrypted file, determining a target file based on the second association relationship and the decrypted file, and overwriting the target file with the encrypted file to update the target file.

[0009] Optionally, before obtaining the file path parameter of the target file, the method further includes: setting the default opening mode of the office file to a general file opening program through a system interface of the operating system, wherein the general file opening program includes: Greader.

[0010] Optionally, obtaining the file path parameter of the target file includes: utilizing a response event of a general file opening program to a file opening event to obtain the file path parameter of the target file.

[0011] Optionally, the file saving event includes: the modification time of the decrypted file changes, and the changed file modification time does not change within a preset time period.

[0012] Optionally, when the target file is not encrypted, the method further includes: searching for a default opening program corresponding to the file type of the target file in the first association relationship, and opening the target file using the default opening program corresponding to the file type of the target file.

[0013] According to another aspect of the embodiment of the present application, a file processing device is also provided, including: an acquisition module, used to acquire multiple different file types corresponding to office files, and acquire a default opening program corresponding to each of the multiple different file types; an establishment module, used to establish a first association relationship between each file type and the default opening program corresponding to each file type, and store the first association relationship; a processing module, used to acquire a file path parameter of a target file, access the target file according to the file path parameter to determine whether the target file is a ciphertext, and decrypt the target file if the target file is a ciphertext to obtain a decrypted file, wherein the target file is an office file that triggers a file opening event of an operating system; an opening module, used to search for a target default opening program corresponding to the file type of the decrypted file in the first association relationship, and use the target default opening program to open the decrypted file; an overwriting module, used to create a copy file of the decrypted file if a file save event is detected after the decrypted file is opened with the target default opening program, encrypt the copy file to obtain an encrypted file, and overwrite the target file with the encrypted file.

[0014] According to another aspect of the embodiments of the present application, a non-volatile storage medium is further provided, the storage medium including a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the above file processing method.

[0015] According to another aspect of the embodiments of the present application, there is further provided an electronic device, including: a memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the above file processing method is executed when the program is run.

[0016] According to yet another aspect of the embodiments of the present application, a computer program is further provided, wherein the above file processing method is implemented when the computer program is executed by a processor.

[0017] According to another aspect of the embodiments of the present application, a computer program product is also provided, the computer program product comprising a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above file processing method is implemented.

[0018] In an embodiment of the present application, a plurality of different file types corresponding to an office file are obtained, and a default opening program corresponding to each file type in the plurality of different file types is obtained; a first association relationship between each file type and the default opening program corresponding to each file type is established, and the first association relationship is stored; a file path parameter of a target file is obtained, and the target file is accessed according to the file path parameter to determine whether the target file is a ciphertext, and if the target file is a ciphertext, the target file is decrypted to obtain a decrypted file, wherein the target file is an office file that triggers a file opening event of the operating system; a target default opening program corresponding to the file type of the decrypted file is searched in the first association relationship, and the decrypted file is opened using the target default opening program; after the decrypted file is opened using the target default opening program, if a file saving event is detected, a copy file of the decrypted file is established, the copy file is encrypted to obtain an encrypted file, and the encrypted file is used to overwrite the target file, thereby achieving the purpose of using pure application layer technology to realize transparent encryption and decryption processing of users opening, editing and saving encrypted files, thereby achieving the technical effect of improving the operating stability of the operating system, and further solving the technical problem of low operating stability of the operating system caused by using hook technology to process the read and write operations of users on encrypted files. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0020] Figure 1 is a flowchart of a file processing method according to an embodiment of the present application;

[0021] Figure 2 is a structural diagram of a file processing device according to an embodiment of the present application;

[0022] Figure 3 It is a hardware structure block diagram of a computer terminal according to a file processing method of an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0025] According to an embodiment of the present application, a method embodiment of a file processing method 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.

[0026] Figure 1 is a flowchart of a file processing method according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:

[0027] Step S101, obtaining a plurality of different file types corresponding to office files, and obtaining a default opening program corresponding to each of the plurality of different file types.

[0028] For example, step S101 can be implemented by the following method: enable the universal file opening program Greader, configure multiple different file types corresponding to office files in the Greader program, and then obtain the default opening program corresponding to each of the multiple different file types through the system interface.

[0029] It is understandable that office files refer to files used in office activities for recording, exchanging and storing information. The office files in this embodiment are electronic office files, including electronic documents, electronic spreadsheets, presentations, emails, etc.

[0030] File types such as: doc, docx, xls, xlsx, ppt, pptx, wps, et, dps, rtf, pdf, etc.

[0031] Step S102: establishing a first association relationship between each file type and a default opening program corresponding to each file type, and storing the first association relationship.

[0032] For example, 1. The default program to open doc is Microsoft Word (old version, 2007 and earlier); 2. The default program to open docx is Microsoft Word (new version, 2007 and later); 3. The default program to open xls is Microsoft Excel (old version, 2007 and earlier); 4. The default program to open xlsx is Microsoft Excel (new version, 2007 and later); 5. The default program to open ppt is Microsoft PowerPoint (old version, 2007 and earlier); 6. pptx Microsoft PowerPoint (new version, 2007 and later); 7. The default program to open wps is WPS Office (WPS Writer document); 8. The default program to open et is WPS Office (WPS spreadsheet); 9. The default program to open dps is WPS Office (WPS presentation); 10. The default program to open rtf is Notepad; 11. The default program to open pdf is Adobe Acrobat Reader.

[0033] Then establish an association relationship (first association relationship) between the doc file type and Microsoft Word (old version, 2007 and earlier versions); an association relationship (first association relationship) between docx and Microsoft Word (new version, 2007 and later versions); an association relationship between xls and Microsoft Excel (old version, 2007 and earlier versions), and so on.

[0034] Finally, the first association relationship is stored in a preset path.

[0035] Step S103, obtain the file path parameters of the target file, access the target file according to the file path parameters to determine whether the target file is ciphertext, and if the target file is ciphertext, decrypt the target file to obtain a decrypted file, wherein the target file is an office file that triggers a file open event of the operating system.

[0036] Take Python as an example to explain how to access the target file based on the file path parameter:

[0037] 1. Determine the file path parameters.

[0038] The file path can be obtained through command line parameters, user input, environment variables or configuration files. For example, if you intend to accept the file path from the command line, you can use `sys.argv` in the Python script to get it.

[0039] 2. Import necessary libraries.

[0040] Python's os module can be used to check whether a file exists and to get other file properties.

[0041] ```Python

[0042] import os

[0043] import sys

[0044] ```

[0045] 3. Get the file path.

[0046] Assuming the file path is passed as a command line argument.

[0047] ```Python

[0048] if len(sys.argv) > 1:

[0049] filepath = sys.argv[1]

[0050] else:

[0051] print("Please provide the file path as a parameter.")

[0052] sys.exit(1)

[0053] ```

[0054] 4. Check if the file exists.

[0055] It is important to check if a file exists before trying to access it to avoid runtime errors.

[0056] ```Python

[0057] if not os.path.exists(filepath):

[0058] print(f"File {filepath} does not exist.")

[0059] sys.exit(1)

[0060] ```

[0061] 5. Open and read the file.

[0062] Use Python's built-in function `open()` to open a file. You can open a file in read-only mode (`'r'`) or write mode (`'w'`), etc.

[0063] ```Python

[0064] try:

[0065] with open(filepath, 'r') as file:

[0066] contents = file.read()

[0067] print(contents)

[0068] except IOError as e:

[0069] print(f"Unable to read file {filepath}: {e}")

[0070] sys.exit(1)

[0071] ```

[0072] For example, assuming that the user performs an open operation on file 1, then file 1 is an office file that triggers the file open event of the operating system. Obtain the file path parameter of file 1, and open file 1 in the file path where file 1 is located. If file 1 cannot be opened normally, it means that file 1 is ciphertext. Furthermore, in the case that file 1 is ciphertext, decrypt the target file to obtain the decrypted file.

[0073] Optionally, when the target file is not ciphertext, a default opening program corresponding to the file type of the target file is searched in the first association relationship, and the target file is opened using the default opening program corresponding to the file type of the target file.

[0074] Step S104, searching the first association relationship for a target default opening program corresponding to the file type of the decrypted file, and using the target default opening program to open the decrypted file.

[0075] For example, the decrypted file is a doc type file. According to the first association relationship, the default opening program for doc type files is Microsoft Word (old version, 2007 and earlier versions). Therefore, the decrypted file can be opened using Microsoft Word (old version, 2007 and earlier versions).

[0076] Step S105, after the decrypted file is opened by the target default opening program, if a file saving event is detected, a copy file of the decrypted file is created, the copy file is encrypted to obtain an encrypted file, and the encrypted file is used to overwrite the target file.

[0077] Preferably, the file saving event includes: the modification time of the decrypted file changes, and the changed file modification time does not change within a preset time period.

[0078] After opening the decrypted file with Microsoft Word (old version, 2007 and earlier), you can monitor the opened decrypted file and obtain the file status of the opened decrypted file in real time. If the modification time of the decrypted file changes, and the modified file modification time does not change within a certain preset time, it means that the user has edited the opened decrypted file and completed the save operation.

[0079] Alternatively, if the file size of the opened decrypted file changes, and in a subsequent preset period of monitoring, the file size stabilizes at a fixed value, it means that the user has edited the opened decrypted file and completed the save operation.

[0080] When it is determined that the user has completed the above saving operation, a copy file of the decrypted file after the saving operation is created, and the copy file is encrypted to obtain an encrypted file.

[0081] File 1 is overwritten by the encrypted file, that is, the office file that triggers the file opening event of the operating system is overwritten by the encrypted file. Finally, the encrypted state of the decrypted file content after the save operation is maintained. In addition, transparent encryption and decryption processing is realized for users to open, edit and save encrypted files.

[0082] According to the above steps, a plurality of different file types corresponding to office documents are obtained, and a default opening program corresponding to each file type in the plurality of different file types is obtained; a first association relationship between each file type and the default opening program corresponding to each file type is established, and the first association relationship is stored; a file path parameter of a target file is obtained, and the target file is accessed according to the file path parameter to determine whether the target file is ciphertext, and when the target file is ciphertext, the target file is decrypted to obtain a decrypted file, wherein the target file is an office file that triggers a file opening event of the operating system; the target default opening program corresponding to the file type of the decrypted file is searched in the first association relationship, and the decrypted file is opened using the target default opening program; after the decrypted file is opened using the target default opening program, if a file saving event is detected, a copy file of the decrypted file is established, the copy file is encrypted to obtain an encrypted file, and the encrypted file is used to overwrite the target file, thereby achieving the purpose of using pure application layer technology to realize transparent encryption and decryption processing for users to open, edit and save encrypted files, thereby achieving the technical effect of improving the operating stability of the operating system.

[0083] According to some optional embodiments of the present application, after the decrypted file is opened using the target default opening program, the following step may be performed: establishing a second association relationship between the target file and the decrypted file.

[0084] Assuming that the target file is file 1 and the decrypted file is file 2, an association relationship (second association relationship) is established between file 1 and file 2. According to the above association relationship, when the information of file 1 is known, the information of file 2 can be found.

[0085] In addition, after creating a copy file of the decrypted file and encrypting the copy file to obtain the encrypted file, the following steps may be performed: establishing a third association relationship between the decrypted file and the encrypted file.

[0086] Assuming that the decrypted file is file 2 and the encrypted file is file 3, an association relationship (third association relationship) is established between file 2 and file 3. According to the above association relationship, when the information of file 2 is known, the information of file 3 can be found.

[0087] Furthermore, overwriting the target file with the encrypted file can be achieved by the following method: determining the decrypted file based on the third association relationship and the encrypted file, and determining the target file based on the second association relationship and the decrypted file, and overwriting the target file with the encrypted file to update the target file.

[0088] According to the information of file 3 and the third association relationship, the information of file 2 can be determined, and further, according to the information of file 2, the information of file 1 can be determined. Finally, the encrypted file (file 3) can be used to overwrite the target file (file 1).

[0089] According to some other optional embodiments of the present application, before obtaining the file path parameters of the target file, the following steps may be performed: setting the default opening mode of office files to a general file opening program through the system interface of the operating system, wherein the general file opening program includes: Greader. Obtaining the file path parameters of the target file may be achieved by the following method: utilizing the response event of the general file opening program to the file opening event to obtain the file path parameters of the target file.

[0090] It is worth noting that in step S101, the universal file opening program Greader can be enabled, and multiple different file types and icons corresponding to office files can be configured in the Greader program.

[0091] In step S102, the default opening program identifier of each type of office file and the execution program path of each type of office file can be obtained through the system interface, and each type of office file and its corresponding opening program identifier and execution program path can be archived.

[0092] For example, 1. The default program to open doc is Microsoft Word (old version, 2007 and earlier); 2. The default program to open docx is Microsoft Word (new version, 2007 and later); 3. The default program to open xls is Microsoft Excel (old version, 2007 and earlier); 4. The default program to open xlsx is Microsoft Excel (new version, 2007 and later).

[0093] After step S101 and step S102, the default opening mode for all types of office files is set to be the universal file opening program Greader through the system interface.

[0094] Furthermore, assuming that the user performs an open operation on file 1, file 1 is an office file that triggers the file open event of the operating system. The general file opening program Greader responds to the file open (OpenFile) event, and can obtain the file path parameter of file 1 passed in by the operating system. Then, the file path in the file path parameter can be accessed and the file can be opened in the file path.

[0095] Figure 2 is a structural diagram of a file processing device according to an embodiment of the present application, such as Figure 2 As shown, the device comprises:

[0096] The acquisition module 21 is used to acquire multiple different file types corresponding to office files, and acquire the default opening program corresponding to each of the multiple different file types.

[0097] The establishing module 22 is used to establish a first association relationship between each file type and a default opening program corresponding to each file type, and store the first association relationship.

[0098] The processing module 23 is used to obtain the file path parameters of the target file, access the target file according to the file path parameters to determine whether the target file is ciphertext, and if the target file is ciphertext, decrypt the target file to obtain the decrypted file, wherein the target file is an office file that triggers a file opening event of the operating system.

[0099] The opening module 24 is used to search the first association relationship for a target default opening program corresponding to the file type of the decrypted file, and use the target default opening program to open the decrypted file.

[0100] The overwriting module 25 is used to open the decrypted file with the target default opening program, and if a file saving event is detected, create a copy file of the decrypted file, encrypt the copy file to obtain an encrypted file, and use the encrypted file to overwrite the target file.

[0101] Optionally, the file processing device also includes: a first establishing module 26, which is used to perform the following steps after opening the decrypted file using the target default opening program: establishing a second association relationship between the target file and the decrypted file; establishing a copy file of the decrypted file, encrypting the copy file, and obtaining the encrypted file. The method also includes: establishing a third association relationship between the decrypted file and the encrypted file.

[0102] Optionally, the overwriting module 25 is further used to determine the decrypted file according to the third association relationship and the encrypted file, and to determine the target file according to the second association relationship and the decrypted file, and to overwrite the target file with the encrypted file to update the target file.

[0103] Optionally, the file processing device also includes: a setting module 27, which is used to perform the following steps before obtaining the file path parameters of the target file: setting the default opening method of office files to a general file opening program through the system interface of the operating system, wherein the general file opening program includes: Greader.

[0104] Optionally, the processing module 23 is further configured to utilize a response event of a general file opening program to a file opening event to obtain a file path parameter of the target file.

[0105] Optionally, the file saving event includes: the modification time of the decrypted file changes, and the changed file modification time does not change within a preset time period.

[0106] Optionally, the file processing device also includes: a first processing module 28, which is used to perform the following steps when the target file is not encrypted: searching for a default opening program corresponding to the file type of the target file in the first association relationship, and opening the target file using the default opening program corresponding to the file type of the target file.

[0107] It should be noted that the above Figure 2 Each module in the can be a program module (for example, a set of program instructions that implement a specific function) or a hardware module. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above modules is a processor, or the functions of each of the above modules are implemented by a processor.

[0108] It should be noted that Figure 2 The preferred implementation of the illustrated embodiment can be found in Figure 1 The relevant description of the illustrated embodiment will not be repeated here.

[0109] Figure 3 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a file processing method. Figure 3 As shown, the computer terminal 30 may include one or more (302a, 302b, ..., 302n are used to illustrate) processors 302 (the processor 302 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 304 for storing data, and a transmission module 306 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 3 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 3 More or fewer components as shown, or with Figure 3 Different configurations are shown.

[0110] It should be noted that the one or more processors 302 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 30. As involved in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0111] The memory 304 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the file processing method in the embodiment of the present application. The processor 302 executes various functional applications and data processing by running the software programs and modules stored in the memory 304, that is, the above-mentioned file processing method is realized. The memory 304 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 304 may further include a memory remotely arranged relative to the processor 302, and these remote memories may be connected to the computer terminal 30 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.

[0112] The transmission module 306 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 30. In one example, the transmission module 306 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 306 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0113] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 30 .

[0114] It should be noted that, in some optional embodiments, the above Figure 3 The computer terminal shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. It should be noted that Figure 3 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computer terminal described above.

[0115] It should be noted that Figure 3 The computer terminal shown is used to execute Figure 1 The file processing method shown, therefore the relevant explanations in the execution method of the above command are also applicable to the electronic device and will not be repeated here.

[0116] An embodiment of the present application further provides a non-volatile storage medium, which includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the above file processing method.

[0117] A program for performing the following functions on a non-volatile storage medium: obtaining a plurality of different file types corresponding to an office file, and obtaining a default opening program corresponding to each of the plurality of different file types; establishing a first association relationship between each file type and the default opening program corresponding to each file type, and storing the first association relationship; obtaining a file path parameter of a target file, accessing the target file according to the file path parameter to determine whether the target file is ciphertext, and decrypting the target file if the target file is ciphertext to obtain a decrypted file, wherein the target file is an office file that triggers a file opening event of an operating system; searching for a target default opening program corresponding to the file type of the decrypted file in the first association relationship, and using the target default opening program to open the decrypted file; after opening the decrypted file with the target default opening program, if a file saving event is detected, creating a copy file of the decrypted file, encrypting the copy file to obtain an encrypted file, and using the encrypted file to overwrite the target file.

[0118] An embodiment of the present application further provides an electronic device, including: a memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the above file processing method is executed when the program is run.

[0119] The processor is used to run a program that performs the following functions: obtain multiple different file types corresponding to office files, and obtain a default opening program corresponding to each file type in the multiple different file types; establish a first association relationship between each file type and the default opening program corresponding to each file type, and store the first association relationship; obtain a file path parameter of a target file, access the target file according to the file path parameter to determine whether the target file is a ciphertext, and if the target file is a ciphertext, decrypt the target file to obtain a decrypted file, wherein the target file is an office file that triggers a file opening event of the operating system; search for a target default opening program corresponding to the file type of the decrypted file in the first association relationship, and use the target default opening program to open the decrypted file; after opening the decrypted file with the target default opening program, if a file save event is detected, create a copy file of the decrypted file, encrypt the copy file to obtain an encrypted file, and use the encrypted file to overwrite the target file.

[0120] Optionally, after opening the decrypted file using the target default opening program, the method further includes: establishing a second association relationship between the target file and the decrypted file; creating a copy file of the decrypted file, encrypting the copy file, and obtaining the encrypted file, the method further includes: establishing a third association relationship between the decrypted file and the encrypted file.

[0121] Optionally, overwriting the target file with the encrypted file includes: determining a decrypted file based on the third association relationship and the encrypted file, determining a target file based on the second association relationship and the decrypted file, and overwriting the target file with the encrypted file to update the target file.

[0122] Optionally, before obtaining the file path parameter of the target file, the method further includes: setting the default opening mode of the office file to a general file opening program through a system interface of the operating system, wherein the general file opening program includes: Greader.

[0123] Optionally, obtaining the file path parameter of the target file includes: utilizing a response event of a general file opening program to a file opening event to obtain the file path parameter of the target file.

[0124] Optionally, the file saving event includes: the modification time of the decrypted file changes, and the changed file modification time does not change within a preset time period.

[0125] Optionally, when the target file is not encrypted, the method further includes: searching for a default opening program corresponding to the file type of the target file in the first association relationship, and opening the target file using the default opening program corresponding to the file type of the target file.

[0126] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0127] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0128] In the above-mentioned embodiments of the present application, the collected information is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary protection measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0129] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0130] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0131] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0132] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.

[0133] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A file processing method, characterized in that: include: Acquire multiple different file types corresponding to office files, and acquire a default opening program corresponding to each of the multiple different file types; Establishing a first association relationship between each file type and a default opening program corresponding to each file type, and storing the first association relationship; Obtaining a file path parameter of a target file, accessing the target file according to the file path parameter to determine whether the target file is ciphertext, and decrypting the target file if the target file is ciphertext to obtain a decrypted file, wherein the target file is an office file that triggers a file opening event of an operating system; Searching the first association relationship for a target default opening program corresponding to the file type of the decrypted file, and using the target default opening program to open the decrypted file; After the decrypted file is opened by the target default opening program, if a file saving event is detected, a copy file of the decrypted file is created, the copy file is encrypted to obtain an encrypted file, and the encrypted file is used to overwrite the target file.

2. The method according to claim 1, characterized in that After opening the decrypted file using the target default opening program, the method further includes: Establishing a second association relationship between the target file and the decrypted file; After creating a copy file of the decrypted file and encrypting the copy file to obtain an encrypted file, the method further includes: A third association relationship is established between the decrypted file and the encrypted file.

3. The method according to claim 2, characterized in that Overwriting the target file with the encrypted file includes: The decrypted file is determined according to the third association relationship and the encrypted file, and the target file is determined according to the second association relationship and the decrypted file, and the encrypted file is used to overwrite the target file to update the target file.

4. The method according to claim 1, characterized in that: Before obtaining the file path parameter of the target file, the method further includes: setting the default opening mode of the office file to a general file opening program through the system interface of the operating system, wherein the general file opening program includes: Greader.

5. The method according to claim 4, characterized in that Obtaining the file path parameter of the target file includes: utilizing the response event of the general file opening program to the file opening event to obtain the file path parameter of the target file.

6. The method according to claim 1, characterized in that The file saving event includes: the modification time of the decrypted file changes, and the changed file modification time does not change within a preset time period.

7. The method according to claim 1, characterized in that When the target file is not encrypted, the method further includes: searching the first association relationship for a default opening program corresponding to the file type of the target file, and opening the target file using the default opening program corresponding to the file type of the target file.

8. A file processing device, characterized in that: include: An acquisition module, used to acquire multiple different file types corresponding to office files, and acquire a default opening program corresponding to each of the multiple different file types; An establishing module, used for establishing a first association relationship between each file type and a default opening program corresponding to each file type, and storing the first association relationship; a processing module, configured to obtain a file path parameter of a target file, access the target file according to the file path parameter to determine whether the target file is a ciphertext, and decrypt the target file if the target file is a ciphertext to obtain a decrypted file, wherein the target file is an office file that triggers a file opening event of the operating system; an opening module, configured to search the first association relationship for a target default opening program corresponding to the file type of the decrypted file, and use the target default opening program to open the decrypted file; The overwriting module is used to create a copy file of the decrypted file after opening the decrypted file with the target default opening program, encrypt the copy file to obtain an encrypted file, and use the encrypted file to overwrite the target file if a file saving event is detected.

9. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the file processing method according to any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the file processing method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • File type opening mode setting method and device and electronic equipment

    CN114328409A

  • Encrypted file processing method and device and nonvolatile storage medium

    CN115130142A

  • File processing method, computing device and storage medium

    CN115186277A

  • Data processing method and device, equipment and storage medium

    CN115344876A

  • Selective decryption of files

    GB201217610D0