File uploading method and device, equipment and storage medium
Through the automatic upload method, the problems of inefficient and errors in the existing technology of script updates are solved, automatic upload of files and backup of historical files are realized, and update efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202411622047.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-03-25
AI Technical Summary
In the prior art, when updating the execution script, it is necessary to manually upload the execution script to the corresponding production directory, resulting in inefficient update efficiency and prone to errors and omissions.
Provide a file upload method, by obtaining the file to be uploaded and determining whether there is a file with the same name in the pre-configured target storage area, if it exists, the file is backed up, and the file to be uploaded is stored in the target storage area to overwrite the original file, so as to achieve automatic upload.
It improves the efficiency of executing scripts, reduces the risk of errors in manual operations, and realizes automatic upload of files and backup of historical files.
Smart Images

Figure CN119690919A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a file uploading method, device, equipment and storage medium. Background Art
[0002] The update process of the existing ETL (Extract Transform Load) execution script is usually as follows: test the developed execution script, and after passing the test, manually upload the execution script to the production directory, and then execute it through scheduling.
[0003] Since the execution script needs to be manually uploaded to the corresponding production directory to update the execution script, the update efficiency is low and errors may occur due to technical personnel's misoperation. Summary of the invention
[0004] The embodiments of the present disclosure provide a file uploading method, apparatus, device and storage medium to solve the problem in the related art that when updating an execution script, the execution script needs to be manually uploaded to the corresponding production directory, resulting in low update efficiency and prone to errors.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for uploading a file, the method comprising: Get the file to be uploaded; Determine whether there is a target file with the same name as the file to be uploaded in the pre-configured target storage area; When there is a target file with the same name, back up the target file to obtain a backup target file, and store the backup target file in a backup storage area; The files to be uploaded are stored in the target storage area, and the target files with the same name are overwritten.
[0006] In a second aspect, an embodiment of the present disclosure provides a file uploading device, the device comprising: The acquisition module is used to obtain the file to be uploaded; A determination module, used to determine whether there is a target file with the same name as the file to be uploaded in a pre-configured target storage area; A backup module, used for backing up a target file when there is a target file with the same name, obtaining a backup target file, and storing the backup target file in a backup storage area; The upload module is used to store the files to be uploaded in the target storage area and overwrite the target files with the same name.
[0007] In a third aspect, an embodiment of the present disclosure provides a file uploading device, comprising: a processor; and a memory configured to store computer executable instructions, wherein the computer executable instructions, when executed, enable the processor to implement the steps of the method described in the first aspect above.
[0008] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and the computer-executable instructions implement the steps of the method described in the first aspect when executed by a processor.
[0009] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.
[0010] At least one of the above technical solutions provided by the embodiments of the present invention can achieve the following technical effects: In an embodiment of the present invention, the file to be uploaded can be obtained first, and it can be determined whether there is a target file with the same name as the file to be uploaded in a pre-configured target storage area. When a target file with the same name exists, the target file can be backed up to obtain a backup target file, and the backup target file can be stored in the backup storage area. Then, the file to be uploaded can be stored in the target storage area, and the target file with the same name can be overwritten. It can be seen from the above-mentioned embodiments of the invention that the embodiments of the present invention can determine the file to be uploaded as the file to be uploaded, and then, according to the file name of the file to be uploaded, determine whether a target file with the same name as the file to be uploaded is stored in the pre-configured target storage area for storing the file to be uploaded. If the target file is stored, the target file is backed up in the backup storage area, and after the backup is completed, the file to be uploaded is uploaded to the pre-configured target storage area to complete the automatic uploading of the file to be uploaded, and when uploading, the target file with the same name is overwritten to achieve file update. Since the automatic uploading of files can be achieved, the problem of low update efficiency and easy errors caused by manually uploading the execution script to the corresponding production directory when updating the execution script in the prior art can be effectively solved.
[0011] In addition, the embodiment of the present invention can also back up historical files and save complete historical files, thereby facilitating relevant personnel to obtain relevant historical files. For example, when the file is a script file, the embodiment of the present invention can effectively save the historical version of the script file, thereby facilitating the backtracking of the historical version of the script file. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate one or more embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor. Figure 1 One of the flowcharts of the file uploading method provided by one embodiment of the present invention; Figure 2 A second flowchart of a file uploading method provided by an embodiment of the present invention; Figure 3 A schematic diagram of the module composition of a file uploading device 300 provided in one embodiment of the present invention; Figure 4 A schematic diagram of the hardware structure of a file upload device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0013] In order to make the technical parties in this technical field better understand the technical aspects of one or more embodiments of the present disclosure, and to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in combination with the specific embodiments of the present invention and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0014] The technical solutions provided by various embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.
[0015] See also Figure 1 , Figure 1 One of the flowcharts of the file uploading method provided by one embodiment of the present invention is as follows: Figure 1 As shown, the method comprises the following steps: Step 102: Obtain the file to be uploaded.
[0016] Step 104: Determine whether there is a target file with the same name as the file to be uploaded in the pre-configured target storage area.
[0017] Step 106: When there is a target file with the same name, the target file is backed up to obtain a backup target file, and the backup target file is stored in the backup storage area.
[0018] Step 108: Store the file to be uploaded in the target storage area, and overwrite the target file with the same name.
[0019] In an embodiment of the present invention, when a file needs to be uploaded, the file to be uploaded can be determined as a file to be uploaded, and the file to be uploaded can be obtained. In one example, the file to be uploaded can be a file uploaded by a relevant person through an online application created. The file to be uploaded can be a single-layer directory file, or a multi-layer directory file.
[0020] When acquiring the file to be uploaded, the file uploaded by the user through the user terminal may be acquired, and the file uploaded by the user terminal is determined as the file to be uploaded.
[0021] Then, it can be determined whether there is a target file with the same name as the file to be uploaded in the pre-configured target storage area.
[0022] In one example, the file to be uploaded can be first stored in a temporary storage area according to a preset naming rule, and then, based on the file name of the file to be uploaded in the temporary storage area, it can be determined whether there is a target file with the same name as the file to be uploaded in the preconfigured target storage area.
[0023] In this example, three storage areas may be preconfigured, namely, a target storage area for storing uploaded files, a temporary storage area for temporarily storing uploaded files, and a backup storage area for storing backup files.
[0024] In this example, the root directory of the project to which the file to be uploaded belongs can be obtained, and the root directory can be spliced with pre-set directories of different types, and the target storage area, temporary storage area, and backup storage area can be determined based on the spliced directories.
[0025] In this example, depending on the project to which the file to be uploaded belongs, the root directory of the corresponding project can be used to concatenate different types of directories (such as target directory, temporary directory, backup directory) of the corresponding configuration to form an actual operation directory, so as to obtain the target storage area, temporary storage area, and backup storage area based on the formed actual operation directory.
[0026] In one example, the preset naming rule may be in the form of file name + _ + upload time. suffix, and the file name in this form may be used to traverse and compare whether there is a target file with the same name as the file in the temporary storage area.
[0027] When a target file with the same name exists, the target file may be backed up to obtain a backup target file, and the backup target file may be stored in a backup storage area.
[0028] In one example, when there is a specific backup file with the same name as the backup target file in the backup storage area, the backup target file can be stored according to the storage path of the specific backup file in the backup storage area, and when storing, the upload time of the backup target file when it is uploaded to the temporary storage area can also be stored.
[0029] In this example, if there is a target file with the same name, the file backup operation can be triggered, and the target file can be stored in the backup directory, where the backup path structure can be the configured backup root directory + update target directory, and the backup file name can be the file name + _ + backup time + . suffix.
[0030] In this example, the backup operation can back up the complete directory, so the directory of the backup storage area can be created exactly as the target storage area.
[0031] It should be noted that if there is no target file with the same name in the pre-configured target storage area, you can first upload the file to the target storage area and then back it up in the backup storage area. Since the same directory may be updated multiple times, multiple backups of different versions are required. Therefore, the same directory is not created multiple times in the backup directory, and only the same path is used. However, each uploaded file can be backed up and stored separately according to the upload time, that is, there will be multiple identical files of different versions in one directory.
[0032] After the backup is completed, the files to be uploaded can be stored in the target storage area, and the target files with the same name can be overwritten.
[0033] For example, see Figure 2 , the file to be uploaded can be obtained, wherein the name of the file to be uploaded is a, b, c. The file to be uploaded can be first stored in a temporary storage area and stored according to a preset naming rule. Then, according to the name of the file to be uploaded, it is searched whether there is a target file with the same file name in the target storage area. When there is a target file with the same name, it is backed up in the backup storage area. After the backup is successful, the b file is stored in the target storage area and the previous target file is overwritten.
[0034] In one embodiment of the present invention, when obtaining the file to be uploaded, a communication channel can be established with a development environment server, wherein the development environment server is a server that generates the file to be uploaded, and then, through the communication channel, the file to be uploaded sent by the development environment server after the file to be uploaded passes the test is obtained. The file can be a single-layer directory file or a multi-layer directory file.
[0035] In the embodiment of the present invention, a dedicated communication channel may be established with the development environment server, and a corresponding file transfer command may be generated and executed to perform a file synchronization operation through the communication channel.
[0036] When performing file synchronization, the user can select the file synchronization range, and can synchronize a single file or synchronize multi-layer directory files. When synchronizing files through a communication channel, it is also necessary to traverse the target storage area to determine whether a backup is required. If a backup is required, if it is a multi-layer directory file, the entire directory needs to be backed up. Since the entire directory can be backed up, omissions and misoperations caused by manual operations can be avoided, and the update efficiency is also improved. Before each update operation, it is automatically determined whether a backup is required, which facilitates version rollback and historical search, and reduces the possibility of problems.
[0037] In an embodiment of the present invention, the file to be uploaded can be obtained first, and it can be determined whether there is a target file with the same name as the file to be uploaded in a pre-configured target storage area. When a target file with the same name exists, the target file can be backed up to obtain a backup target file, and the backup target file can be stored in the backup storage area. Then, the file to be uploaded can be stored in the target storage area, and the target file with the same name can be overwritten. It can be seen from the above-mentioned embodiments of the invention that the embodiments of the present invention can determine the file to be uploaded as the file to be uploaded, and then, according to the file name of the file to be uploaded, determine whether a target file with the same name as the file to be uploaded is stored in the pre-configured target storage area for storing the file to be uploaded. If the target file is stored, the target file is backed up in the backup storage area, and after the backup is completed, the file to be uploaded is uploaded to the pre-configured target storage area to complete the automatic uploading of the file to be uploaded, and when uploading, the target file with the same name is overwritten to achieve file update. Since the automatic uploading of files can be achieved, the problem of low update efficiency and easy errors caused by manually uploading the execution script to the corresponding production directory when updating the execution script in the prior art can be effectively solved.
[0038] In addition, the embodiment of the present invention can also back up historical files and save complete historical files, thereby facilitating relevant personnel to obtain relevant historical files. For example, when the file is a script file, the embodiment of the present invention can effectively save the historical version of the script file, thereby facilitating the backtracking of the historical version of the script file.
[0039] Corresponding to the above-mentioned file uploading method, the embodiment of the present invention further provides a file uploading device, Figure 3 A schematic diagram of the module composition of the file upload device 300 provided in an embodiment of the present invention is shown in FIG. Figure 3As shown, the file uploading device 300 includes: The acquisition module 301 is used to acquire the file to be uploaded; A determination module 302 is used to determine whether there is a target file with the same name as the file to be uploaded in a pre-configured target storage area; A backup module 303 is used to back up the target file when there is a target file with the same name, obtain a backup target file, and store the backup target file in a backup storage area; The upload module 304 is used to store the files to be uploaded in the target storage area and overwrite the target files with the same name.
[0040] Optionally, the acquisition module 301 is used to: Acquire files uploaded by the user terminal, and determine the files uploaded by the user terminal as files to be uploaded; The determination module 302 is used to: According to a preset naming rule, the file to be uploaded is stored in a temporary storage area; According to the file name of the file to be uploaded in the temporary storage area, it is determined whether there is a target file with the same name as the file to be uploaded in the pre-configured target storage area.
[0041] Optionally, the acquisition module 301 is used to: Establishing a communication channel with a development environment server; wherein the development environment server is a server that generates the file to be uploaded; The file to be uploaded sent by the development environment server after the file to be uploaded passes the test is obtained through the communication channel.
[0042] Optionally, the device further comprises ( Figure 3 not shown): A root directory determination module 305 is used to obtain the root directory of the project to which the file to be uploaded belongs; A splicing module 306, used for splicing the root directory with pre-set directories of different types; The area determination module 307 is used to determine the target storage area, the temporary storage area, and the backup storage area according to the spliced directory.
[0043] Optionally, the file to be uploaded is a single-layer directory file, or a multi-layer directory file.
[0044] In an embodiment of the present invention, the file to be uploaded can be obtained first, and it can be determined whether there is a target file with the same name as the file to be uploaded in a pre-configured target storage area. When a target file with the same name exists, the target file can be backed up to obtain a backup target file, and the backup target file can be stored in the backup storage area. Then, the file to be uploaded can be stored in the target storage area, and the target file with the same name can be overwritten. It can be seen from the above-mentioned embodiments of the invention that the embodiments of the present invention can determine the file to be uploaded as the file to be uploaded, and then, according to the file name of the file to be uploaded, determine whether a target file with the same name as the file to be uploaded is stored in the pre-configured target storage area for storing the file to be uploaded. If the target file is stored, the target file is backed up in the backup storage area, and after the backup is completed, the file to be uploaded is uploaded to the pre-configured target storage area to complete the automatic uploading of the file to be uploaded, and when uploading, the target file with the same name is overwritten to achieve file update. Since the automatic uploading of files can be achieved, the problem of low update efficiency and easy errors caused by manually uploading the execution script to the corresponding production directory when updating the execution script in the prior art can be effectively solved.
[0045] In addition, the embodiment of the present invention can also back up historical files and save complete historical files, thereby facilitating relevant personnel to obtain relevant historical files. For example, when the file is a script file, the embodiment of the present invention can effectively save the historical version of the script file, thereby facilitating the backtracking of the historical version of the script file.
[0046] Corresponding to the above-mentioned file uploading method, the embodiment of the present invention further provides a file uploading device, Figure 4 A schematic diagram of the hardware structure of a file upload device provided by an embodiment of the present invention.
[0047] The file uploading device may be a terminal device or a server for uploading files provided in the above embodiment.
[0048] The file upload device may have relatively large differences due to different configurations or performances, and may include one or more processors 401 and memory 402, and the memory 402 may store one or more storage applications or data. Among them, the memory 402 may be a short-term storage or a persistent storage. The application stored in the memory 402 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the file upload device. Furthermore, the processor 401 may be configured to communicate with the memory 402 to execute a series of computer executable instructions in the memory 402 on the file upload device. The file upload device may also include one or more power supplies 403, one or more wired or wireless network interfaces 404, one or more input and output interfaces 405, and one or more keyboards 406.
[0049] Specifically in this embodiment, the file upload device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions in the file upload device, and is configured to be executed by one or more processors.
[0050] In an embodiment of the present invention, the file to be uploaded can be obtained first, and it can be determined whether there is a target file with the same name as the file to be uploaded in a pre-configured target storage area. When a target file with the same name exists, the target file can be backed up to obtain a backup target file, and the backup target file can be stored in the backup storage area. Then, the file to be uploaded can be stored in the target storage area, and the target file with the same name can be overwritten. It can be seen from the above-mentioned embodiments of the invention that the embodiments of the present invention can determine the file to be uploaded as the file to be uploaded, and then, according to the file name of the file to be uploaded, determine whether a target file with the same name as the file to be uploaded is stored in the pre-configured target storage area for storing the file to be uploaded. If the target file is stored, the target file is backed up in the backup storage area, and after the backup is completed, the file to be uploaded is uploaded to the pre-configured target storage area to complete the automatic uploading of the file to be uploaded, and when uploading, the target file with the same name is overwritten to achieve file update. Since the automatic uploading of files can be achieved, the problem of low update efficiency and easy errors caused by manually uploading the execution script to the corresponding production directory when updating the execution script in the prior art can be effectively solved.
[0051] In addition, the embodiment of the present invention can also back up historical files and save complete historical files, thereby facilitating relevant personnel to obtain relevant historical files. For example, when the file is a script file, the embodiment of the present invention can effectively save the historical version of the script file, thereby facilitating the backtracking of the historical version of the script file.
[0052] Another embodiment of the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and the computer-executable instructions implement the above process when executed by a processor.
[0053] The storage medium in the embodiment of the present disclosure can implement each process of the above-mentioned file upload method embodiment and achieve the same effect and function, which will not be repeated here.
[0054] Another embodiment of the present disclosure further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the above process is implemented.
[0055] The computer program product in the embodiment of the present disclosure can implement each process of the above-mentioned file uploading method embodiment and achieve the same effect and function, which will not be repeated here.
[0056] In various embodiments of the present disclosure, the computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0057] In the 1990s, it was very clear whether the improvement of a technology was hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0058] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.
[0059] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0060] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing the embodiments of the present disclosure, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0061] It should be understood by those skilled in the art that one or more embodiments of the present disclosure may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, one or more embodiments of the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0062] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0063] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0064] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0065] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0066] One or more embodiments of the present disclosure may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present disclosure may also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0067] Each embodiment in the present disclosure is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0068] The above description is only an embodiment of the present disclosure and is not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the scope of the claims of the present disclosure.
Claims
1. A file uploading method, characterized in that: The method comprises: Get the file to be uploaded; Determine whether there is a target file with the same name as the file to be uploaded in the pre-configured target storage area; When there is a target file with the same name, back up the target file to obtain a backup target file, and store the backup target file in a backup storage area; The files to be uploaded are stored in the target storage area, and the target files with the same name are overwritten.
2. The method according to claim 1, characterized in that The step of obtaining the file to be uploaded includes: Acquire files uploaded by the user terminal, and determine the files uploaded by the user terminal as files to be uploaded; The determining whether there is a target file with the same name as the file to be uploaded in the pre-configured target storage area includes: According to a preset naming rule, the file to be uploaded is stored in a temporary storage area; According to the file name of the file to be uploaded in the temporary storage area, it is determined whether there is a target file with the same name as the file to be uploaded in the pre-configured target storage area.
3. The method according to claim 1, characterized in that The step of obtaining the file to be uploaded includes: Establishing a communication channel with a development environment server; wherein the development environment server is a server that generates the file to be uploaded; The file to be uploaded sent by the development environment server after the file to be uploaded passes the test is obtained through the communication channel.
4. The method according to claim 2, characterized in that: Before storing the to-be-uploaded file in the temporary storage area according to the preset naming rule, the method further includes: Obtain the root directory of the project to which the file to be uploaded belongs; Joining the root directory with pre-set directories of different types; According to the spliced directory, determine the target storage area, temporary storage area, and backup storage area.
5. The method according to claim 2, characterized in that: The step of storing the backup target file in the backup storage area includes: When there is a specific backup file with the same name as the backup target file in the backup storage area, the backup target file is stored according to the storage path of the specific backup file in the backup storage area, and when storing, the upload time of the backup target file when it is uploaded to the temporary storage area is also stored.
6. The method according to any one of claims 1 to 5, characterized in that: The file to be uploaded is a single-layer directory file, or a multi-layer directory file.
7. A file uploading device, characterized in that: The device comprises: The acquisition module is used to obtain the file to be uploaded; A determination module, used to determine whether there is a target file with the same name as the file to be uploaded in a pre-configured target storage area; A backup module, used for backing up a target file when there is a target file with the same name, obtaining a backup target file, and storing the backup target file in a backup storage area; The upload module is used to store the files to be uploaded in the target storage area and overwrite the target files with the same name.
8. A file uploading device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the method according to any one of claims 1 to 6 when executed by the processor.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.