CN117521125A - File processing method and device, electronic equipment and storage medium - Google Patents

File processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117521125A
CN117521125A CN202311344726.2A CN202311344726A CN117521125A CN 117521125 A CN117521125 A CN 117521125A CN 202311344726 A CN202311344726 A CN 202311344726A CN 117521125 A CN117521125 A CN 117521125A
Authority
CN
China
Prior art keywords
file
character string
target
url address
target file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311344726.2A
Other languages
Chinese (zh)
Inventor
李启源
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202311344726.2A priority Critical patent/CN117521125A/en
Publication of CN117521125A publication Critical patent/CN117521125A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6209Protecting access to data via a platform, e.g. using keys or access control rules to a single file or object, e.g. in a secure envelope, encrypted and accessed using a key, or with access control rules appended to the object itself
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The disclosure provides a file processing method, a file processing device, electronic equipment and a storage medium, and relates to the technical field of big data storage. The file processing method comprises the following steps: acquiring a query request, wherein the query request comprises a file identifier of a target file to be queried; sending a query request to a server, and receiving an encrypted character string of a target file returned by the server, wherein the encrypted character string is generated based on an actual first URL address of the target file; acquiring an original character string corresponding to the encrypted character string, and determining a target field according to the encrypted character string; and determining a second URL address which corresponds to the first URL address and is used for removing the key information based on the original character string and the target field. According to the embodiment of the disclosure, the condition that the URL address leaks the target file information can be avoided, the security of the target file is improved when the post-processing is performed based on the target file URL address, and the confidentiality is higher.

Description

File processing method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of big data storage, in particular to a file processing method, a device, electronic equipment and a storage medium.
Background
At present, the preview, downloading and other modes of the file are usually performed by opening a new page and performing related interactions such as downloading, printing and the like, and although basic requirements of users are provided, the address of the new page usually exposes a lot of key information such as service names, request parameters and the like, thereby threatening the security of the file.
Disclosure of Invention
The present disclosure aims to solve, at least to some extent, one of the technical problems in the related art.
An embodiment of a first aspect of the present disclosure provides a file processing method, which is executed by a client, including:
acquiring a query request, wherein the query request comprises a file identifier of a target file to be queried;
sending the query request to a server, and receiving an encrypted character string of the target file returned by the server, wherein the encrypted character string is generated based on an actual first URL address of the target file;
acquiring an original character string corresponding to the encrypted character string, and determining a target field according to the encrypted character string;
and determining a second URL address which corresponds to the first URL address and is used for removing key information based on the original character string and the target field.
An embodiment of a second aspect of the present disclosure proposes a file processing apparatus, executed by a client, including:
the first acquisition module is used for acquiring a query request, wherein the query request comprises a file identifier of a target file to be queried;
the second acquisition module is used for sending the query request to a server and receiving an encrypted character string of the target file returned by the server, wherein the encrypted character string is generated based on an actual first URL address of the target file;
the third acquisition module is used for acquiring an original character string corresponding to the encrypted character string and determining a target field according to the encrypted character string;
and the fourth acquisition module is used for determining a second URL address which corresponds to the first URL address and is used for removing key information based on the original character string and the target field.
An embodiment of a third aspect of the present disclosure provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the file processing method provided in the embodiments of the first aspect of the present disclosure.
An embodiment of a fourth aspect of the present disclosure proposes a computer-readable storage medium having stored thereon computer instructions for causing a computer to execute the file processing method provided in the embodiment according to the first aspect of the present disclosure.
An embodiment of a fifth aspect of the present disclosure proposes a computer program product comprising a computer program which, when executed by a processor, implements a file processing method provided in an embodiment of the first aspect of the present disclosure.
According to the method and the device, the original character string and the corresponding target field can be obtained by processing the encrypted character string, so that the second URL address is determined, key information of the target file is removed from the second URL address, the condition that the URL address reveals information of the target file is avoided, the safety of the target file when post-processing is carried out based on the URL address of the target file is improved, and the confidentiality is higher.
Drawings
FIG. 1 is a flow chart of a method of processing a file provided by an embodiment of the present disclosure;
FIG. 2 is a flow chart of another method of file processing provided by an embodiment of the present disclosure;
FIG. 3 is a flow chart of another method of file processing provided by an embodiment of the present disclosure;
FIG. 4 is a flow chart of another method of file processing provided by an embodiment of the present disclosure;
FIG. 5 is a flow chart of another method of file processing provided by an embodiment of the present disclosure;
FIG. 6 is a flow chart of another method of file processing provided by an embodiment of the present disclosure;
FIG. 7 is a block diagram of a document processing apparatus provided in an embodiment of the present disclosure;
FIG. 8 is a block diagram of another document processing device provided by an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
Embodiments of the present disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and intended for the purpose of explaining the present disclosure and are not to be construed as limiting the present disclosure.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
The data acquisition, storage, use, processing and the like in the technical scheme meet the relevant regulations of national laws and regulations.
The following describes a file processing method, a device, an electronic apparatus, and a storage medium according to an embodiment of the present disclosure with reference to the accompanying drawings.
Fig. 1 is a flowchart of a file processing method according to an embodiment of the present disclosure. As shown in fig. 1, performed by a client, the method comprises the steps of:
s101, acquiring a query request.
The query request comprises a file identifier of the target file to be queried.
Optionally, the client may be a mobile device, a notebook computer, a tablet computer, a Web client, or the like, and may interact with the server to implement functions such as input and display.
Alternatively, the file identifier may include information such as a file name of the target file and content of the target file. The query request is used for acquiring a file to be queried.
In some embodiments, the query request may also include necessary parameter information for the target file, and different target files to be queried may correspond to different necessary parameter information. For example, a cpt report of line C in city B of province A needs to be queried, line C and line B of province A are all necessary parameter information, and the necessary parameter information is added into a query request, so that a more accurate target file can be obtained according to the query request.
In some embodiments, key value pairs ("key=value") may be set to characterize the necessary parameter information, with the parameter name as a key value, each key value uniquely corresponding to one value; and determining which keys are needed according to the necessary parameter information needed by the target file to be queried, and further determining the value corresponding to each key.
S102, sending the query request to the server, and receiving an encrypted character string of the target file returned by the server, wherein the encrypted character string is generated based on the actual first URL address of the target file.
It can be understood that the query request is sent to the server, and the relevant information of the corresponding target file, such as a character string corresponding to the target file, is requested to be obtained from the server according to the query request. Optionally, in order to ensure the security of the target file, the server may encrypt the related information of the target file to obtain a corresponding encrypted string, and after receiving the query request, the server returns the encrypted string of the target file to the client, so as to ensure that the key information in the target file is not revealed.
In some embodiments, the encrypted string may be generated based on a uniform resource locator (Uniform Resource Locator, URL) of the target file, i.e., based on the actual first URL address of the target file. It can be understood that the first URL address may include information such as a name and a key parameter of the target file, and considering that the first URL address may be directly changed, security is poor, so that the encryption processing of related information such as the first URL address and the content of the target file may obtain an encrypted string, which may achieve the purpose of security and confidentiality of basic information of the target file.
Alternatively, encryption processing may be performed using the cryptographic asymmetric encryption algorithm SM2 or the symmetric encryption algorithm SM 4. That is, the related information of the target file returned by the server is an encrypted string encrypted by the SM2 or SM 4.
S103, acquiring an original character string corresponding to the encrypted character string, and determining a target field according to the encrypted character string.
Alternatively, the encrypted string may be decrypted to obtain the original string.
In some embodiments, the encryption means and the key of the target file may be obtained, and decryption may be performed based on the key to obtain the corresponding original string.
In some embodiments, the encrypted string may be base64 encoded data obtained by encrypting an original string corresponding to the target file, so when the original string corresponding to the encrypted string is obtained, the encrypted string may be input to a decoder to obtain the corresponding original string.
Further, the encrypted character string may include a file type of the target file, such as txt, excel, word, pdf, JPEG, GIF, PNG or the like; in order to facilitate the processing of the unified format, different field expressions are adopted for different file types, so that the field corresponding to the type can be determined based on the file type of the target file in the encrypted character string.
In some embodiments, a correspondence between each file type and a field may be determined in advance, and after determining the file type in the encrypted string, a field corresponding to the file type may be obtained according to the correspondence, as a target field of the target file.
S104, determining a second URL address which corresponds to the first URL address and is used for removing the key information based on the original character string and the target field.
It can be understood that the original character string includes basic information corresponding to the target file, and the target field reflects the file type corresponding to the target file, so that the original character string can be reconfigured to determine a second URL address of the target file, where key information in the actual first URL address of the target file is removed from the second URL address. That is, the original character string and the target field are processed to obtain the virtual second URL address of the target file, the target file can be located according to the second URL address, and the key information in the first URL address corresponding to the target file is removed from the second URL address, so as to achieve the effect of keeping the key information of the target file secret.
In some embodiments, the original string and the target field may be recoded to obtain the second URL address, or the original string and the target field may be spliced, and the spliced string may be encrypted to obtain the second URL address, which is not limited herein.
In the embodiment of the disclosure, a query request is acquired and sent to a server to obtain an encrypted character string corresponding to a target file, the encrypted character string comprises basic information of the target file, the security of related information of the target file in the sending and receiving processes is guaranteed, after the encrypted character string is obtained, the encrypted character string is processed to obtain the original character string and a corresponding target field, and then a second URL address is acquired based on the original character string and the corresponding target field.
Fig. 2 is a flowchart of a file processing method according to an embodiment of the present disclosure. As shown in fig. 2, performed by a client, the method comprises the steps of:
s201, acquiring a query request.
The query request comprises a file identifier of the target file to be queried.
In the embodiment of the present disclosure, the implementation method of step S201 may be implemented in any manner in each embodiment of the present disclosure, which is not limited herein, and is not described herein again.
S202, sending a query request to a server, and receiving an encrypted character string of a target file returned by the server, wherein the encrypted character string is generated based on an actual first URL address of the target file.
In the embodiment of the present disclosure, the implementation method of step S202 may be implemented in any manner in each embodiment of the present disclosure, which is not limited herein, and is not described herein again.
S203, an original character string corresponding to the encrypted character string is obtained, and a target field is determined according to the encrypted character string.
In the embodiment of the present disclosure, the implementation method of step S203 may be implemented in any manner in each embodiment of the present disclosure, which is not limited herein, and is not described herein again.
S204, inputting the original character string and the target field into a constructor to obtain a class file object.
Alternatively, the constructors may be binary large object (Binary Large Object, blob) constructors, so that class file objects, i.e., blob objects derived from the Blob constructors. It is understood that a class file object refers to a file-like object, and a Blob object is a class file object containing read-only raw data, and is a class file object of immutable raw data.
The Blob constructor may receive two parameters, parameter one is typically a string or binary object, parameter two is a configuration item, and currently there is only one attribute type; the target field in the embodiment of the present disclosure may be determined by the file type, that is, the type of the file, so that the embodiment of the present disclosure inputs the original string and the target field into the Blob building function, and may obtain the corresponding Blob object.
S205, inputting the class file object into the Uniform resource locator creation sentence, and outputting a second URL address.
After the class file object, namely the Blob object is determined according to the original character string and the target field, a second URL address of the target file is determined according to the Blob object, and key information of the target file, such as the name of the target file and necessary parameters, is removed from the second URL address, so that the aim of keeping the target file secret is fulfilled.
Alternatively, the second URL address may be obtained by using a URL creation statement, for example, the Blob Object is input into the window URL/create Object URL () method, which is used to create a URL containing the specified Object, and the method may return a Blob URL through which the specified Object may be accessed, that is, the Blob Object is input into the window URL/create Object URL () method, and the second URL address of the target file may be output, through which the target file may be accessed.
It can be understood that the second URL is a URL address created by the window URL address creation method, which is different from the actual first URL address of the target file, and key information in the first URL address is removed from the second URL address.
In the embodiment of the disclosure, after the original character string and the target field are determined, constructing the Blob object according to the original character string and the target field, wherein the Blob object comprises the basic information of the target file, creating the second URL address according to the Blob object to obtain a new second URL address which can be accessed to the target file, removing the key information in the first URL address from the second URL address, realizing good hiding of the key information of the target file, and improving the access privacy and security of the target file.
Fig. 3 is a flowchart of a file processing method according to an embodiment of the present disclosure. As shown in fig. 3, performed by a client, the method comprises the steps of:
s301, acquiring a query request.
The query request comprises a file identifier of the target file to be queried.
In the embodiment of the present disclosure, the implementation method of step S301 may be implemented in any manner in each embodiment of the present disclosure, which is not limited herein, and is not described herein again.
S302, sending a query request to a server, and receiving an encrypted character string of a target file returned by the server, wherein the encrypted character string is generated based on an actual first URL address of the target file.
In the embodiment of the present disclosure, the implementation method of step S302 may be implemented in any manner in each embodiment of the present disclosure, which is not limited herein, and is not described herein again.
S303, decrypting the encrypted character string to obtain an original character string corresponding to the encrypted character string.
In the embodiment of the disclosure, the encrypted string received back from the server is base64 encoded, so that the base64 encoded data may be decoded, that is, the encrypted string may be decrypted.
Alternatively, base64 encoding may be converted into a binary stream of files by the atob function, i.e., decoded into the original string.
In some embodiments, the decoded binary stream, i.e., the original string, may be stored in a unit8Array, where the unit8Array is capable of buffering binary data, such as images and files, while avoiding wasting memory storing the string.
S304, determining the file type of the target file according to the encrypted character string.
Optionally, a keyword set of different file types can be obtained, wherein the keyword set comprises first keywords of different types; keyword recognition is carried out on the encrypted character string, and a second keyword in the encrypted character string is obtained; and comparing the second keywords with the first keywords, if one of the first keywords in the keyword set is the same as the second keywords, determining the file type corresponding to one of the first keywords, and determining the file type corresponding to the first keywords as the file type of the target file. That is, the respective first keywords of different types are put into the keyword set; and carrying out keyword recognition on the encrypted character string to obtain a second keyword, comparing the second keyword with the first keywords in the keyword set, and if the second keyword is the same as one of the first keywords in the keyword set, taking the type corresponding to the first keyword as the file type of the target file.
In some embodiments, the first key of the different file types may be determined based on the file type, e.g., the first key of the word type is doc and the first key of the excel type is exe.
S305, determining a target field based on the file type.
Optionally, an association set of different file types and fields may be obtained; and querying the association set, and determining a field which is associated with the file type of the target file as a target field.
In some embodiments, the file types may be associated with corresponding fields, respectively, to create an association set of different file types and fields, e.g., when the file type is pdf, the corresponding field may be "application/pdf"; when the file type is excel, the corresponding field can be "application/vnd.ms-excel"; when the file type is word, the corresponding field can be "application/msword; charset=utf-8 ".
After determining the file type of the target file, inquiring the file type in the association set to obtain a field associated with the file type, wherein the field is a target field of the target file; that is, assuming that the file type of the target file is pdf, the target field corresponding to the target file is "application/pdf".
S306, determining a second URL address which corresponds to the first URL address and is used for removing the key information based on the original character string and the target field.
In the embodiment of the present disclosure, the implementation method of step S306 may be implemented in any manner in each embodiment of the present disclosure, which is not limited herein, and is not repeated herein.
In the embodiment of the disclosure, the original character string is determined by decrypting the encrypted character string, the file type corresponding to the target file is obtained according to the original character string, the target field corresponding to the target file is obtained according to the association relationship between the file type and the field, a more accurate basis is provided for the subsequent acquisition of the second URL address, and the second URL address can be ensured to accurately access the corresponding target file while key information is removed.
Fig. 4 is a flowchart of a file processing method according to an embodiment of the present disclosure. As shown in fig. 4, performed by a client, the method comprises the steps of:
s401, acquiring a query request.
The query request comprises a file identifier of the target file to be queried.
In the embodiment of the present disclosure, the implementation method of step S401 may be implemented in any manner in each embodiment of the present disclosure, which is not limited herein, and is not described herein again.
S402, sending the query request to the server, and receiving an encrypted character string of the target file returned by the server, wherein the encrypted character string is generated based on the actual first URL address of the target file.
In the embodiment of the present disclosure, the implementation method of step S402 may be implemented in any manner in each embodiment of the present disclosure, which is not limited herein, and is not described herein again.
S403, acquiring an original character string corresponding to the encrypted character string, and determining a target field according to the encrypted character string.
In the embodiment of the present disclosure, the implementation method of step S403 may be implemented in any manner in each embodiment of the present disclosure, which is not limited herein, and is not described herein again.
S404, determining a second URL address which is corresponding to the first URL address and is used for removing the key information based on the original character string and the target field.
In the embodiment of the present disclosure, the implementation method of step S404 may be implemented in any manner in each embodiment of the present disclosure, which is not limited herein, and is not described herein again.
S405, in response to detecting the function triggering instruction, inputting a second URL address into the function component, and executing the triggered target function on the target file by the function component, wherein the target function comprises one or more functions of previewing, downloading and printing.
Alternatively, the function trigger instruction may be clicking on the corresponding function button, when clicking on the function button is detected, that is, the function trigger instruction is detected. Alternatively, the function buttons may include one or more of preview, download, and print.
In some embodiments, if the currently detected function trigger instruction is preview, a popup window may be set for previewing the target file. Optionally, the preview function can be implemented by using a dialog box of the elementUI component; an iframe of the embedded frame is arranged in the popup window, and the iframe can realize the function of previewing of the browser, namely, the second URL address is input into the iframe, namely, the content of the target file corresponding to the second URL address can be obtained by searching and browsed.
Optionally, a ref attribute may also be set, where the ref attribute is used to register reference information (id's substitute) for the element or sub-component, which is equivalent to identifying the page element or sub-component, so as to obtain the iframe through the ref attribute, so as to browse the target file.
In some embodiments, if the function trigger instruction is currently detected to be downloading, the file type of the target file is not required to be considered during downloading, so that the URL address corresponding to the target file can be redetermined, and the downloading purpose is achieved. Alternatively, a corresponding hyperlink URL address may be created to implement the download function; the original character string corresponding to the target file can be input into the Blob constructor, a new Blob object is output, a URL.createobjectURL method is further called, and the new Blob object is input into the method statement to obtain the hyperlink URL address.
After determining the hyperlink URL address, creating an a tag element in the page document, endowing the created hyperlink URL address with the URL address of the tag element a, and endowing the file name of the downloaded target file with the downloading download of the tag element a; considering that the tag element a is used for simulating downloading, the attribute of the tag element a can be set to none, namely the attribute of the tag element a is hidden, and finally the downloading purpose is achieved by calling a click method. Further, the memory of the downloading operation can be released by a window.url.revokinobjecturl method.
In some embodiments, if the function trigger instruction is currently detected to be printing, that is, the target file is determined according to the second URL address, and the target file is printed. Optionally, the method can be implemented based on a self-contained printing method of the client, for example, the browser can call the self-contained printing method to achieve the purpose of printing, for example, the printing function of the client is called through a set shortcut key ctrl+p, so as to print the target file.
Optionally, a protocol frame agreentframe may be set, where agreentframe is a ref attribute of an iframe of the display content, and by acquiring the iframe and reading a content window attribute, a window attribute of the iframe is obtained. Further, a focus method of the window can be called, that is, a focus is set as a current window, so that the current window is displayed at the forefront end, and a printing method is called to print the content of the current window, that is, the content of the printing target file; further, after printing is executed, the print popup window is closed, and printing is finished.
In the embodiment of the disclosure, after the second URL address of the target file is determined, whether a further function instruction exists is detected, when a function trigger instruction is detected, a corresponding function is executed based on the second URL address, that is, a preview function, a printing function or a downloading function is executed, and in the process of executing different functions, since the second URL address hides the key information of the target file, the key information is not leaked, and meanwhile, the target file can be accurately accessed according to the URL address corresponding to the target file, so that the correct implementation of each function is ensured.
Fig. 5 is a flowchart of a file processing method according to an embodiment of the present disclosure. As shown in fig. 5, performed by a client, the method comprises the steps of:
s501, acquiring a query request.
The query request comprises a file identifier of the target file to be queried.
In the embodiment of the present disclosure, the implementation method of step S501 may be implemented in any manner in each embodiment of the present disclosure, which is not limited herein, and is not described herein again.
S502, sending a query request to a server, and receiving an encrypted character string of a target file returned by the server, wherein the encrypted character string is generated based on an actual first URL address of the target file.
In the embodiment of the present disclosure, the implementation method of step S502 may be implemented in any manner in each embodiment of the present disclosure, which is not limited herein, and is not described herein again.
S503, decrypting the encrypted character string to obtain an original character string corresponding to the encrypted character string.
In the embodiment of the present disclosure, the implementation method of step S503 may be implemented in any manner in each embodiment of the present disclosure, which is not limited herein, and is not described herein again.
S504, determining the file type of the target file according to the encrypted character string.
In the embodiment of the present disclosure, the implementation method of step S504 may be implemented in any manner in each embodiment of the present disclosure, which is not limited herein, and is not described herein again.
S505, determining a target field based on the file type.
In the embodiment of the present disclosure, the implementation method of step S505 may be implemented in any manner of each embodiment of the present disclosure, which is not limited herein, and is not described herein again.
S506, inputting the original character string and the target field into a constructor to obtain a class file object.
In the embodiment of the present disclosure, the implementation method of step S506 may be implemented in any manner in each embodiment of the present disclosure, which is not limited herein, and is not described herein again.
S507, inputting the class file object into the Uniform resource locator creation sentence, and outputting a second URL address.
In the embodiment of the present disclosure, the implementation method of step S507 may be implemented in any manner of each embodiment of the present disclosure, which is not limited herein, and is not described herein again.
And S508, responding to the detection of the function triggering instruction, inputting a second URL address into the function component, and executing the triggered target function on the target file by the function component, wherein the target function comprises one or more functions of previewing, downloading and printing.
In the embodiment of the present disclosure, the implementation method of step S508 may be implemented in any manner in each embodiment of the present disclosure, which is not limited herein, and is not described herein again.
In the embodiment of the disclosure, an encrypted character string corresponding to a target file is obtained according to a query request, an original character string is determined by decrypting the encrypted character string, a file type corresponding to the target file is obtained according to the original character string, a target field corresponding to the target file is obtained according to an association relation between the file type and the field, a more accurate basis is provided for obtaining a subsequent second URL address, a Blob object is constructed according to the original character string and the target field, a new second URL address which can be accessed to the target file is obtained, key information in the first URL address is removed from the second URL address, good hiding of the key information of the target file is realized, privacy and security of access to the target file are improved, and confidentiality is stronger; and whether further function instructions exist is continuously detected, when the function trigger instruction is detected, the corresponding functions are executed based on the second URL address, so that key information cannot be leaked, the target file can be accurately accessed according to the URL address corresponding to the target file, and the correct implementation of each function is ensured.
Fig. 6 is a flowchart of another file processing method provided in an embodiment of the present disclosure. As shown in fig. 6, the method is executed by the server, and includes the following steps:
s601, receiving a query request sent by a client.
The query request comprises a file identifier of the target file to be queried.
Alternatively, the file identifier may include information such as a file name of the target file and content of the target file. The query request is used for acquiring a file to be queried.
S602, determining a corresponding target file according to the query request.
In some embodiments, after receiving a query request sent by a client, the target file with the highest matching degree with the query request may be obtained by searching in a corresponding database or file library according to the file name and content included in the query request.
S603, encrypting the actual first URL address of the target file and the content of the target file to obtain an encrypted character string, and sending the encrypted character string to the client.
After determining the target file corresponding to the query request, encrypting the actual first URL address of the target file and the content of the target file in order to ensure the safety of the content of the target file.
Alternatively, encryption processing may be performed using the cryptographic asymmetric encryption algorithm SM2 or the symmetric encryption algorithm SM 4.
And after encrypting the actual first URL address of the target file and the content of the target file, obtaining a corresponding encrypted character string, and returning the encrypted character string to the client.
In the embodiment of the disclosure, after receiving the query request of the client, the corresponding target file is obtained, the related information of the target file is encrypted, and the encrypted character string is returned to the client, so that the safety of the information in the target file is ensured.
Fig. 7 is a block diagram of a file processing apparatus according to an embodiment of the present disclosure. As shown in fig. 7, a file processing apparatus 700 of an embodiment of the present disclosure, executed by a client, includes:
a first obtaining module 701, configured to obtain a query request, where the query request includes a file identifier of a target file to be queried;
the second obtaining module 702 is configured to send a query request to a server, and receive an encrypted string of a target file returned by the server, where the encrypted string is generated based on an actual first URL address of the target file;
a third obtaining module 703, configured to obtain an original string corresponding to the encrypted string, and determine a target field according to the encrypted string;
The fourth obtaining module 704 is configured to determine, based on the original string and the target field, a second URL address corresponding to the first URL address, where the key information is removed.
In some implementations, the fourth acquisition module 704 includes:
inputting the original character string and the target field into a construction function to obtain a class file object;
and inputting the class file object into a Uniform resource locator creation sentence, and outputting a second URL address.
In some implementations, the third acquisition module 703 includes:
and decrypting the encrypted character string to obtain an original character string corresponding to the encrypted character string.
In some implementations, the third acquisition module 703 includes:
determining the file type of the target file according to the encrypted character string;
based on the file type, a target field is determined.
In some implementations, the third acquisition module 703 includes:
acquiring keyword sets of different file types, wherein the keyword sets comprise first keywords of different types;
keyword recognition is carried out on the encrypted character string, and a second keyword in the encrypted character string is obtained;
the second keyword is compared with the first keyword,
if one of the first keywords in the keyword set is the same as the second keywords, determining the file type corresponding to the one of the first keywords, and determining the file type corresponding to the first keywords as the file type of the target file.
In some implementations, the third acquisition module 703 includes:
acquiring an association set of different file types and fields;
and querying the association set, and determining a field which is associated with the file type of the target file as a target field.
In some implementations, the fourth acquisition module 704 further includes:
in response to detecting the function triggering instruction, a second URL address is input into the function component, and the function component performs the triggered target function on the target file, wherein the target function includes one or more of preview, download and print functions.
In the embodiment of the disclosure, a query request is acquired and sent to a server, an encrypted character string corresponding to a target file is requested, the encrypted character string comprises basic information of the target file, the safety of related information of the target file in the sending and receiving processes is guaranteed, after the encrypted character string is acquired, the original character string and a corresponding target field are acquired by processing the encrypted character string, and further, a second URL address is acquired based on the original character string and the corresponding target field.
Fig. 8 is a block diagram of another document processing apparatus according to an embodiment of the present disclosure. As shown in fig. 8, a file processing apparatus 800 according to an embodiment of the present disclosure is executed by a server, and includes:
a receiving module 801, configured to receive a query request sent by a client;
an obtaining module 802, configured to determine a corresponding target file according to the query request;
and the sending module 803 is configured to encrypt the actual first URL address of the target file and the content of the target file, obtain an encrypted string, and send the encrypted string to the client.
In the embodiment of the disclosure, after receiving the query request of the client, the corresponding target file is obtained, the related information of the target file is encrypted, and the encrypted character string is returned to the client, so that the safety of the information in the target file is ensured.
Fig. 9 is a block diagram of an electronic device, according to an example embodiment. As shown in fig. 9, the electronic device 900 includes:
memory 910 and processor 920, bus 930 connecting the different components (including memory 910 and processor 920), memory 910 storing a computer program that when executed by processor 920 implements the file processing method described in the embodiments of the present disclosure.
Bus 930 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 900 typically includes a variety of electronic device readable media. Such media can be any available media that is accessible by electronic device 900 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 910 may also include computer-system readable media in the form of volatile memory such as Random Access Memory (RAM) 940 and/or cache memory 950. The electronic device 900 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 960 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 9, commonly referred to as a "hard disk drive"). Although not shown in fig. 9, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 930 via one or more data medium interfaces. Memory 910 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the various embodiments of the disclosure.
A program/utility 980 having a set (at least one) of program modules 970 may be stored, for example, in memory 910, such program modules 970 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 970 generally perform the functions and/or methods in the embodiments described in this disclosure.
The electronic device 900 may also communicate with one or more external devices 990 (e.g., keyboard, pointing device, display 991, etc.), one or more devices that enable a user to interact with the electronic device 900, and/or any devices (e.g., network card, modem, etc.) that enable the electronic device 900 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 992. Also, the electronic device 900 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through a network adapter 993. As shown in fig. 9, the network adapter 993 communicates with other modules of the electronic device 900 over the bus 930. It should be appreciated that although not shown in fig. 9, other hardware and/or software modules may be used in connection with electronic device 900, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processor 920 performs various functional applications and data processing by running programs stored in the memory 910.
It should be noted that, the implementation process and the technical principle of the electronic device in this embodiment refer to the foregoing explanation of the file processing method in the embodiment of the disclosure, and are not repeated herein.
To achieve the above embodiments, the present disclosure also proposes a computer-readable storage medium.
Wherein the instructions in the computer-readable storage medium, when executed by a processor of the service server, enable the service server to perform the file processing method as described above. Alternatively, the computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
To achieve the above embodiments, the present disclosure further provides a computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements a file processing method as described above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims. It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (11)

1. A method of file processing performed by a client, comprising:
acquiring a query request, wherein the query request comprises a file identifier of a target file to be queried;
sending the query request to a server, and receiving an encrypted character string of the target file returned by the server, wherein the encrypted character string is generated based on an actual first URL address of the target file;
acquiring an original character string corresponding to the encrypted character string, and determining a target field according to the encrypted character string;
and determining a second URL address which corresponds to the first URL address and is used for removing key information based on the original character string and the target field.
2. The method of claim 1, wherein the determining a second URL address of the first URL address from which key information is removed based on the original string and the target field comprises:
inputting the original character string and the target field into a constructor to obtain a class file object;
and inputting the class file object into a Uniform resource locator creation sentence, and outputting the second URL address.
3. The method according to claim 2, wherein the obtaining the original string corresponding to the encrypted string includes:
And decrypting the encrypted character string to obtain an original character string corresponding to the encrypted character string.
4. The method of claim 2, wherein said determining a target field from said encrypted string comprises:
determining the file type of the target file according to the encrypted character string;
the target field is determined based on the file type.
5. The method of claim 4, wherein determining the file type of the target file based on the encrypted string comprises:
acquiring keyword sets of different file types, wherein the keyword sets comprise first keywords of different types;
keyword recognition is carried out on the encrypted character string, and a second keyword in the encrypted character string is obtained;
comparing the second keyword with the first keyword,
if one of the first keywords in the keyword set is the same as the second keyword, determining the file type corresponding to the one of the first keywords, and determining the file type corresponding to the first keyword as the file type of the target file.
6. The method of claim 5, wherein the determining the target field based on the file type comprises:
Acquiring an association set of different file types and fields;
and querying the association set, and determining a field which is associated with the file type of the target file as the target field.
7. The method according to any one of claims 1-6, wherein after determining a second URL address corresponding to the first URL address from which key information is removed based on the original string and the target field, further comprising:
in response to detecting a function trigger instruction, the second URL address is input into the function component, which performs a triggered target function on the target file, wherein the target function includes one or more of preview, download, and print.
8. A document processing apparatus, characterized by being executed by a client, comprising:
the first acquisition module is used for acquiring a query request, wherein the query request comprises a file identifier of a target file to be queried;
the second acquisition module is used for sending the query request to a server and receiving an encrypted character string of the target file returned by the server, wherein the encrypted character string is generated based on an actual first URL address of the target file;
The third acquisition module is used for acquiring an original character string corresponding to the encrypted character string and determining a target field according to the encrypted character string;
and the fourth acquisition module is used for determining a second URL address which corresponds to the first URL address and is used for removing key information based on the original character string and the target field.
9. An electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored in the memory to implement the method of any one of claims 1-7.
10. A computer readable storage medium having stored therein computer executable instructions which when executed by a processor are adapted to carry out the method of any one of claims 1-7.
11. A computer program product comprising a computer program which, when executed by a processor, implements the method of any of claims 1-7.
CN202311344726.2A 2023-10-17 2023-10-17 File processing method and device, electronic equipment and storage medium Pending CN117521125A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311344726.2A CN117521125A (en) 2023-10-17 2023-10-17 File processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311344726.2A CN117521125A (en) 2023-10-17 2023-10-17 File processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117521125A true CN117521125A (en) 2024-02-06

Family

ID=89742779

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311344726.2A Pending CN117521125A (en) 2023-10-17 2023-10-17 File processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117521125A (en)

Similar Documents

Publication Publication Date Title
JP6926429B2 (en) Data processing equipment, data processing methods, and programs
JP4470069B2 (en) Input assist device, input assist system, input assist method, and input assist program
JP5735539B2 (en) System, apparatus and method for encrypting and decrypting data transmitted over a network
US20070174762A1 (en) Personal web page annotation system
US8250466B2 (en) Computer and method for converting a web page
WO2015179286A1 (en) Polymorphic treatment of data entered at clients
US20090300481A1 (en) Server apparatus, information processing apparatus, data processing method, and storage medium including program
US8887290B1 (en) Method and system for content protection for a browser based content viewer
US20130024769A1 (en) Apparatus and method for processing a document
CN111638908A (en) Interface document generation method and device, electronic equipment and medium
WO2023092580A1 (en) Page display method and apparatus, storage medium, and electronic device
CN103095663A (en) Information interactive method among non-login users and device
CN105354506B (en) The method and apparatus of hidden file
CN111783119A (en) Form data security control method and device, electronic equipment and storage medium
US10664538B1 (en) Data security and data access auditing for network accessible content
US20110231801A1 (en) Method and system for processing information fed via an inputting means
CN117521125A (en) File processing method and device, electronic equipment and storage medium
CN112182603B (en) Anti-crawler method and device
US20210006634A1 (en) Secure and private web browsing system and method
WO2019019650A1 (en) Website data processing method and apparatus, website data processing platform and storage medium
TWI742429B (en) System for displaying signature message of portable document format file in web page and method thereof
US20210240956A1 (en) Systems and methods for encoding executable code in barcodes
JP4607023B2 (en) Log collection system and log collection method
CN108710699B (en) Dynamic password generation method, device and system
JP2003228507A (en) Device and method for file management

Legal Events

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