CN110958292A - File uploading method, electronic device, computer equipment and storage medium - Google Patents

File uploading method, electronic device, computer equipment and storage medium Download PDF

Info

Publication number
CN110958292A
CN110958292A CN201910877121.7A CN201910877121A CN110958292A CN 110958292 A CN110958292 A CN 110958292A CN 201910877121 A CN201910877121 A CN 201910877121A CN 110958292 A CN110958292 A CN 110958292A
Authority
CN
China
Prior art keywords
file
uploading
user
uploaded
authority
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
CN201910877121.7A
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.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN201910877121.7A priority Critical patent/CN110958292A/en
Publication of CN110958292A publication Critical patent/CN110958292A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • 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
    • 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
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a file uploading method, an electronic device, computer equipment and a storage medium, wherein the method comprises the following steps: a data table for uploading files is configured in advance, and the data table comprises a file uploading authority control table; acquiring file uploading request information of a user side, wherein the request information comprises a user ID and a file type; judging whether the user has the authority to upload the file or not according to the file uploading authority control table; if yes, acquiring and storing an uploaded file of the user; and generating a file uploading record table of the uploading file, and updating a storage database table. According to the method, the uploaded file and the data table are mapped, the new file is uploaded without consuming time to re-develop codes, the configuration file and the table information of the data table can be directly modified, the function of uploading, analyzing and warehousing one file can be realized by spending several minutes, the code development amount is reduced, the development efficiency is improved, and the stability of a file uploading system is enhanced.

Description

File uploading method, electronic device, computer equipment and storage medium
Technical Field
The invention relates to the field of file uploading, in particular to a file uploading method, an electronic device, computer equipment and a storage medium.
Background
The universal file uploading in the prior art is realized by compiling independent codes, each file corresponds to a set of uploading codes, so that the file uploading time is long, the efficiency is low, and meanwhile, because each uploading is carried out, the code error rate is high, and the use experience is influenced.
Disclosure of Invention
The invention aims to solve the technical problems of reducing the code development amount, improving the development efficiency and enhancing the system stability and provides a file uploading method.
The invention solves the technical problems through the following technical scheme:
a data table for uploading files is configured in advance, and the data table comprises a file uploading authority control table;
acquiring file uploading request information of a user side, wherein the request information comprises a user ID and a file type;
judging whether the user has the authority to upload the file or not according to the file uploading authority control table;
if yes, acquiring and storing an uploaded file of the user;
and generating a file uploading record table of the uploading file, and updating a storage database table.
Further, after the uploading file of the user is obtained and stored, the method further comprises the following steps:
judging whether the uploaded file needs to be analyzed or not;
and if so, carrying out SQL analysis on the uploaded file.
Further, after the uploading file of the user is obtained and stored, the method further comprises the following steps:
judging whether the uploaded file needs field verification;
if yes, field verification is carried out according to a preset verification rule;
the sql that generated the batch insert enters the database.
Further, after the sql generating the batch insert enters the database, the method further comprises the following steps:
judging whether the data entering the database in batch is abnormal or not;
and if so, rolling back the abnormal data.
Further, the step of judging whether the user has the right to upload the file includes:
reading a user ID and a corresponding service type in a data table;
judging whether the service type is consistent with the file type;
and if so, the user has the authority to upload the file of the type.
The invention also discloses a file uploading device, which comprises:
the data table configuration module is used for configuring a data table uploaded by a file in a system in advance, and comprises a file uploading authority control table;
the information acquisition module is used for acquiring file uploading request information of a user side, wherein the request information comprises a user ID and a file type;
the user authority judging module is used for judging whether the user has the authority to upload the file according to the file uploading authority control table;
the file storage module is used for acquiring and storing the uploaded files of the user;
and the file uploading recording module is used for generating a file recording table and a storage database table according to the data of the uploaded file.
Further, the file uploading device further comprises a file parsing module, and the file parsing module comprises: the system comprises an analysis judgment subunit and an SQL analysis subunit, wherein the analysis judgment subunit is used for judging whether the uploaded file needs to be analyzed or not; the SQL analysis subunit is used for carrying out SQL analysis processing on the uploaded files needing analysis processing.
Further, the file uploading apparatus further includes a field check module, configured to perform field check processing on the uploaded file, including: the field verification judging subunit is used for judging whether the uploaded file needs to be subjected to field verification; the field verification processing subunit is used for performing field verification on the uploaded file according to a preset verification rule; and the sql generation subunit of the batch insert is used for generating sql of the batch insert for the files passing the field check and entering the database.
The invention also discloses a computer device, which comprises a memory and a processor, wherein the memory is stored with a computer program, and the computer program realizes the steps of the file uploading method when being executed by the processor.
The invention also discloses a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and the computer program can be executed by at least one processor to realize the steps of the file uploading method.
The positive progress effects of the invention are as follows: according to the method and the device, the uploaded file and the database table are mapped, the uploaded file is mapped into the table through table data mapping, meanwhile, the field verification configuration is added, the file general uploading processing component is realized, the new file is subsequently uploaded without time consumption and code re-development, the configuration file and the table information of the data table can be directly modified, the function of uploading and analyzing the file into the database can be realized by spending several minutes, the code development amount is reduced, the development efficiency is improved, and the stability of the file uploading system is enhanced.
Drawings
FIG. 1 is a flowchart illustrating a first embodiment of a file uploading method according to the present invention;
FIG. 2 is a flowchart of a first embodiment of a file uploading method according to the present invention;
FIG. 3 is a flowchart of a second embodiment of a file uploading method according to the present invention;
FIG. 4 is a flowchart illustrating a third embodiment of a file uploading method according to the present invention;
FIG. 5 is a flowchart illustrating a fourth embodiment of the file uploading method of the present invention;
fig. 6 is a block diagram showing a first embodiment of the document uploading apparatus of the present invention.
Fig. 7 shows a hardware architecture diagram of an embodiment of the computer apparatus of the present invention.
Detailed Description
The present invention is further illustrated by the following examples, which are not intended to limit the scope of the invention.
First, the present invention provides a file uploading method.
In a first embodiment, as shown in fig. 1 and 2, the file uploading method includes the following steps:
step 1, pre-configuring a data table for uploading files, wherein the data table comprises a file uploading authority control table;
a file uploading authority control table is configured in advance in a service module of the system, the control table is a master control table for uploading files, is used for generally controlling the file uploading condition and configuring the corresponding relation between a file uploading role ID and a service uploading function, and a role ID and a corresponding service uploading function authority are configured in advance in the table, wherein the service uploading function in the control table can comprise: the name of the current service module, the classification of the current service module, the role information of the type of the uploaded file, the name of the uploaded file, the maximum limit of the uploaded file, whether the uploaded file needs to be analyzed, whether the uploaded file covers the file before the uploaded file under the same folder, a service scene storage path, an analysis error log storage path, whether a dynamic folder is created, which field the field of the created folder is taken from, and the like. The specific service uploading function can be dynamically configured according to actual needs, for example, a file uploading authority control table with a table name of ccdun _ sc _ upload _ auth can be configured, the name is field data, the current service module is largely classified as bad asset verification, the current service module is slightly classified as quarterly verification, the name of the service module is a historical abnormal account, the owned role information of the uploaded file type is CSV, the service scene saving PATH is QUARTER _ ZIP _ PATH, and the file saving PATH after analysis is as follows: and the analysis error log saving PATH is QUARTER _ ERRLOG _ PATH.
Step 2, acquiring file uploading request information of a user side, wherein the request information comprises a user ID and a file type;
when a user logs in a service module at a user side to upload files, a system collects the user ID of the user side and the uploaded file type data for judging the subsequent user authority.
And 3, judging whether the user has the authority to upload the file or not according to the file uploading authority control table.
According to the collected user ID, reading AUTH TYPE (namely the role information of the uploaded file type in a certain service scene) in a file uploading authority control list to obtain the file type capable of being uploaded, and judging whether the user has authority to upload the file according to the obtained file type. The method specifically comprises the following steps:
step 3-1, reading the user ID and the corresponding service type in the data table;
specifically, after receiving an upload request of a user, the system enters a file upload permission control table, the dynamically configured file upload permission control table is queried from the DB according to a user role ID, an uploadable service type is obtained from a field authTYPE in the table, users with different role IDs have permissions for different upload service TYPES, multiple service functions can be configured for one role in a role and file correspondence table, multiple roles can be configured for one file, and a specific service type is preset and configured in the system for the role ID of the user.
Step 3-2, judging whether the service type is consistent with the file type;
the system background acquires the service type in the authority control table corresponding to the user role ID according to the user role ID of the uploaded file, and judges whether the file type of the uploaded file corresponding to the ID is consistent with the service type in the authority control table. The service type refers to a specific uploading function, such as urging file uploading, AI file uploading, and the like, and the table configures the corresponding relationship between the role and the uploading function, i.e. the file of the corresponding function can be uploaded, otherwise, the file cannot be uploaded.
And 3-3, if the type of the file is consistent with the type of the file, the user has the authority to upload the file of the type.
If the file type is consistent with the service type, the user is indicated to have the authority to upload the file.
Step 4, if yes, acquiring and storing an uploaded file of the user;
and the JAVA front end compiles a universal uploading page by using a jsp, compiles a universal file uploading component to upload a file, and stores the file under a certain PATH according to the UNZIP _ PATH PATH in the file uploading authority control table. The UNZIP _ PATH configures the full absolute PATH address of the NAS, and after the java back end receives the file stream, the java back end writes the data stream into the corresponding PATH according to the configured PATH.
And 5, generating a file uploading record table of the uploading file, and updating the storage database table.
The file uploading record table is used for recording the ID, the service type, the file path and the analysis state of file uploading, the table does not need to be configured, and the JAVA module of the general file compiling component can automatically record the information into the table according to the table which is configured in advance in the front of the system.
The configuration table is established in advance, and only one record needs to be inserted into the configuration table every time, for example, a set of records is configured in the authority control table with the table name of ccdun sc uploadauth, a corresponding configuration record is inserted into the table of the corresponding relationship between the file type and the table with the table name of ccdun sc filetype info, a corresponding field record is inserted into the table with the table name of ccdun sc fieldvalicnf and the file field check relationship table, and a corresponding record is inserted into the file uploading record table.
According to the previous configuration table, the related data uploaded by the file can be automatically imported into the storage database table, and only the structure of the storage database table needs to be established, for example, the storage database table can include: user ID of file uploading, verification and cancellation category, verification and cancellation batch, manual uploading list type, file analysis code and service field. Wherein, manual list type of uploading includes: DM-death missing class, LR-litigation refuting class, CF-fraud counterfeit class, HE-history abnormal account and PB-policy poor pursuit, wherein the file resolution codes correspond to the IDs in the file record table, so that the file resolution codes determine which file the data is resolved from, and the verification batch comprises quarterly verification and accounting for lost accounts.
In the second embodiment, based on the first embodiment, as shown in fig. 3, after the user uploads the file and stores the file, the method further includes the following steps:
step 4-a, judging whether the uploaded file needs to be analyzed;
step 4-b, if yes, SQL analysis is carried out on the uploaded file;
specifically, whether analysis is needed or not is dynamically judged according to an analysis flag field in a file uploading authority control table, if the analysis is needed, a file type and table relation table is read, the corresponding relation between a file column index and a table column is obtained, and sql analysis is carried out, wherein the sequence and the verification of each field in the table and each field in the file are required, the table only needs to be established for the first time, and only one record needs to be inserted for the subsequent new file analysis. The file type and table corresponding relation table is used for defining the corresponding relation between the file type of an uploaded file and a storage database table, the table comprises the name and the classification of a current service module, a table of a storage database corresponding to the uploaded file of the module, the classification and the name of the service module in the table, a storage path of analysis data and whether a rollback processing function is needed, for example, the file type and table corresponding relation table with the name of a configuration table ccdun sc file type info is used.
And if the analysis is not needed, storing the uploaded file under a certain path according to the file type and table corresponding relation table.
In a third embodiment, based on the first embodiment, as shown in fig. 4, the file uploading method includes the following steps:
4-c, judging whether the uploaded file needs field verification;
step 4-d, if yes, carrying out field verification according to a preset verification rule;
and 4-e, entering the sql generated by the batch insert into a database.
Specifically, if the fields of the columns in the storage database table need to be checked, the fields of the columns are checked according to a dynamically configured rule, after the fields of the columns are checked, the sql of batch insert is dynamically generated, and the sql is inserted into the database in batch. The database table also includes a table and file field checking relation table, which is used for defining and storing the corresponding relation between the database table and the file field, and configuring the rule of field checking, if a plurality of fields exist, a plurality of rows need to be configured, the table name of the relation table needs to correspond to the table name of the file type and table corresponding relation table, and the configuration table includes: the corresponding field name, field description and special checking method in the table. For example, for the file type and table correspondence table with the table name of ccdun sc filetype info, a table and file field check relationship table with the table name of ccdun sc fieldvali conf may be configured. Conventional field check rules may include: the length of the field, the type of format input, whether the field is a mobile phone number, the position of each line of the uploaded file of the mark field and the like, and the special verification method can be configured according to actual needs.
In a fourth embodiment, based on the first embodiment, as shown in fig. 5, the file uploading method includes the following steps:
4-f, judging whether the data entering the database in batch is abnormal or not;
after the data are put in a warehouse in batch, the system judges whether the data put in the warehouse are abnormal or not. The judging method comprises the following steps: the method comprises the steps of judging whether TOTAL _ COUNT and SUCCESS _ COUNT data recorded in a file uploading record table are equal or not according to the fact that whether TOTAL _ COUNT and SUCCESS _ COUNT data recorded in the file uploading record table are equal or not, if the TOTAL _ COUNT and SUCCESS _ COUNT data are not equal, judging whether data entering a database are abnormal or judging whether FAILED _ COUNT quantity in the file uploading record table is larger than 0 or not, if yes, judging that failure data exist, namely data entering the database are abnormal, and needing to be rolled back.
Step 4-g, if yes, rolling back the abnormal data;
and dynamically judging whether ROLLBACK IS needed according to the file type inquired in the DB and the IS _ ROLLBACK field dynamically configured in the table corresponding relation table, Y: and the required ratio of N: and (4) rolling back is not needed, if the judgment result is N, rolling back is not needed, and the data is directly put in a warehouse. If the detected abnormal data does not affect the overall operation of the service, rollback is not needed, and if the detected abnormal data does affect the overall operation of the data, the data of the universal file uploading record table is cleaned. Whether the setting is N is determined by a service generally, the configuration is dynamic, and the rollback processing is performed by a subsequent program to configure SQL in ROLL _ BACK _ SQL.
Secondly, the present invention provides a file uploading device, and the device 20 can be divided into one or more modules.
For example, fig. 6 shows a structure diagram of a first embodiment of the file uploading device 20, in this embodiment, the device 20 may be divided into a data table configuration module 201, an information collection module 202, a user authority determination module 203, a file storage module 204, and a file uploading record module 205. The following description will specifically describe the specific functions of the modules 201 and 205.
A data table configuration module 201, configured to configure a data table uploaded by a file in a system in advance, including a file upload permission control table; a file uploading authority control table is configured in advance in a service module of the system, the control table is a master control table for file uploading, is used for generally controlling the file uploading condition and configuring the corresponding relation between a file uploading role ID and a service uploading function, and a role ID and a corresponding service uploading function authority are configured in advance in the table, wherein the service uploading function in the control table can comprise: the name of the current service module, the classification of the current service module, the role information of the type of the uploaded file, the name of the uploaded file, the maximum limit of the uploaded file, whether the uploaded file needs to be analyzed, whether the uploaded file covers the file before the uploaded file is under the same folder, a service scene storage path, an analysis error log storage path, whether a dynamic folder is created, which field the field of the created folder is taken from, and the like. The specific service uploading function can be dynamically configured according to actual needs, for example, a file uploading authority control table with a table name of ccdun _ sc _ upload _ auth can be configured, the name is field data, the current service module is largely classified as bad asset verification, the current service module is slightly classified as quarterly verification, the name of the service module is a historical abnormal account, the owned role information of the uploaded file type is CSV, the service scene saving PATH is QUARTER _ ZIP _ PATH, and the file saving PATH after analysis is as follows: and the analysis error log saving PATH is QUARTER _ ERRLOG _ PATH.
The information acquisition module 202 is configured to acquire file uploading request information of a user side, where the request information includes a user ID and a file type; when a user logs in a service module at a user side to upload files, the system collects the user ID of the user side and the uploaded file type data for judging the subsequent user authority.
The user authority judging module 203 is used for judging whether the user has the authority to upload the file according to the file uploading authority control table; and after the collected user ID is obtained, reading the AUTH TYPE in the file uploading authority control table to obtain the file type which can be uploaded, and judging whether the user has the authority to upload the file according to the obtained file type. The method specifically comprises the following steps:
step 3-1, reading the user ID and the corresponding service type in the data table;
specifically, after receiving an upload request of a user, the system enters a file upload permission control table, the dynamically configured file upload permission control table is queried from the DB according to a user role ID, an uploadable service type is obtained from a field authTYPE in the table, users with different role IDs have permissions for different upload service TYPES, multiple service functions can be configured for one role in a role and file correspondence table, multiple roles can be configured for one file, and a specific service type is preset and configured in the system for the role ID of the user.
Step 3-2, judging whether the service type is consistent with the file type;
and the system background judges whether the file type of the uploaded file corresponding to the ID is consistent with the service type in the authority control table or not according to the user role ID of the uploaded file.
And 3-3, if so, the user has the authority to upload the file of the type.
And if the file type is consistent with the service type, the user has the authority to upload the file.
The file storage module 204 is used for acquiring and storing the uploaded files of the user; and the JAVA front end compiles a universal uploading page by using jsp, compiles a universal file uploading component to upload a file, and stores the file under a certain PATH according to the UNZIP _ PATH PATH in the file uploading authority control table.
And the file uploading recording module 205 is configured to generate a file recording table and a storage database table according to the data of the uploaded file. The file uploading record table is used for recording the ID, the service type, the file path and the analysis state of file uploading, the table does not need to be configured, and the JAVA module of the universal file compiling component can automatically record the information into the table according to the table which is configured in advance in the front of the system.
The configuration table is established in advance, and only one record needs to be inserted into the configuration table every time, for example, a set of records is configured in the authority control table with the table name of ccdun sc uploadauth, a corresponding configuration record is inserted into the table of the corresponding relationship between the file type and the table with the table name of ccdun sc filetype info, a corresponding field record is inserted into the table with the table name of ccdun sc fieldvalicnf and the file field check relationship table, and a corresponding record is inserted into the file uploading record table.
According to the previous configuration table, the related data uploaded by the file can be automatically imported into the storage database table, and only the structure of the storage database table needs to be established, for example, the storage database table can include: user ID of file uploading, verification and cancellation category, verification and cancellation batch, manual uploading list type, file analysis code and service field. Wherein, manual list type of uploading includes: DM-death missing class, LR-litigation refuting class, CF-fraud counterfeit class, HE-history abnormal account and PB-policy poor pursuit, wherein the file resolution codes correspond to the IDs in the file record table, so that the file resolution codes determine which file the data is resolved from, and the verification batch comprises quarterly verification and accounting for lost accounts.
The file uploading apparatus further includes a file parsing module 206, where the file parsing module 206 includes: an analysis judgment subunit 2061 and an SQL analysis subunit 2062, where the analysis judgment subunit 2061 is configured to judge whether the uploaded file needs to be analyzed; the SQL parsing subunit 2062 is configured to perform SQL parsing on the uploaded file that needs to be parsed. And dynamically judging whether the analysis is needed according to an analysis flag field in a file uploading authority control table, if the analysis is needed, reading a file type and table relation table, acquiring a corresponding relation between a file column index and a table column, and analyzing sql, wherein the sequence and the verification of each field in the table and each field in the file are required, the table only needs to be established for the first time, and only one record needs to be inserted for the subsequent new file analysis. The file type and table corresponding relation table is used for defining the corresponding relation between the file type of an uploaded file and a storage database table, the table comprises the name and the classification of a current service module, a table of a storage database corresponding to the uploaded file of the module, the classification and the name of the service module in the table, a storage path of analysis data and whether a rollback processing function is needed, for example, the file type and table corresponding relation table with the name of a configuration table of ccdun sc filetype info is provided.
And if the analysis is not needed, storing the uploaded file under a certain path according to the file type and table corresponding relation table.
The file uploading device further comprises a field checking module 207, which is used for performing field checking processing on the uploaded file, and comprises: a field check judgment subunit 2071, a field check processing subunit 2072, and a sql generation subunit 2073 of batch insert, where the field check judgment subunit 2071 is configured to judge whether the uploaded file needs to be field checked; the field check processing subunit 2072 is configured to perform field check on the uploaded file according to a preset check rule; the sql generation subunit 2073 of the batch insert is configured to generate sql of the batch insert for the file passing the field check into the database. And if the fields of the columns in the storage database table need to be checked, checking the fields of the columns according to a dynamically configured rule, dynamically generating sql of batch insert after the checking is passed, and inserting the sql into the database in batch. The database table also includes a table and file field checking relation table, which is used for defining and storing the corresponding relation between the database table and the file field, and configuring the rule of field checking, if a plurality of fields exist, a plurality of rows need to be configured, the table name of the relation table needs to correspond to the table name of the file type and table corresponding relation table, and the configuration table includes: corresponding field names, field descriptions and special checking methods in the table. For example, for the file type and table correspondence table with the table name of ccdunsc filetype info, a table and file field check relationship table with the table name of ccdun _ sc _ fieldvali _ conf may be configured. Conventional field check rules may include: the length of the field, the type of format input, whether the field is a mobile phone number, the position of each line of the uploaded file of the mark field and the like, and the special verification method can be configured according to actual needs.
The invention further provides computer equipment.
Fig. 7 is a schematic diagram of a hardware architecture of an embodiment of the computer device according to the present invention. In the present embodiment, the computer device 2 is a device capable of automatically performing numerical calculation and/or information processing in accordance with a command set in advance or stored. For example, the server may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server, or a rack server (including an independent server or a server cluster composed of a plurality of servers). As shown, the computer device 2 includes, but is not limited to, at least a memory 21, a processor 22, and a network interface 23 communicatively coupled to each other via a system bus. Wherein:
the memory 21 includes at least one type of computer-readable storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 21 may be an internal storage unit of the computer device 2, such as a hard disk or a memory of the computer device 2. In other embodiments, the memory 21 may also be an external storage device of the computer device 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device 2. Of course, the memory 21 may also comprise both an internal storage unit of the computer device 2 and an external storage device thereof. In this embodiment, the memory 21 is generally used for storing an operating system installed in the computer device 2 and various types of application software, such as a computer program for implementing the file uploading method. Further, the memory 21 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 22 may be, in some embodiments, a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor, or other file upload chip. The processor 22 is typically used for controlling the overall operation of the computer device 2, such as performing control and processing related to data interaction or communication with the computer device 2. In this embodiment, the processor 22 is configured to run a program code stored in the memory 21 or process data, for example, run a computer program for implementing the file uploading method.
The network interface 23 may comprise a wireless network interface or a wired network interface, and the network interface 23 is typically used to establish a communication connection between the computer device 2 and other computer devices. For example, the network interface 23 is used to connect the computer device 2 to an external terminal through a network, establish a data transmission channel and a communication connection between the computer device 2 and the external terminal, and the like. The network may be a wireless or wired network such as an enterprise internal network (Intranet), the Internet (Internet), a Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth (Bluetooth), Wi-Fi, and the like.
It is noted that fig. 7 only shows the computer device 2 with components 21-23, but it is to be understood that not all shown components are required to be implemented, and that more or less components may be implemented instead. In this embodiment, the computer program stored in the memory 21 for implementing the file uploading method may be executed by one or more processors (in this embodiment, the processor 22) to perform the following steps:
step 1, pre-configuring a data table for uploading files, wherein the data table comprises a file uploading authority control table;
step 2, acquiring file uploading request information of a user side, wherein the request information comprises a user ID and a file type;
step 3, judging whether the user has the authority to upload the file according to the file uploading authority control table;
step 4, if yes, acquiring and storing an uploaded file of the user;
and 5, generating a file uploading record table and a storage database table.
In addition, the present invention relates to a computer-readable storage medium, which is a non-volatile readable storage medium and stores therein a computer program, where the computer program is executable by at least one processor to implement the operations of the above file uploading method or apparatus.
The computer-readable storage medium includes, among others, a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the computer readable storage medium may be an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. In other embodiments, the computer readable storage medium may be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc. provided on the computer device. Of course, the computer-readable storage medium may also include both internal and external storage devices of the computer device. In this embodiment, the computer-readable storage medium is generally used for storing an operating system and various types of application software installed on a computer device, such as the aforementioned computer program for implementing the file uploading method. In addition, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and that the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention, and these changes and modifications are within the scope of the invention.

Claims (10)

1. A file uploading method is characterized by comprising the following steps:
a data table for uploading files is configured in advance, and the data table comprises a file uploading authority control table;
acquiring file uploading request information of a user side, wherein the request information comprises a user ID and a file type;
judging whether the user has the authority to upload the file or not according to the file uploading authority control table;
if yes, acquiring and storing an uploaded file of the user;
and generating a file uploading record table of the uploading file, and updating a storage database table.
2. The method of claim 1, wherein: the method also comprises the following steps after the uploaded file of the user is obtained and stored:
judging whether the uploaded file needs to be analyzed or not;
and if so, carrying out SQL analysis on the uploaded file.
3. The method of claim 1, wherein: the method also comprises the following steps after the uploaded file of the user is obtained and stored:
judging whether the uploaded file needs field verification;
if yes, field verification is carried out according to a preset verification rule;
the sql that generated the batch insert enters the database.
4. The method of claim 3, wherein: after the sql generating the batch insert enters the database, the method further comprises the following steps:
judging whether the data entering the database in batch is abnormal or not;
and if so, rolling back the abnormal data.
5. The method of claim 1, wherein: judging whether the user has the authority to upload the file comprises the following steps:
reading a user ID and a corresponding service type in a data table;
judging whether the service type is consistent with the file type;
and if so, the user has the authority to upload the file of the type.
6. A file uploading apparatus, comprising:
the data table configuration module is used for configuring a data table uploaded by a file in a system in advance, and comprises a file uploading authority control table;
the information acquisition module is used for acquiring file uploading request information of a user side, wherein the request information comprises a user ID and a file type;
the user authority judging module is used for judging whether the user has the authority to upload the file according to the file uploading authority control table;
the file storage module is used for acquiring and storing the uploaded files of the user;
and the file uploading recording module is used for generating a file recording table and a storage database table according to the data of the uploaded file.
7. The apparatus of claim 6, wherein: the file uploading device further comprises a file analysis module, and the file analysis module comprises: the system comprises an analysis judgment subunit and an SQL analysis subunit, wherein the analysis judgment subunit is used for judging whether the uploaded file needs to be analyzed or not; the SQL analysis subunit is used for carrying out SQL analysis processing on the uploaded files needing analysis processing.
8. The apparatus of claim 6, wherein: the file uploading device further comprises a field checking module, which is used for carrying out field checking processing on the uploaded files and comprises the following steps: the field verification judging subunit is used for judging whether the uploaded file needs to be subjected to field verification; the field verification processing subunit is used for performing field verification on the uploaded file according to a preset verification rule; and the sql generation subunit of the batch insert is used for generating sql of the batch insert for the files passing the field check and entering the database.
9. A computer device comprising a memory and a processor, characterized in that: the memory has stored thereon a computer program which, when executed by the processor, carries out the steps of the file upload method of any of claims 1-5.
10. A computer-readable storage medium, having stored therein a computer program executable by at least one processor to perform the steps of the file upload method of any of claims 1-5.
CN201910877121.7A 2019-09-17 2019-09-17 File uploading method, electronic device, computer equipment and storage medium Pending CN110958292A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910877121.7A CN110958292A (en) 2019-09-17 2019-09-17 File uploading method, electronic device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910877121.7A CN110958292A (en) 2019-09-17 2019-09-17 File uploading method, electronic device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110958292A true CN110958292A (en) 2020-04-03

Family

ID=69975448

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910877121.7A Pending CN110958292A (en) 2019-09-17 2019-09-17 File uploading method, electronic device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110958292A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112905533A (en) * 2021-02-05 2021-06-04 优车库网络科技发展(深圳)有限公司 File submission management method, device, equipment and storage medium
CN113094526A (en) * 2021-04-23 2021-07-09 深圳壹账通创配科技有限公司 Picture batch uploading and displaying method and device, computer equipment and storage medium
CN114024955A (en) * 2021-11-01 2022-02-08 北京来也网络科技有限公司 File processing method, device, equipment and medium based on RPA and AI
CN114168185A (en) * 2021-12-08 2022-03-11 航天科技控股集团股份有限公司 Method for uploading upgrade file for vehicle-mounted full liquid crystal instrument
CN115510121A (en) * 2022-10-08 2022-12-23 上海数禾信息科技有限公司 Method, device and equipment for managing business form data and readable storage medium
CN118364024A (en) * 2024-06-20 2024-07-19 北京联讯星烨科技有限公司 Integrated visual display method for enterprise multi-source data

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1553361A (en) * 2003-06-05 2004-12-08 鸿富锦精密工业(深圳)有限公司 Network file download and upload managing system and method
CN104247376A (en) * 2013-04-02 2014-12-24 华为技术有限公司 File uploading method in cloud storage, client, application server, and cloud storage system
CN106991100A (en) * 2016-01-21 2017-07-28 北京京东尚科信息技术有限公司 Data lead-in method and device
CN108491475A (en) * 2018-03-08 2018-09-04 平安科技(深圳)有限公司 Data rapid batch import method, electronic device and computer readable storage medium
CN108874866A (en) * 2018-04-22 2018-11-23 平安科技(深圳)有限公司 Data import management method, apparatus, mobile terminal and storage medium
CN109862062A (en) * 2018-10-24 2019-06-07 平安科技(深圳)有限公司 Content uploading management method and device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1553361A (en) * 2003-06-05 2004-12-08 鸿富锦精密工业(深圳)有限公司 Network file download and upload managing system and method
CN104247376A (en) * 2013-04-02 2014-12-24 华为技术有限公司 File uploading method in cloud storage, client, application server, and cloud storage system
CN106991100A (en) * 2016-01-21 2017-07-28 北京京东尚科信息技术有限公司 Data lead-in method and device
CN108491475A (en) * 2018-03-08 2018-09-04 平安科技(深圳)有限公司 Data rapid batch import method, electronic device and computer readable storage medium
CN108874866A (en) * 2018-04-22 2018-11-23 平安科技(深圳)有限公司 Data import management method, apparatus, mobile terminal and storage medium
CN109862062A (en) * 2018-10-24 2019-06-07 平安科技(深圳)有限公司 Content uploading management method and device, electronic equipment and storage medium

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112905533A (en) * 2021-02-05 2021-06-04 优车库网络科技发展(深圳)有限公司 File submission management method, device, equipment and storage medium
CN113094526A (en) * 2021-04-23 2021-07-09 深圳壹账通创配科技有限公司 Picture batch uploading and displaying method and device, computer equipment and storage medium
CN114024955A (en) * 2021-11-01 2022-02-08 北京来也网络科技有限公司 File processing method, device, equipment and medium based on RPA and AI
CN114024955B (en) * 2021-11-01 2024-03-12 北京来也网络科技有限公司 File processing method, device, equipment and medium based on RPA and AI
CN114168185A (en) * 2021-12-08 2022-03-11 航天科技控股集团股份有限公司 Method for uploading upgrade file for vehicle-mounted full liquid crystal instrument
CN115510121A (en) * 2022-10-08 2022-12-23 上海数禾信息科技有限公司 Method, device and equipment for managing business form data and readable storage medium
CN115510121B (en) * 2022-10-08 2024-01-05 上海数禾信息科技有限公司 List data management method, device, equipment and readable storage medium
CN118364024A (en) * 2024-06-20 2024-07-19 北京联讯星烨科技有限公司 Integrated visual display method for enterprise multi-source data

Similar Documents

Publication Publication Date Title
CN108491475B (en) Data rapid batch import method, electronic device and computer readable storage medium
CN110958292A (en) File uploading method, electronic device, computer equipment and storage medium
CN110069449B (en) File processing method, device, computer equipment and storage medium
CN110147411B (en) Data synchronization method, device, computer equipment and storage medium
CN110309125B (en) Data verification method, electronic device and storage medium
CN110188030A (en) A kind of test data generating method, device and computer equipment, storage medium
CN110704521A (en) Interface data access method and system
CN110175157B (en) Query method and query device for column storage file
CN110928802A (en) Test method, device, equipment and storage medium based on automatic generation of case
CN106547658B (en) Automatic testing method and device
CN110162540B (en) Block chain account book data query method, electronic device and storage medium
CN111737227A (en) Data modification method and system
CN112650753A (en) Log management method, device, system, equipment and readable storage medium
CN111367982B (en) Method, device, computer equipment and storage medium for importing TRRIGA basic data
CN112579608A (en) Case data query method, system, device and computer readable storage medium
CN112181836A (en) Test case generation method, system, device and storage medium
CN110191097B (en) Method, system, equipment and storage medium for detecting security of login page
CN109918221B (en) Hard disk error reporting analysis method, system, terminal and storage medium
CN111143434A (en) Intelligent data checking method, device, equipment and storage medium
CN107844515B (en) Data compliance checking method and device
CN113886590A (en) Data summarizing method and device, computer equipment and storage medium
CN111966339B (en) Buried point parameter input method and device, computer equipment and storage medium
CN112256532A (en) Test interface generation method and device, computer equipment and readable storage medium
CN111125743B (en) Authority management method, system, computer device and computer readable storage medium
CN116244272A (en) Data migration method, system, equipment and medium

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200403