File generation method, system and electronic device
By using variable tag generation encryption strategy during file generation, sensitive data is automatically desensitized, and the problem of inefficiency in the existing technology is solved, and the automatic acquisition and desensitization of sensitive data is realized.
Patent Information
- Application Number
- CN202410894678.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2044-07-04
AI Technical Summary
In the prior art, the desensitization of sensitive data is inefficient and requires manual editing, which is laborious.
By obtaining the file template and characterizing it, variable labels are determined, desensitized labels are constructed and saved to the database, and the file template and its case information are automatically encrypted and updated using the encryption strategy, and finally the encrypted file is generated.
Automatic acquisition and desensitization of sensitive data is realized, processing efficiency is improved, and the problem of inefficiency in the prior art is solved.
Smart Images

Figure CN118839372B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of file processing, and in particular to a file generation method, system and electronic equipment. Background Art
[0002] For documents containing sensitive information, accurately capturing and effectively desensitizing sensitive data is crucial for improving file security. For instance, in trial systems, numerous legal documents are involved at various stages of a case, often containing sensitive information about the plaintiff or defendant, such as mobile phone numbers and ID numbers, which requires processing.
[0003] In existing technologies, desensitizing such data requires manual editing, which is time-consuming, labor-intensive and inefficient. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a file generation method, system and electronic device, which can use the variable tags of the relevant document files to generate corresponding encryption strategies, and use the encryption strategies to automatically desensitize the relevant sensitive texts, thereby realizing the automatic acquisition and automatic desensitization process of sensitive data, and solving the problem of low processing efficiency in the prior art when desensitizing sensitive data.
[0005] In a first aspect, an embodiment of the present invention provides a file generation method, the method comprising:
[0006] Obtain a preset file template, perform character processing on the file template, and then determine the variable labels contained in the file template;
[0007] Constructing a desensitizing label corresponding to the file template based on the variable label, and saving the desensitizing label and the file template into a database; wherein the database contains case information corresponding to the file template;
[0008] Using the received file generation instruction, determining case information corresponding to the file generation instruction from a database, and determining a corresponding file template based on the case information;
[0009] Generate a variable encryption strategy for the file template using the desensitizing tag corresponding to the file template, and encrypt and update the file template and its corresponding case information in the database using the variable encryption strategy;
[0010] A response result corresponding to the file generation instruction is generated based on the encrypted and updated file template and case information, and a file corresponding to the file generation instruction is generated based on the response result.
[0011] In one embodiment, the step of obtaining a preset file template, performing character processing on the file template, and then determining the variable labels included in the file template includes:
[0012] Determine and obtain the file template according to the preset string format requirements;
[0013] After formatting the file template based on HTML format requirements, obtain the HTML string contained in the file template;
[0014] Traverse the tag data contained in the html string and determine the variable tags contained in the file template according to the tag data.
[0015] In one embodiment, the steps of constructing a desensitizing label corresponding to a file template based on a variable label and saving the desensitizing label and the file template in a database include:
[0016] Obtain the content attribute parameters corresponding to the variable labels, and determine the desensitized content corresponding to the content attribute parameters;
[0017] Generate a desensitizing label corresponding to the file template using the desensitizing content, and associate the desensitizing label with the file template;
[0018] Save the associated desensitized labels and file templates to the database.
[0019] In one embodiment, the steps of using the received file generation instruction to determine case information corresponding to the file generation instruction from a database, and determining a corresponding file template based on the case information include:
[0020] Obtain a preset file generation page and determine the file generation button included in the file generation page;
[0021] Receive the click event of the file generation button in real time, and generate the corresponding file generation instruction based on the click event;
[0022] Use the file generation instruction to obtain the data reading statement corresponding to the database, and obtain case information from the database according to the data reading statement;
[0023] Determine the file template corresponding to the case information.
[0024] In one embodiment, a variable encryption strategy for a file template is generated using a desensitizing tag corresponding to the file template, including:
[0025] Determine the case information corresponding to the file template based on the desensitizing label;
[0026] Generate a dynamic key corresponding to the file generation instruction using the variable value and generation time contained in the case information;
[0027] Generates a variable encryption strategy for the file template based on the AES symmetric encryption calculation result of the dynamic key.
[0028] In one embodiment, the file template and its corresponding case information in the database are encrypted and updated using a variable encryption strategy, including:
[0029] After performing AES symmetric encryption on the case information according to the variable encryption strategy, the encrypted string corresponding to the case information is obtained;
[0030] Replace the case information corresponding to the file template in the database with the encrypted string.
[0031] In one embodiment, generating a response result corresponding to the file generation instruction based on the encrypted and updated file template and case information includes:
[0032] Determine the encrypted string corresponding to the variable value based on the generation time contained in the case information after the encrypted update;
[0033] Use the encryption strategy to perform inverse operations on the encrypted string to obtain the original case information corresponding to the encrypted string;
[0034] Determine the response result corresponding to the file generation instruction based on the original case information.
[0035] In one embodiment, generating a file corresponding to a file generation instruction based on the response result includes:
[0036] Obtain the original case information contained in the response result and save the original case information to an initialized text file;
[0037] After converting the text file into a portable file format, a file corresponding to the file generation instruction is obtained.
[0038] In a second aspect, an embodiment of the present invention provides a file generation system, the system comprising:
[0039] The variable label acquisition unit is used to acquire a preset file template, perform character processing on the file template, and determine the variable labels contained in the file template;
[0040] a desensitizing label determination unit, configured to construct a desensitizing label corresponding to the file template based on the variable label, and save the desensitizing label and the file template into a database; wherein the database includes case information corresponding to the file template;
[0041] a case information processing unit, configured to use the received file generation instruction to determine case information corresponding to the file generation instruction from a database, and determine a corresponding file template based on the case information;
[0042] An encryption strategy generation module is used to generate a variable encryption strategy for a file template using the desensitizing tag corresponding to the file template, and to encrypt and update the file template and its corresponding case information in the database using the variable encryption strategy;
[0043] The file generation processing module is used to generate a response result corresponding to the file generation instruction based on the encrypted and updated file template and case information, and generate a file corresponding to the file generation instruction based on the response result.
[0044] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the steps of the file generation method provided in the first aspect.
[0045] In a fourth aspect, an embodiment of the present invention further provides a storage medium storing computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the steps of the file generation method provided in the first aspect.
[0046] The present invention provides a file generation method, system and electronic device. In the process of desensitizing a relevant document file, the method first obtains a preset document template, and after characterizing the document template, determines the variable label contained in the document template; then constructs a desensitizing label corresponding to the document template based on the variable label, and saves the desensitizing label and the document template to a database; wherein the database contains case information corresponding to the document template; then, using the received document generation instruction, determines the case information corresponding to the document generation instruction from the database, and determines the corresponding document template based on the case information; then, using the desensitizing label corresponding to the document template, generates a variable encryption strategy for the document template, and encrypts and updates the document template and its corresponding case information in the database using the variable encryption strategy; finally, generates a response result corresponding to the document generation instruction based on the encrypted and updated document template and case information, and generates a file corresponding to the document generation instruction based on the response result. The method can generate a corresponding encryption strategy using its variable label during the process of generating the relevant document file, and automatically desensitize the relevant sensitive text using the encryption strategy, thereby realizing the automatic acquisition and automatic desensitization process of sensitive data, solving the problem of low processing efficiency in the prior art when desensitizing sensitive data.
[0047] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or understood by practicing the present invention. The purposes and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0048] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0050] Figure 1 A flowchart of a file generation method provided by an embodiment of the present invention;
[0051] Figure 2 A flowchart of step S101 in a file generation method provided in an embodiment of the present invention;
[0052] Figure 3 A flowchart of step S102 in a file generation method provided in an embodiment of the present invention;
[0053] Figure 4 A flowchart of step S103 in a file generation method provided in an embodiment of the present invention;
[0054] Figure 5 A flowchart of a variable encryption strategy for generating a file template using a desensitizing tag corresponding to the file template in a file generation method provided by an embodiment of the present invention;
[0055] Figure 6 A flowchart of encrypting and updating a file template and its corresponding case information in a database using a variable encryption strategy in a file generation method provided by an embodiment of the present invention;
[0056] Figure 7 A flowchart of a file generation method according to an embodiment of the present invention for generating a response result corresponding to a file generation instruction based on a file template and case information after encryption and update;
[0057] Figure 8 A flowchart of generating a file corresponding to a file generation instruction based on a response result in a file generation method provided by an embodiment of the present invention;
[0058] Figure 9 A schematic diagram of the structure of a file generation system provided by an embodiment of the present invention;
[0059] Figure 10 A schematic structural diagram of an electronic device provided by an embodiment of the present invention.
[0060] icon:
[0061] 910 - variable label acquisition unit; 920 - desensitization label determination unit; 930 - case information processing unit; 940 - encryption strategy generation module; 950 - file generation processing module;
[0062] 101 - processor; 102 - memory; 103 - bus; 104 - communication interface. DETAILED DESCRIPTION
[0063] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0064] For documents containing sensitive information, accurately capturing and effectively desensitizing sensitive data is crucial for improving file security. For instance, in trial systems, numerous legal documents are involved at various stages of a case, often containing sensitive information about the plaintiff or defendant, such as mobile phone numbers and ID numbers, which requires processing.
[0065] In the prior art, desensitizing such data requires manual editing, which is time-consuming, labor-intensive, and inefficient. Based on this, the present invention provides a file generation method, system, and electronic device. This method can generate corresponding encryption strategies using variable tags during the generation of relevant document files, and automatically desensitize relevant sensitive text using the encryption strategies, thereby achieving automatic acquisition and desensitization of sensitive data, solving the problem of low processing efficiency in the prior art when desensitizing sensitive data.
[0066] To facilitate understanding of this embodiment, a file generation method disclosed in an embodiment of the present invention is first described in detail. Figure 1 Shown, including:
[0067] Step S101, obtaining a preset file template, performing character processing on the file template, and determining variable labels contained in the file template;
[0068] Step S102: constructing a desensitizing label corresponding to the document template based on the variable label, and saving the desensitizing label and the document template into a database; wherein the database contains case information corresponding to the document template;
[0069] Step S103, using the received file generation instruction, determining the case information corresponding to the file generation instruction from the database, and determining the corresponding file template according to the case information;
[0070] Step S104: Generate a variable encryption strategy for the file template using the desensitizing tag corresponding to the file template, and encrypt and update the file template and its corresponding case information in the database using the variable encryption strategy;
[0071] Step S105: Generate a response result corresponding to the file generation instruction according to the encrypted and updated file template and case information, and generate a file corresponding to the file generation instruction based on the response result.
[0072] In practical scenarios, this method can be used in document processing systems to desensitize sensitive information within documents. First, a document module is set up within the system to retrieve a preset document template. Because document templates inherently contain various characters, the document templates must be characterized after being retrieved. The characters within the document template are then extracted to obtain the variable labels.
[0073] The content of a variable label can represent the sensitivity of the variable, such as plaintiff information or defendant information. The content corresponding to the variable label is the information that needs to be desensitized. Therefore, the corresponding desensitization label can be first calculated based on the variable label and then stored in a pre-run database. This database contains case information corresponding to the document template. At this point, the case information in the database corresponds to the document template and the desensitization label.
[0074] When case information in the database needs to be accessed, the received file generation instruction is first used to determine whether the variable tag corresponding to the case information has special attributes that require desensitization. If so, it is encrypted and desensitized. In the specific implementation process, the case information corresponding to the file generation instruction is first determined from the database, and then the corresponding file template is determined. Then, the variable encryption strategy for the file template is generated based on the desensitization tag corresponding to the file template. The encryption strategy encrypts the variable values corresponding to the case information, generating a specific encrypted string, which is then used to update the corresponding case information in the database.
[0075] At this point, the database has been desensitized. When the result of a file generation instruction is needed, the encrypted and updated file template and case information are retrieved from the database. The encrypted case information is then decrypted using the encryption strategy to obtain the response to the file generation instruction. This response is then used to generate the final file according to the specified file format requirements.
[0076] In one embodiment, a preset file template is obtained, and after the file template is characterized, step S101 of determining the variable labels included in the file template is performed. Figure 2 Shown, including:
[0077] Step S201, determining and obtaining a file template according to a preset string format requirement;
[0078] Step S202: After formatting the file template based on HTML format requirements, obtain the HTML string contained in the file template;
[0079] Step S203: traverse the tag data contained in the HTML character string, and determine the variable tags contained in the file template according to the tag data.
[0080] The document template for this document processing system is an HTML string. HTML (Hypertext Markup Language) strings are commonly found in webpages, and their built-in tags facilitate the setting of tag data, thereby setting corresponding variable labels. In the actual processing process, the document template is first formatted according to HTML formatting requirements to obtain a complete string. The tag data contained in the HTML string is then traversed to determine the corresponding variable labels.
[0081] In one embodiment, a desensitizing label corresponding to the file template is constructed based on the variable label, and the desensitizing label and the file template are saved in step S102 of the database, such as Figure 3 Shown, including:
[0082] Step S301: Obtain content attribute parameters corresponding to the variable tags, and determine the desensitized content corresponding to the content attribute parameters;
[0083] Step S302: Generate a desensitizing label corresponding to the file template using the desensitized content, and associate the desensitizing label with the file template;
[0084] Step S303: Save the associated desensitized label and file template into the database.
[0085] In a specific scenario, a document template is set up in the document system. This template is an HTML string. After adding a desensitizing attribute to variable tags, such as defendant information and plaintiff information, the template is saved to the database. The content attribute parameters corresponding to the variable tags are obtained to determine the desensitized content corresponding to the content attribute parameters. The corresponding desensitizing label is then generated and the two are associated. The associated desensitizing label and document template are uploaded to the database for storage, including information such as the plaintiff and defendant.
[0086] In one embodiment, the received file generation instruction is used to determine the case information corresponding to the file generation instruction from the database, and the step S103 of determining the corresponding file template according to the case information is performed. Figure 4 Shown, including:
[0087] Step S401, obtaining a preset file generation page and determining a file generation button included in the file generation page;
[0088] Step S402: receiving a click event of a file generation button in real time, and generating a corresponding file generation instruction based on the click event;
[0089] Step S403: using the file generation instruction to obtain a data read statement corresponding to the database, and obtaining case information from the database according to the data read statement;
[0090] Step S404: Determine the file template corresponding to the case information.
[0091] A corresponding file generation page is set up in the document system, and a corresponding file generation button can also be set. By clicking the file generation button, the corresponding click event is obtained, and then a file generation instruction is generated based on the response result of the click event. The file generation instruction is used to generate the corresponding data reading statement of the database, and then the corresponding case information is read from the database, and finally the file template corresponding to the case information is determined.
[0092] In one embodiment, the variable encryption strategy of the file template is generated by the desensitization tag corresponding to the file template, such as Figure 5 Shown, including:
[0093] Step S501, determining the case information corresponding to the file template according to the desensitization label;
[0094] Step S502: Generate a dynamic key corresponding to the file generation instruction using the variable value and generation time included in the case information;
[0095] Step S503: Generate a variable encryption strategy for the file template based on the AES symmetric encryption calculation result of the dynamic key.
[0096] The encryption policy acquisition process is based on desensitizing tags. In practical scenarios, the first step is to determine whether the variable tags in the file template contain attribute information that requires desensitization. If so, the subsequent steps are executed. During the encryption policy generation process, the encryption policy is determined based on the variable values and generation time in the case information. For example, a fixed field and the case generation time can be combined to form a dynamic key. The AES symmetric encryption calculation process based on the dynamic key is then used to generate the variable encryption policy corresponding to the file template.
[0097] In one embodiment, the file templates and their corresponding case information in the database are encrypted and updated using a variable encryption strategy, such as Figure 6 As shown, including:
[0098] Step S601: Perform AES symmetric encryption on the case information according to the variable encryption strategy to obtain an encrypted string corresponding to the case information;
[0099] Step S602: Replace the case information corresponding to the file template in the database with the encrypted string.
[0100] In the process of encrypting and updating the file template and case information, the case information is symmetrically encrypted with AES using the dynamic key composed of the above-mentioned fixed string and the case generation time, and the encrypted string corresponding to the case information is finally obtained. The case information corresponding to the file template in the database is then replaced with the encrypted string, thereby achieving desensitization processing. Even if the data is leaked, the other party cannot obtain the real information.
[0101] In one embodiment, a response result corresponding to the file generation instruction is generated based on the encrypted and updated file template and case information, such as Figure 7 As shown, including:
[0102] Step S701, determining the encrypted string corresponding to the variable value based on the generation time contained in the encrypted and updated case information;
[0103] Step S702: Perform an inverse operation on the encrypted string using the encryption strategy to obtain the original case information corresponding to the encrypted string;
[0104] Step S703: Determine the response result corresponding to the file generation instruction based on the original case information.
[0105] The response result can be understood as the user needing to see the actual case information. Since the case information in the database has already been encrypted, it must be decrypted. First, the encrypted string corresponding to the variable value is determined based on the generation time contained in the encrypted and updated case information. Then, the encryption strategy is used to perform an inverse operation on this encrypted string to obtain the original case information. In actual processing, the corresponding key is used, namely, a fixed field plus the case generation time. Finally, the response result corresponding to the file generation instruction is determined based on the original case information.
[0106] In one embodiment, a file corresponding to a file generation instruction is generated based on the response result, such as Figure 8 As shown, including:
[0107] Step S801: Obtain the original case information contained in the response result and save the original case information to an initialized text file;
[0108] Step S802: After converting the text file into a portable file format, a file corresponding to the file generation instruction is obtained.
[0109] The original case information contained in the response can be saved to a text file, such as a Word document. Even if the original case information is in HTML format, it can still be saved in Word. The text file can then be converted to a portable file format, and the Word file can be converted to a PDF file. This PDF file will then be the file corresponding to the final file generation instruction.
[0110] It can be seen from the file generation method in the above embodiment that this method can use its variable labels to generate corresponding encryption strategies during the generation of relevant document files, and use the encryption strategies to automatically desensitize relevant sensitive texts, thereby realizing the automatic acquisition and automatic desensitization process of sensitive data, and solving the problem of low processing efficiency in the prior art when desensitizing sensitive data.
[0111] For the file generation method provided in the above embodiment, the embodiment of the present invention provides a file generation system, such as Figure 9 As shown, the system includes:
[0112] The variable label acquisition unit 910 is used to acquire a preset file template, perform character processing on the file template, and determine the variable labels included in the file template;
[0113] A desensitization label determination unit 920 is configured to construct a desensitization label corresponding to the document template based on the variable label, and save the desensitization label and the document template to a database; wherein the database contains case information corresponding to the document template;
[0114] The case information processing unit 930 is configured to use the received file generation instruction to determine case information corresponding to the file generation instruction from a database, and determine a corresponding file template based on the case information;
[0115] The encryption strategy generation module 940 is used to generate a variable encryption strategy for the file template using the desensitization tag corresponding to the file template, and encrypt and update the file template and its corresponding case information in the database using the variable encryption strategy;
[0116] The file generation processing module 950 is used to generate a response result corresponding to the file generation instruction according to the encrypted and updated file template and case information, and to generate a file corresponding to the file generation instruction based on the response result.
[0117] From the file generation system mentioned in the above embodiment, it can be seen that the system can use its variable labels to generate corresponding encryption strategies during the generation of relevant document files, and use the encryption strategies to automatically desensitize relevant sensitive texts, thereby realizing the automatic acquisition and automatic desensitization process of sensitive data, and solving the problem of low processing efficiency in the existing technology when desensitizing sensitive data.
[0118] The file generation system provided in the embodiment of the present invention has the same implementation principle and technical effects as those in the aforementioned file generation method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference can be made to the corresponding content in the aforementioned file generation method embodiment.
[0119] This embodiment also provides an electronic device. The structural diagram of the electronic device is as follows: Figure 10 As shown, the device includes a processor 101 and a memory 102; wherein the memory 102 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor to implement the steps of the above-mentioned file generation method.
[0120] Figure 10 The electronic device shown further includes a bus 103 and a communication interface 104 , and the processor 101 , the communication interface 104 and the memory 102 are connected via the bus 103 .
[0121] The memory 102 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The bus 103 may be an ISA bus, a PCI bus, or an EISA bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 10 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0122] The communication interface 104 is used to connect to at least one user terminal and other network units through a network interface, and send the encapsulated IPv4 message or IPv4 message to the user terminal through the network interface.
[0123] The processor 101 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 101 or by instructions in the form of software. The above-mentioned processor 101 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in memory 102, and processor 101 reads information in memory 102 and, in conjunction with its hardware, completes the steps of the method of the aforementioned embodiment.
[0124] An embodiment of the present invention further provides a storage medium storing a computer program. When the computer program is executed by a processor, the steps of the file generation method in the above embodiment are executed.
[0125] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only 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 communication interface, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0126] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0127] In addition, each functional unit in each embodiment of the present invention 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.
[0128] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the 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 and includes several instructions for enabling 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 invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0129] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A file generation method, characterized in that: The method is applied to a process of generating a document, and the method comprises: Obtaining a preset file template, performing character processing on the file template, and determining variable labels contained in the file template; Constructing a desensitizing label corresponding to the document template based on the variable label, and saving the desensitizing label and the document template in a database; wherein the database contains case information corresponding to the document template; Using the received file generation instruction, determining the case information corresponding to the file generation instruction from the database, and determining the corresponding file template according to the case information; Generate a variable encryption strategy for the file template using the desensitizing label corresponding to the file template, and encrypt and update the file template and the corresponding case information in the database using the variable encryption strategy; Generate a response result corresponding to the file generation instruction according to the encrypted and updated file template and the case information, and generate a file corresponding to the file generation instruction based on the response result; Generating a variable encryption strategy for the file template using the desensitizing label corresponding to the file template includes: Determining the case information corresponding to the file template according to the desensitizing label; Generate a dynamic key corresponding to the file generation instruction using the variable value and generation time included in the case information; Generate a variable encryption strategy for the file template based on the AES symmetric encryption calculation result of the dynamic key; Encrypting and updating the file template and the corresponding case information in the database using the variable encryption strategy includes: After performing AES symmetric encryption on the case information according to the variable encryption strategy, an encrypted string corresponding to the case information is obtained; Replacing the case information corresponding to the file template in the database with the encrypted string; Generate a response result corresponding to the file generation instruction according to the encrypted and updated file template and the case information, including: Determining, based on the generation time included in the case information after the encryption update is completed, that the variable value corresponds to the encrypted string; Performing an inverse operation on the encrypted string using the encryption strategy to obtain original case information corresponding to the encrypted string; The response result corresponding to the file generation instruction is determined based on the original case information.
2. The file generation method according to claim 1, wherein: The step of obtaining a preset file template, performing character processing on the file template, and then determining the variable labels contained in the file template includes: Determine and obtain the file template according to a preset string format requirement; After formatting the file template based on HTML format requirements, obtaining the HTML string contained in the file template; The tag data contained in the html string is traversed, and the variable tag contained in the file template is determined according to the tag data.
3. The file generation method according to claim 1, wherein: The step of constructing a desensitizing label corresponding to the file template based on the variable label, and saving the desensitizing label and the file template in a database includes: Obtaining content attribute parameters corresponding to the variable tag, and determining the desensitized content corresponding to the content attribute parameters; Generating the desensitizing label corresponding to the file template using the desensitizing content, and associating the desensitizing label with the file template; The associated desensitizing label and the file template are saved in the database.
4. The file generation method according to claim 1, wherein: The step of using the received file generation instruction to determine the case information corresponding to the file generation instruction from the database, and determining the corresponding file template according to the case information includes: Obtaining a preset file generation page and determining a file generation button included in the file generation page; receiving a click event of the file generation button in real time, and generating the corresponding file generation instruction based on the click event; Using the file generation instruction to obtain a data reading statement corresponding to the database, and obtaining the case information from the database according to the data reading statement; Determine the file template corresponding to the case information.
5. The file generation method according to claim 1, wherein: Generating a file corresponding to the file generation instruction based on the response result includes: Obtaining the original case information contained in the response result, and saving the original case information to an initialized text file; After converting the text file into a portable file format, the file corresponding to the file generation instruction is obtained.
6. A file generation system, characterized in that: The system is applied to the process of generating a document, and the system includes: a variable label obtaining unit, configured to obtain a preset file template, and after performing character processing on the file template, determine the variable labels contained in the file template; a desensitization label determination unit, configured to construct a desensitization label corresponding to the document template based on the variable label, and save the desensitization label and the document template into a database; wherein the database contains case information corresponding to the document template; a case information processing unit, configured to use the received file generation instruction to determine the case information corresponding to the file generation instruction from the database, and determine the corresponding file template according to the case information; an encryption strategy generating module, configured to generate a variable encryption strategy for the file template using the desensitizing label corresponding to the file template, and encrypt and update the file template and the corresponding case information in the database using the variable encryption strategy; A file generation processing module, configured to generate a response result corresponding to the file generation instruction according to the encrypted and updated file template and the case information, and generate a file corresponding to the file generation instruction based on the response result; The encryption strategy generation module, in the process of generating the variable encryption strategy of the file template using the desensitizing label corresponding to the file template, is further configured to: determine the case information corresponding to the file template based on the desensitizing label; generate a dynamic key corresponding to the file generation instruction using the variable value and generation time contained in the case information; and generate the variable encryption strategy of the file template based on the AES symmetric encryption calculation result of the dynamic key; The encryption strategy generation module, during the process of encrypting and updating the file template and the corresponding case information in the database using the variable encryption strategy, is further configured to: perform AES symmetric encryption on the case information according to the variable encryption strategy to obtain an encrypted string corresponding to the case information; and replace the case information corresponding to the file template in the database with the encrypted string; In the process of generating a response result corresponding to the file generation instruction based on the file template and the case information after the encryption update, the file generation processing module is also used to: determine the encrypted string corresponding to the variable value based on the generation time contained in the case information after the encryption update; use the encryption strategy to perform an inverse operation on the encrypted string to obtain the original case information corresponding to the encrypted string; and determine the response result corresponding to the file generation instruction based on the original case information.
7. An electronic device, characterized in that: The system comprises a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the steps of the file generation method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Log desensitization method and device, equipment and storage medium
CN115544566A
Data management method and apparatus, device and storage medium
WO2022247790A1