CN117494210A - File processing method, apparatus, device, medium and program product - Google Patents

File processing method, apparatus, device, medium and program product Download PDF

Info

Publication number
CN117494210A
CN117494210A CN202311575561.XA CN202311575561A CN117494210A CN 117494210 A CN117494210 A CN 117494210A CN 202311575561 A CN202311575561 A CN 202311575561A CN 117494210 A CN117494210 A CN 117494210A
Authority
CN
China
Prior art keywords
file
server
file processing
handle
processing
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
CN202311575561.XA
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202311575561.XA priority Critical patent/CN117494210A/en
Publication of CN117494210A publication Critical patent/CN117494210A/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/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • 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/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • 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/17Details of further file system functions
    • G06F16/173Customisation support for file systems, e.g. localisation, multi-language support, personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages

Abstract

The disclosure provides a file processing method, which can be applied to the technical field of information security. The file processing is realized based on a file server, a database server and an operation server, the method is applied to the operation server, and the method comprises the following steps: receiving input file information and a file processing instruction; forming a file handle based on the file information; and executing file processing logic with the file server and/or the database server through the file handle according to the file processing instruction. The present disclosure also provides a file processing apparatus, device, storage medium, and program product.

Description

File processing method, apparatus, device, medium and program product
Technical Field
The present disclosure relates to the field of information security technologies, and in particular, to a file processing method, apparatus, device, medium, and program product.
Background
In a remote access scenario, in general, operations of file processing and database processing are placed in the same database server, and excessive business logic is placed in the database to cause storage and calculation coupling, so that when a system faces more complex calculation and change of a large amount of data, the expandability of the system is limited, and certain potential safety hazards exist when the database directly operates the file.
Disclosure of Invention
In view of the foregoing, the present disclosure provides a file processing method, apparatus, device, medium, and program product that improve system scalability.
According to a first aspect of the present disclosure, there is provided a file processing method implemented based on a file server, a database server, and an operation server, the method being applied to the operation server, the method comprising: receiving input file information and a file processing instruction; forming a file handle based on the file information; and executing file processing logic with the file server and/or the database server through the file handle according to the file processing instruction.
According to an embodiment of the disclosure, the database server adopts a first language, the operation server adopts a second language, and the file processing logic of the database server and/or the file server is executed based on the file handle, and the method comprises the following steps: acquiring a preset difference supplementing file; and supplementing a file and the file processing instructions based on the difference, executing file processing logic with the file server and/or database server through the file handle.
According to an embodiment of the disclosure, after the forming a file handle based on the file information, before executing, according to the file processing instruction, file processing logic with the file server and/or the database server through the file handle, the method further includes: and storing the file handle as an object into a Map.
According to an embodiment of the disclosure, the file processing instruction includes: opening a file, said supplementing the file and said file handling instructions based on said differences, executing file handling logic with said file server and/or database server via said file handle, comprising: acquiring a file in the file server based on the file handle under the condition that the file processing instruction is to open the file; and opening the file.
According to an embodiment of the disclosure, the file processing instruction further includes: writing a file, said supplementing a file and said file handling instructions based on said differences, executing file handling logic with said file server and/or database server via said file handle, further comprising: under the condition that the file processing instruction is a written file, acquiring the content to be written in the database server; acquiring a file in the file server based on the file handle; writing the content to be written into the file through a file writing function based on the content to be written; and transmitting the file written with the content to the file server.
According to an embodiment of the disclosure, the file processing instruction further includes: file reading, wherein the file processing logic with the file server and/or the database server is executed through the file handle based on the difference supplemental file and the file processing instruction, and the file reading further comprises: acquiring a file in the file server based on the file handle under the condition that the file processing instruction is file reading; and continuously reading the data in the file according to the file reading mode of the line.
According to an embodiment of the present disclosure, after the line-by-line file reading manner continuously reads the data in the file, the method further includes: and after the last line of the file is read, returning to the custom exception reporting.
According to an embodiment of the disclosure, the file processing instruction further includes: deleting the file, said supplementing the file and said file processing instructions based on said difference, executing file processing logic with said file server and/or database server via said file handle, further comprising: and synchronously deleting the file on the operation server and the file on the file server based on the file information under the condition that the file processing instruction is to delete the file.
A second aspect of the present disclosure provides a file processing apparatus, the file processing being implemented based on a file server, a database server, and an operation server, the method being applied to the operation server, the method comprising: the receiving module is used for receiving the input file information and the file processing instruction; a handle forming module for forming a file handle based on the file information; and the file processing module is used for executing file processing logic with the file server and/or the database server through the file handle according to the file processing instruction.
According to an embodiment of the present disclosure, the database server adopts a first language, the operation server adopts a second language, and the file processing module includes: the device comprises a difference file acquisition unit and a file processing unit, wherein the difference file acquisition unit is used for acquiring a preset difference supplementary file; and the file processing unit is used for supplementing files and the file processing instructions based on the differences, and executing file processing logic with the file server and/or the database server through the file handle.
According to an embodiment of the present disclosure, the file processing device further includes: and the Map storing module is used for storing the file handle as an object into the Map.
According to an embodiment of the disclosure, the file processing instruction includes: opening a file, the file processing unit comprising: the file processing device comprises a first acquisition subunit and a file opening subunit, wherein the first acquisition subunit is used for acquiring a file in the file server based on the file handle under the condition that the file processing instruction is an opening file; and opening the file.
According to an embodiment of the disclosure, the file processing instruction further includes: writing a file, the file processing unit further comprising: the system comprises a second acquisition subunit, a third acquisition subunit, a writing subunit and a first transmission subunit, wherein the second acquisition subunit is used for acquiring the content to be written in the database server under the condition that the file processing instruction is a writing file; the third obtaining subunit is configured to obtain, based on the file handle, a file in the file server; the writing subunit is used for writing the content to be written into the file through a file writing function based on the content to be written into; and the first transmission subunit is used for transmitting the file written in the content to the file server.
According to an embodiment of the disclosure, the file processing instruction further includes: the file reading, the file processing unit further includes: a fourth obtaining subunit, configured to obtain, based on the file handle, a file in the file server when the file processing instruction is file reading; and the reading subunit is used for continuously reading the data in the file according to the file reading mode of the row.
According to an embodiment of the disclosure, the file processing unit further includes: and the abnormal error reporting subunit is used for returning the self-defined abnormal error reporting after the last line of the file is read.
According to an embodiment of the disclosure, the file processing instruction further includes: deleting a file, the file processing unit further comprising: and the deleting subunit is used for synchronously deleting the file on the operation server and the file on the file server based on the file information under the condition that the file processing instruction is the file deleting.
A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the file processing method described above.
A fourth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the above-described file processing method.
A fifth aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the above-described file processing method.
In the embodiment of the disclosure, in order to solve the technical problems of poor database expansibility and high security risk caused by database storage coupling in the prior art, the embodiment of the disclosure sets the file IO logic on the operation server, isolates the file IO logic from the database server, and interacts with the database server and the file server respectively to realize file processing logic, thereby being beneficial to realizing isolation between external files and the database and ensuring the storage security of the database.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be more apparent from the following description of embodiments of the disclosure with reference to the accompanying drawings, in which:
FIG. 1A schematically illustrates an application scenario diagram of a file processing method according to an embodiment of the present disclosure;
FIG. 1B schematically illustrates a system diagram of a file processing method according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a method of file processing according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow chart of a method of file processing logic according to an embodiment of the present disclosure;
FIG. 4A schematically illustrates a flow chart of a method of file processing according to an embodiment of the present disclosure;
FIG. 4B schematically illustrates an interactive schematic of a file processing method according to an embodiment of the present disclosure;
FIG. 5A schematically illustrates a flow chart of another method of file processing according to an embodiment of the present disclosure;
FIG. 5B schematically illustrates an interactive schematic of another file processing method according to an embodiment of the present disclosure;
FIG. 6 schematically illustrates a flow chart of another method of file processing according to an embodiment of the disclosure;
FIG. 7A schematically illustrates a flow chart of another method of file processing according to an embodiment of the present disclosure;
FIG. 7B schematically illustrates an interactive schematic of another file processing method according to an embodiment of the present disclosure;
FIG. 8 schematically shows a block diagram of a file processing apparatus according to an embodiment of the present disclosure;
fig. 9 schematically illustrates a block diagram of an electronic device adapted to implement a file processing method according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
Before the present disclosure is disclosed in detail, key technical terms involved in the present disclosure are described one by one as follows:
utl_file packet: the UTL_FILE package is a standard tool package provided by Oracle and is used for reading and writing FILEs, and mainly supports the access and operation of PL/SQL programs to server disk FILEs.
Directory object: the Directory object of Oracle can enable a user to flexibly read and write files in an Oracle database, so that usability and expansibility of Oracle are greatly improved, and the Directory object can specify export and import paths.
File handle: is the only identification basis for opening the file.
In the prior art, excessive business logic is placed in a database to cause the coupling of storage calculation, and when the system faces more complex calculation and the change of a large amount of data, the expandability of the system is limited, and certain potential safety hazard exists in the direct operation of the database on files.
To solve the technical problems existing in the prior art, an embodiment of the present disclosure provides a file processing method, where the file processing is implemented based on a file server, a database server and an operation server, and the method is applied to the operation server, and the method includes: receiving input file information and a file processing instruction; forming a file handle based on the file information; and executing file processing logic with the file server and/or the database server through the file handle according to the file processing instruction.
In the embodiment of the disclosure, in order to solve the technical problems of poor database expansibility and high security risk caused by database storage coupling in the prior art, the embodiment of the disclosure sets the file IO logic on the operation server, isolates the file IO logic from the database server, and interacts with the database server and the file server respectively to realize file processing logic, thereby being beneficial to realizing isolation between external files and the database and ensuring the storage security of the database.
Fig. 1A schematically illustrates an application scenario diagram of a file processing method according to an embodiment of the present disclosure.
As shown in fig. 1A, an application scenario 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client applications, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (by way of example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and process the received data such as the user request, and feed back the processing result (e.g., the web page, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the file processing method provided in the embodiment of the present disclosure may be generally performed by the server 105. Accordingly, the file processing apparatus provided in the embodiments of the present disclosure may be generally disposed in the server 105. The file processing method provided by the embodiments of the present disclosure may also be performed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the file processing apparatus provided by the embodiments of the present disclosure may also be provided in a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be understood that the number of terminal devices, networks and servers in fig. 1A is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 1B schematically illustrates a system diagram of a file processing method according to an embodiment of the present disclosure.
As shown in fig. 1B, the system diagram of the file processing method includes an operation server 110, a database server 120 and a file server 130, wherein the database server 120 is used as a carrier of a database and is responsible for storing data in the database, and the file server 130 is used as a carrier of a file and is responsible for storing the file. In some cases, the database server 120 needs to acquire a file from the file server 130 and perform a file processing operation, where the database server 120 and the file server 130 are not directly connected to each other, and the database server 120 and the file server 130 perform a file/data processing operation through the operation server 110.
The file processing method of the disclosed embodiment will be described in detail below with reference to fig. 2 to 7 based on the scenes described in fig. 1A and 1B.
Fig. 2 schematically illustrates a flow chart of a file processing method according to an embodiment of the present disclosure.
As shown in fig. 2, the file processing method of this embodiment includes operations S210 to S230, and the method may be performed by the server 105 or the method may be performed by the operation server 110.
In operation S210, input file information and a file processing instruction are received.
Wherein the file information includes: the input file path (supporting the directors of the input Oracle), the file name, and the file opening mode (read only, read write, binary or not), and the file processing instruction may be a file processing instruction in the UTL_FULE packet based on the PL/SQL language, or may be an instruction related to file processing in another language, for example, the file processing instruction at least includes: open files, write files, read files, delete files, etc.
In operation S220, a file handle is formed based on the file information.
Specifically, a file path (supporting a directory object of an input Oracle), a file name, and a file opening mode (read only, read write, binary or not) are formed into a file handle (or referred to as a FileHandle), and the file handle is a unique identifier for a certain file.
In operation S230, file processing logic with the file server and/or database server is executed through the file handle according to the file processing instruction.
In the embodiment of the disclosure, the database service adopts an Oracle database, and in the use process of the Oracle database, the PL/SQL language is often used for expanding SQL so as to realize the processing of complex business logic in the database, wherein for a FILE processing part, the PL/SQL language uses a UTL_FILE packet to realize the read-write operation of a FILE. Then, in general, in the case that the database language is unchanged, the FILE processing operation is completed by implementing the FILE I/O logic in the utl_file package, and since in the embodiment of the present disclosure, in the database server 120, the FILE I/O logic in the database is not reserved, then the FILE I/O function designed for the utl_file package is implemented in the operation server 110.
For the utl_file packet, some common procedures and functions (omitting parameters) will be listed: fopen function: opening the designated file and returning a file handle for operating the file; fflush: writing all data of the whole package into a file; fclose: closing the file; put: outputting data in the current row; put_line: inputting a character string and a line terminator related to the system; get_line: reading a row of the designated file; fcopy: copying the file; fremove: deleting the specified file on the disk.
It should be noted that the above operation of performing FILE processing using utl_file package is based on the premise that the arithmetic server 110 and the database server 120 use PL/SQL language in the Oracle database. Because the PL/SQL language is limited to use with Oracle databases, when an application needs to switch data sources, the PL/SQL language cannot be smoothly migrated to a non-Oracle database, so in order to increase the real-time scenario of file processing, a different language from PL/SQL may be adopted in the operation server 110 to implement processing logic for file I/O in the operation server 110.
Fig. 3 schematically illustrates a flow chart of a method of file processing logic according to an embodiment of the present disclosure.
As shown in fig. 3, the file processing logic method of this embodiment includes operations S310 to S320, and at least the above-described operation S230 may be performed by the operations S310 to S320.
According to an embodiment of the disclosure, the database server adopts a first language, and the operation server adopts a second language.
Wherein the first language is the PL/SQL language and the second language is the Java language.
In operation S310, a preset difference supplement file is acquired.
In operation S320, file processing logic is executed with the file server and/or database server via the file handle based on the differential supplemental file and the file processing instructions.
The difference supplementing FILE is used for flattening differences of FILE I/O processing operations between the PL/SQL language and the Java language, the preset difference supplementing FILE is a substitute of a UTL_FILE Java class in the PL/SQL language for a UTL_FILE package, directors in a database can be read into a system and stored in a static object during program initialization, and the directors of Oracle are supported.
According to an embodiment of the present disclosure, after operation S220, before operation S230, the method comprises: and storing the file handle as an object into a Map.
Specifically, in the process of realizing file processing based on the file handle by the PL/SQL, the file handle needs to be stored and used in the Map, so that after the file handle generated under the Java language is created, an object is stored in the Map to realize the file operation mode in the PL/SQL language.
In the embodiment of the disclosure, in order to solve the technical problems of poor database expansibility and high security risk caused by database storage coupling in the prior art, the embodiment of the disclosure sets the file IO logic on the operation server, isolates the file IO logic from the database server, and interacts with the database server and the file server respectively to realize file processing logic, thereby being beneficial to realizing isolation between external files and the database and ensuring the storage security of the database.
Hereinafter, a file processing method in the operation server 110 using the Java language will be disclosed in detail, as follows:
fig. 4A schematically illustrates a flow chart of a method of file processing according to an embodiment of the present disclosure.
Fig. 4B schematically illustrates an interactive schematic of a file processing method according to an embodiment of the disclosure.
As shown in fig. 4A, the file processing method of this embodiment includes operations S410 to S420, and operations S410 to S420 may at least partially perform operation S320 described above.
In operation S410, in a case where the file processing instruction is to open a file, a file in the file server is acquired based on the file handle.
In operation S420, the file is opened.
In a scenario of remote access, as shown in fig. 4B, the computing server 110 obtains a file from the file server 130, and opens the file, where "opening the file" is creating a file handle (class name) by an input file path (supporting a directory object of an oracle), a file name, a file opening mode (read only, read write, binary or not), and the like, and after the file handle is created, the object is put into a Map to be stored to implement a file operation mode in the PL/SQL language.
Fig. 5A schematically illustrates a flow chart of another file processing method according to an embodiment of the present disclosure.
FIG. 5B schematically illustrates an interactive schematic of another file processing method according to an embodiment of the present disclosure.
As shown in fig. 5A, the file processing method of this embodiment includes operations S510 to S540, and operations S510 to S540 may at least partially perform operation S320 described above.
In operation S510, in the case where the file processing instruction is to write a file, the content to be written in the database server is acquired.
In operation S520, a file in the file server is acquired based on the file handle.
In operation S530, the file is written by a file writing function based on the content to be written.
In operation S540, the file of the written content is transmitted to the file server.
In a scenario of remote access, as shown in fig. 5B, the operation server 110 obtains the file handle, the automatic writing flag (optional) and the content to be written, the program uses FileWriter or DataOutputStream (determined according to the input parameters when opening the file) to write the content to be written into the file according to the current file handle, and the file is transmitted to the file server for saving by the operation server.
Fig. 6 schematically illustrates a flow chart of another file processing method according to an embodiment of the present disclosure.
As shown in fig. 6, the file processing method of this embodiment includes operations S610 to S630, and the operations S610 to S630 may at least partially perform the above-described operation S320.
In operation S610, in a case where the file processing instruction is file reading, a file in the file server is acquired based on the file handle.
In operation S620, the data in the file is continuously read according to the file reading mode of the line.
In operation S630, after the last line of the file is read, a custom exception is returned.
In PL/SQL, an exception (no_data_foundation) is thrown when the end of the processed file is read by the database, whereas in Java, an exception is not thrown when the end of the processed file is read by the database, and therefore, in order to target PL/SQL, logic for throwing an exception is added to the arithmetic server 110.
Specifically, the operation server 110 executes file reading logic including: obtaining a file handle, wherein the file handle comprises a buffer reader object, reading a row of DATA by using a readLine, and throwing out no_data_foundation if the DATA is not read (self-defining exception, no_data_foundation of an Oracle database)
Fig. 7A schematically illustrates a flow chart of another file processing method according to an embodiment of the present disclosure.
FIG. 7B schematically illustrates an interactive schematic of another file processing method according to an embodiment of the present disclosure.
As shown in fig. 7A, the file processing method of this embodiment includes operation S710, and the operation S710 may at least partially perform the above-described operation S320.
In operation S710, in case the file processing instruction is to delete a file, the file on the operation server and the file on the file server are synchronously deleted based on the file information.
As shown in connection with fig. 7B, the file is deleted by the operation server 110: and acquiring a source path (a directory object supporting the input of oracle) and a source file name, deleting the target file, and synchronously deleting the file of the file server when remote file access is required.
Based on the file processing method, the disclosure also provides a file processing device. The device will be described in detail below in connection with fig. 8.
Fig. 8 schematically shows a block diagram of a file processing apparatus according to an embodiment of the present disclosure.
As shown in fig. 8, the file processing apparatus 800 of this embodiment includes a receiving module 810, a handle forming module 820, and a file processing module 830.
The receiving module 810 is configured to receive input file information and a file processing instruction. In an embodiment, the receiving module 810 may be configured to perform the operation S210 described above, which is not described herein.
The handle forming module 820 is used for forming a file handle based on the file information. In an embodiment, the handle forming module may be used to perform the operation S220 described above, which is not described herein.
The file processing module 830 is configured to execute, according to the file processing instruction, file processing logic with the file server and/or the database server through the file handle. In an embodiment, the file processing module 830 may be configured to perform the operation S230 described above, which is not described herein.
In the embodiment of the disclosure, in order to solve the technical problems of poor database expansibility and high security risk caused by database storage coupling in the prior art, the embodiment of the disclosure sets the file IO logic on the operation server, isolates the file IO logic from the database server, and interacts with the database server and the file server respectively to realize file processing logic, thereby being beneficial to realizing isolation between external files and the database and ensuring the storage security of the database.
According to an embodiment of the present disclosure, the database server adopts a first language, the operation server adopts a second language, and the file processing module includes: the device comprises a difference file acquisition unit and a file processing unit, wherein the difference file acquisition unit is used for acquiring a preset difference supplementary file; and the file processing unit is used for supplementing files and the file processing instructions based on the differences, and executing file processing logic with the file server and/or the database server through the file handle.
According to an embodiment of the present disclosure, the file processing device further includes: and the Map storing module is used for storing the file handle as an object into the Map.
According to an embodiment of the disclosure, the file processing instruction includes: opening a file, the file processing unit comprising: the file processing device comprises a first acquisition subunit and a file opening subunit, wherein the first acquisition subunit is used for acquiring a file in the file server based on the file handle under the condition that the file processing instruction is an opening file; and opening the file.
According to an embodiment of the disclosure, the file processing instruction further includes: writing a file, the file processing unit further comprising: the system comprises a second acquisition subunit, a third acquisition subunit, a writing subunit and a first transmission subunit, wherein the second acquisition subunit is used for acquiring the content to be written in the database server under the condition that the file processing instruction is a writing file; the third obtaining subunit is configured to obtain, based on the file handle, a file in the file server; the writing subunit is used for writing the content to be written into the file through a file writing function based on the content to be written into; and the first transmission subunit is used for transmitting the file written in the content to the file server.
According to an embodiment of the disclosure, the file processing instruction further includes: the file reading, the file processing unit further includes: a fourth obtaining subunit, configured to obtain, based on the file handle, a file in the file server when the file processing instruction is file reading; and the reading subunit is used for continuously reading the data in the file according to the file reading mode of the row.
According to an embodiment of the disclosure, the file processing unit further includes: and the abnormal error reporting subunit is used for returning the self-defined abnormal error reporting after the last line of the file is read.
According to an embodiment of the disclosure, the file processing instruction further includes: deleting a file, the file processing unit further comprising: and the deleting subunit is used for synchronously deleting the file on the operation server and the file on the file server based on the file information under the condition that the file processing instruction is the file deleting.
Any of the receiving module 810, the handle forming module 820, and the file processing module 830 may be combined in one module to be implemented, or any of the modules may be split into a plurality of modules, according to an embodiment of the present disclosure. Alternatively, at least some of the functionality of one or more of the modules may be combined with at least some of the functionality of other modules and implemented in one module. At least one of the receiving module 810, the handle forming module 820, and the file processing module 830 may be implemented at least in part as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or by hardware or firmware, such as any other reasonable way of integrating or packaging the circuitry, or in any one of or a suitable combination of three of software, hardware, and firmware. Alternatively, at least one of the receiving module 810, the handle forming module 820 and the file processing module 830 may be at least partially implemented as a computer program module which, when executed, performs the corresponding functions.
Fig. 9 schematically illustrates a block diagram of an electronic device adapted to implement a file processing method according to an embodiment of the disclosure.
As shown in fig. 9, an electronic device 900 according to an embodiment of the present disclosure includes a processor 901 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 902 or a program loaded from a storage portion 908 into a Random Access Memory (RAM) 903. The processor 901 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. Processor 901 may also include on-board memory for caching purposes. Processor 901 may include a single processing unit or multiple processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
In the RAM 903, various programs and data necessary for the operation of the electronic device 900 are stored. The processor 901, the ROM 902, and the RAM 903 are connected to each other by a bus 904. The processor 901 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 902 and/or the RAM 903. Note that the program may be stored in one or more memories other than the ROM 902 and the RAM 903. The processor 901 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the disclosure, the electronic device 900 may also include an input/output (I/O) interface 905, the input/output (I/O) interface 905 also being connected to the bus 904. The electronic device 900 may also include one or more of the following components connected to the I/O interface 905: an input section 906 including a keyboard, a mouse, and the like; an output portion 907 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage portion 908 including a hard disk or the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as needed. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on the drive 910 so that a computer program read out therefrom is installed into the storage section 908 as needed.
The present disclosure also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example, but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 902 and/or RAM 903 and/or one or more memories other than ROM 902 and RAM 903 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowcharts. The program code, when executed in a computer system, causes the computer system to implement the item recommendation method provided by embodiments of the present disclosure.
The above-described functions defined in the system/apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 901. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed, and downloaded and installed in the form of a signal on a network medium, via communication portion 909, and/or installed from removable medium 911. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from the network via the communication portion 909 and/or installed from the removable medium 911. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 901. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
According to embodiments of the present disclosure, program code for performing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be provided in a variety of combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (12)

1. A file processing method, the file processing is realized based on a file server, a database server and an operation server, the method is applied to the operation server,
The method comprises the following steps:
receiving input file information and a file processing instruction;
forming a file handle based on the file information; and
and executing file processing logic with the file server and/or the database server through the file handle according to the file processing instruction.
2. The method of claim 1, wherein the database server is in a first language, the operation server is in a second language,
the executing file processing logic with the file server and/or database server based on the file handle comprises:
acquiring a preset difference supplementing file; and
and executing file processing logic with the file server and/or database server through the file handle based on the difference supplemental file and the file processing instruction.
3. The method of claim 2, wherein after the forming of the file handle based on the file information, the method further comprises, prior to executing file processing logic with the file server and/or database server by the file handle in accordance with the file processing instructions:
and storing the file handle as an object into a Map.
4. The method of claim 3, wherein the file processing instructions comprise: the file is opened and the file is opened,
the supplementing of the file and the file processing instructions based on the differences, executing file processing logic with the file server and/or database server through the file handle, comprising:
acquiring a file in the file server based on the file handle under the condition that the file processing instruction is to open the file; and
and opening the file.
5. The method of claim 3, wherein the file processing instructions further comprise: the file is to be written to,
the supplementing of the file and the file processing instructions based on the differences, executing file processing logic with the file server and/or database server through the file handle, further comprises:
under the condition that the file processing instruction is a written file, acquiring the content to be written in the database server;
acquiring a file in the file server based on the file handle;
writing the content to be written into the file through a file writing function based on the content to be written; and
and transmitting the file with the written content to the file server.
6. The method of claim 3, wherein the file processing instructions further comprise: the file is read out and the file is read out,
the supplementing of the file and the file processing instructions based on the differences, executing file processing logic with the file server and/or database server through the file handle, further comprises:
acquiring a file in the file server based on the file handle under the condition that the file processing instruction is file reading; and
and continuously reading the data in the file according to the file reading mode of the row.
7. The method of claim 6, wherein after the line-by-line file reading manner continues to read the data in the file, further comprising:
and after the last line of the file is read, returning to the custom exception reporting.
8. The method of claim 3, wherein the file processing instructions further comprise: the file is deleted and the file is deleted,
the supplementing of the file and the file processing instructions based on the differences, executing file processing logic with the file server and/or database server through the file handle, further comprises:
and synchronously deleting the file on the operation server and the file on the file server based on the file information under the condition that the file processing instruction is to delete the file.
9. A file processing apparatus, the file processing being implemented based on a file server, a database server, and an arithmetic server, the method being applied to the arithmetic server,
the method comprises the following steps:
the receiving module is used for receiving the input file information and the file processing instruction;
a handle forming module for forming a file handle based on the file information; and
and the file processing module is used for executing file processing logic with the file server and/or the database server through the file handle according to the file processing instruction.
10. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-8.
11. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method according to any of claims 1-8.
12. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 8.
CN202311575561.XA 2023-11-23 2023-11-23 File processing method, apparatus, device, medium and program product Pending CN117494210A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311575561.XA CN117494210A (en) 2023-11-23 2023-11-23 File processing method, apparatus, device, medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311575561.XA CN117494210A (en) 2023-11-23 2023-11-23 File processing method, apparatus, device, medium and program product

Publications (1)

Publication Number Publication Date
CN117494210A true CN117494210A (en) 2024-02-02

Family

ID=89679989

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311575561.XA Pending CN117494210A (en) 2023-11-23 2023-11-23 File processing method, apparatus, device, medium and program product

Country Status (1)

Country Link
CN (1) CN117494210A (en)

Similar Documents

Publication Publication Date Title
AU2014225864B2 (en) System and method for cubic graphical user interfaces
US9495881B2 (en) System and method for displaying multiple applications
US9235636B2 (en) Presenting data in response to an incomplete query
US9948637B2 (en) System and method for data security on big data sets
US11561972B2 (en) Query conversion for querying disparate data sources
CN115587575A (en) Data table creation method, target data query method, device and equipment
CN111258988B (en) Asset management method, device, electronic equipment and medium
CN114168220A (en) Data processing and interaction method, device, equipment and storage medium of application program
CN117494210A (en) File processing method, apparatus, device, medium and program product
CN114816361A (en) Method, device, equipment, medium and program product for generating splicing project
CN113656041A (en) Data processing method, device, equipment and storage medium
US9251125B2 (en) Managing text in documents based on a log of research corresponding to the text
CN113448578A (en) Page data processing method, processing system, electronic device and readable storage medium
CN114285743B (en) Method, device, electronic equipment and storage medium for updating configuration information
WO2017027702A1 (en) Document management system and method
CN112965946B (en) Method, device, equipment and computer readable medium for processing document
US20230396621A1 (en) Method and system for creating social media content collections
US20170161269A1 (en) Document handling using triple identifier
US10567539B2 (en) Managing metadata in cloud driven, thin client video applications
JP2024509149A (en) Document processing methods, devices, equipment and media
CN117435787A (en) Information display method and device, electronic equipment and computer readable storage medium
CN114138818A (en) Information processing method, processing device, electronic device and readable storage medium
CN116822455A (en) Webpage labeling method, device, equipment, storage medium and program product
CN111382204A (en) Hbase database processing method and device based on webpage interface
CN113419791A (en) Office document generation method, device and system

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