File Transfer Method, File Transfer Device, Electronic Device, and Storage Medium

Through artificial intelligence technology, the server storage space is automatically monitored and optimized, and the problem of inefficient file transfer is solved and efficient file transfer and storage space management is achieved.

CN115033542BActive Publication Date: 2025-07-22CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210688703.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-17
Publication Date
2025-07-22
Estimated Expiration
2042-06-17

AI Technical Summary

Technical Problem

In the prior art, during file transfer, whether the server storage space meets the transmission needs by manually monitoring, resulting in low transmission efficiency.

Method used

Through artificial intelligence technology, the target storage data is read from the task configuration table, including storage space and directory information, and the space usage status of the server is automatically monitored, and cleaned up when there is insufficient to ensure that the process status is not occupied and file transfer is performed.

Benefits of technology

It realizes automatic file transmission, improves transmission efficiency, saves manpower and time costs, and ensures optimization of storage space and stability of file transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115033542B_ABST
    Figure CN115033542B_ABST
Patent Text Reader

Abstract

The present application provides a file transmission method, a file transmission device, an electronic device and a storage medium, belonging to the technical field of artificial intelligence. The method includes: reading target storage data from a preset task configuration table, where the target storage data includes storage space information and storage directory information of a target file; reading the current space usage status of a target server; where the current space usage status includes a first usage status or a second usage status; when the current space usage status is the first usage status, cleaning the current storage space until the current space usage status changes from the first usage status to the second usage status; when the current space usage status is the second usage status, obtaining the process status of the target file; when the process status is an unoccupied status, transmitting the target file to the target server according to the storage directory information. The present application can improve the transmission efficiency of files.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular, to a file transmission method, a file transmission device, an electronic device, and a storage medium. Background Art

[0002] Currently, during the file transmission process, the artificial monitoring method is often used to monitor whether the storage space of the server meets the transmission requirements, which affects the file transmission efficiency. Therefore, how to improve the file transmission efficiency has become an urgent technical problem to be solved. Summary of the Invention

[0003] The main objective of the embodiments of this application is to propose a file transmission method, a file transmission device, an electronic device, and a storage medium, aiming to improve the file transmission efficiency.

[0004] To achieve the above objective, the first aspect of the embodiments of this application proposes a file transmission method, and the method includes:

[0005] Read target storage data from a preset task configuration table, where the target storage data includes the storage space information and storage directory information of the target file, the storage space information includes the information about the space required to store the target file, and the storage directory information includes the directory information for storing the target file;

[0006] Read the current space usage status of the target server; where the current space usage status includes a first usage status or a second usage status;

[0007] When the current space usage status is the first usage status, clean up the current storage space until the current space usage status changes from the first usage status to the second usage status;

[0008] When the current space usage status is the second usage status, obtain the process status of the target file;

[0009] When the process status is the unoccupied status, transmit the target file to the target server according to the storage directory information.

[0010] In some embodiments, the storage space information includes the target storage space, and the step of reading the current space usage status of the target server includes:

[0011] Read the free storage space of the target server;

[0012] If the free storage space is less than or equal to the target storage space, the current space usage status is the first usage status;

[0013] If the free storage space is greater than the target storage space, the current space usage status is the second usage status.

[0014] In some embodiments, the step of cleaning the current storage space until the current space usage status changes from the first usage status to the second usage status when the current space usage status is the first usage status includes:

[0015] When the current space usage status is the first usage status, obtain the current stored data of the target server, where the current stored data includes the current storage space of the target server storing the original files;

[0016] According to the target storage space and the current storage space, screen out candidate files from the original files;

[0017] Clean the candidate files and execute the step of reading the current space usage status of the target server until the current space usage status changes from the first usage status to the second usage status.

[0018] In some embodiments, the step of screening out candidate files from the original files according to the target storage space and the current storage space includes:

[0019] Perform a difference operation on the target storage space and the free storage space to obtain a candidate storage space;

[0020] Compare the current storage space with the candidate storage space;

[0021] Perform a screening process on the original files according to the comparison result to obtain the candidate files.

[0022] In some embodiments, after the step of obtaining the process status of the target file when the current space usage status is the second usage status, the method further includes:

[0023] When the process status is the occupied status, obtain the target device and the device information of the target device; where the target device is the device that occupies the target file;

[0024] Perform a parsing process on the device information to obtain the target address data of the target device;

[0025] If the target address data is inconsistent with the reference address data, control the target device to release the target file.

[0026] In some embodiments, the stored directory information includes a target directory, and the step of transmitting the target file to the target server according to the stored directory information when the process status is the unoccupied status includes:

[0027] When the process status is the unoccupied status, perform parsing processing on the stored directory information to obtain a storage path;

[0028] Transmit the target file to the target directory of the target server according to the storage path; wherein, the storage path and the target directory are used to indicate that the target server stores the target file.

[0029] In some embodiments, after the step of transmitting the target file to the target server when the process status is the unoccupied status, the method further includes:

[0030] Obtain the current storage information of the target server; wherein, the current storage information includes file information and directory information currently stored by the target server;

[0031] Perform visualization processing on the current stored directory information according to a preset graphic template to obtain a storage display diagram;

[0032] Display the storage display diagram on a target platform.

[0033] To achieve the above object, a second aspect of the embodiments of the present application proposes a file transmission device, and the device includes:

[0034] A data reading module, configured to read target storage data from a preset task configuration table, wherein the target storage data includes storage space information and stored directory information of a target file, the storage space information includes information about the space required to store the target file, and the stored directory information includes directory information for storing the target file;

[0035] A status reading module, configured to read the current space usage status of the target server; wherein, the current space usage status includes a first usage status or a second usage status;

[0036] A space cleaning module, configured to clean the current storage space when the current space usage status is the first usage status until the current space usage status changes from the first usage status to the second usage status;

[0037] A status obtaining module, configured to obtain the process status of the target file when the current space usage status is the second usage status;

[0038] A transmission module, configured to transmit the target file to the target server according to the storage directory information when the process status is the unoccupied status.

[0039] To achieve the above object, a third aspect of the embodiments of the present application provides an electronic device, which includes a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for realizing connection communication between the processor and the memory. When the program is executed by the processor, the method described in the first aspect above is implemented.

[0040] To achieve the above object, a fourth aspect of the embodiments of the present application provides a storage medium, which is a computer-readable storage medium for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method described in the first aspect above.

[0041] The file transmission method, file transmission device, electronic device and storage medium provided by the present application can clearly obtain the directory where each target file should be stored and the size of the space required to store the target file by reading target storage data from a preset task configuration table. The target storage data includes storage space information and storage directory information of the target file. The storage space information includes information about the space required to store the target file, and the storage directory information includes directory information for storing the target file. Further, the current space usage status of the target server is read; the current space usage status includes a first usage status or a second usage status; when the current space usage status is the first usage status, the current storage space is cleaned until the current space usage status changes from the first usage status to the second usage status, which can conveniently optimize the storage space of the target server so that the storage space of the target server meets the transmission requirements. Finally, when the current space usage status is the second usage status, the process status of the target file is obtained; when the process status is the unoccupied status, the target file is transmitted to the target server according to the storage directory information. In this way, it is possible to determine whether the target file can be normally transmitted based on the process status of the target file, so as to transmit the unoccupied target file and store the target file on the target server. This method can achieve automatic file transmission, thereby improving the file transmission efficiency and saving labor costs and time costs. Description of the Drawings

[0042] Figure 1 is an interaction schematic diagram of the file transmission process provided by the embodiments of the present application;

[0043] Figure 2 is a flowchart of the file transmission method provided by the embodiments of the present application;

[0044] Figure 3 is Figure 2 the flowchart of step S202 in

[0045] Figure 4 is Figure 2 the flowchart of step S203 in

[0046] Figure 5 is Figure 4 the flowchart of step S402 in

[0047] Figure 6 is another flowchart of the file transfer method provided by the embodiments of the present application;

[0048] Figure 7 is Figure 2 the flowchart of step S205 in

[0049] Figure 8 is yet another flowchart of the file transfer method provided by the embodiments of the present application;

[0050] Figure 9 is the structural schematic diagram of the file transfer device provided by the embodiments of the present application;

[0051] Figure 10 is the hardware structural schematic diagram of the electronic device provided by the embodiments of the present application. Detailed implementation manners

[0052] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0053] It should be noted that although functional module division is performed in the device schematic diagram and the logical sequence is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order from the module division in the device or the sequence in the flowchart. Terms such as "first" and "second" in the specification, claims and the above-mentioned drawings are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence.

[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0055] First, several nouns involved in the present application are analyzed:

[0056] Artificial Intelligence (AI): It is a new technical science that studies and develops theories, methods, technologies, and application systems for simulating, extending, and expanding human intelligence. Artificial intelligence is a branch of computer science. It attempts to understand the essence of intelligence and produce an intelligent machine that can respond in a way similar to human intelligence. The research in this field includes robots, speech recognition, image recognition, natural language processing, and expert systems, etc. Artificial intelligence can simulate the information processes of human consciousness and thinking. It is also a theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results.

[0057] Server: It is a computer that manages computing resources. It runs faster, has a higher load, and is more expensive than ordinary computers. The server provides computing or application services for other client computers (such as terminals like PCs, smartphones, ATMs, and even large devices like train systems) in the network. The server has high-speed CPU computing power, long-term reliable operation, powerful I / O external data throughput capacity, and better scalability. Generally speaking, according to the services provided by the server, it has the ability to undertake response service requests, undertake services, and guarantee services. As an electronic device, the internal structure of the server is very complex, but it is not much different from the internal structure of ordinary computers, such as: CPU, hard disk, memory, system, system bus, etc.

[0058] Secure File Transfer Protocol (SFTP): It is a file transfer protocol that can provide a secure encryption method for file transfer.

[0059] Memory: It is an important component of a computer, also known as internal memory and main memory. It is used to temporarily store the operation data in the CPU and the data exchanged with external memories such as hard disks. It is a bridge for communication between the external memory and the CPU. All programs in the computer run in the memory, and the performance of the memory affects the overall performance of the computer. As long as the computer starts running, the operating system will transfer the data to be processed from the memory to the CPU for operation. When the operation is completed, the CPU will send out the result.

[0060] Process: It is an execution activity of a program in a computer with respect to a certain data set. It is the basic unit for the system to allocate and schedule resources and is the foundation of the operating system structure. In the early computer architectures designed for processes, a process was the basic execution entity of a program; in contemporary computer architectures designed for threads, a process is a container for threads. A program is a description of instructions, data, and their organizational forms, and a process is the entity of a program.

[0061] Currently, during the file transfer process, the method of manually monitoring is often used to check whether the storage space of the server meets the transfer requirements. This method requires the monitoring personnel to manually check each storage directory one by one and clean up the space, which affects the file transfer efficiency. Therefore, how to improve the file transfer efficiency has become a technical problem to be solved urgently.

[0062] Based on this, the embodiments of the present application provide a file transfer method, a file transfer device, an electronic device, and a storage medium, aiming to improve the file transfer efficiency.

[0063] The file transfer method, file transfer device, electronic device, and storage medium provided by the embodiments of the present application are specifically described through the following embodiments. First, the file transfer method in the embodiments of the present application is described.

[0064] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, Artificial Intelligence (AI) is to use a digital computer or a machine controlled by a digital computer to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results of theory, method, technology, and application system.

[0065] Artificial intelligence basic technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technologies mainly include several major directions such as computer vision technology, robotics, biometric technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0066] The file transfer method provided by the embodiments of the present application relates to the field of artificial intelligence technology. The file transfer method provided by the embodiments of the present application can be applied to a terminal, can also be applied to a server side, or can be software running on a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc.; the server side can be configured as an independent physical server, can also be configured as a server cluster or a distributed system composed of multiple physical servers, or can also be configured as a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the file transfer method, etc., but is not limited to the above forms.

[0067] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and so on. The present application can 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. The present application can also be practiced in a distributed computing environment where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0068] Refer to Figure 1 and Figure 2 , Figure 1 FIG. is an interaction schematic diagram of the file transfer process provided by the embodiments of the present application. The file transfer method of the embodiments of the present application is mainly used for file transfer between the target server 103 and the database 100, that is, the file to be transferred in the database 100 is transferred to the target server 103 through the production end 101. Figure 2 FIG. is an optional flowchart of the file transfer method provided by the embodiments of the present application. Figure 2 The method in may include but is not limited to steps S201 to S205.

[0069] Step S201, read target storage data from a preset task configuration table, where the target storage data includes storage space information and storage directory information of a target file, the storage space information includes information on the space required to store the target file, and the storage directory information includes directory information for storing the target file;

[0070] Step S202, read the current space usage status of the target server; wherein, the current space usage status includes a first usage status or a second usage status;

[0071] Step S203, when the current space usage status is the first usage status, clean the current storage space until the current space usage status changes from the first usage status to the second usage status;

[0072] Step S204, when the current space usage status is the second usage status, obtain the process status of the target file;

[0073] Step S205, when the process status is the unoccupied status, transmit the target file to the target server according to the storage directory information.

[0074] In steps S201 to S205 shown in the embodiments of the present application, the production end 101 reads the target storage data from the task configuration table 102 in the database 100. Among them, the target storage data includes the storage space information and storage directory information of the target file. The storage space information includes the information about the space required to store the target file, and the storage directory information includes the directory information for storing the target file. In this way, it can clearly obtain the directory where each target file should be stored and the size of the space required to store the target file. Further, the production end 101 will read the current space usage status of the target server 103; wherein, the current space usage status includes a first usage status or a second usage status; when the current space usage status is the first usage status, clean the current storage space until the current space usage status changes from the first usage status to the second usage status, which can conveniently optimize the storage space of the target server 103 so that the storage space of the target server 103 meets the transmission requirements. Finally, when the current space usage status is the second usage status, obtain the process status of the target file; when the process status is the unoccupied status, the production end 101 transmits the target file to the target server 103 according to the storage directory information. In this way, it can judge whether the target file can be normally transmitted according to the process status of the target file, so as to transmit the unoccupied target file and store the target file in the target server. This method can realize the automatic transmission of files, thereby improving the file transmission efficiency and saving labor costs and time costs at the same time.

[0075] In step S201 of some embodiments, the target storage data can be read from a preset task configuration table by writing a script program. It is also possible to obtain the target storage data by other means, and it is not limited to this. Among them, the target storage data includes the storage space information and storage directory information of the target file. The storage space information is the information about the space required to store the target file, and the storage directory information is the directory information for storing the target file.

[0076] Please refer to Figure 3 , in some embodiments, the storage space information includes the target storage space, and step S202 may include but is not limited to steps S301 to S303:

[0077] Step S301, read the free storage space of the target server;

[0078] Step S302, if the free storage space is less than or equal to the target storage space, the current space usage status is the first usage status;

[0079] Step S303, if the free storage space is greater than the target storage space, the current space usage status is the second usage status.

[0080] In step S301 of some embodiments, a preset script program is used to read the free storage space of the target server. Among them, the target server can be an SFTP server, etc., and the free storage space is the memory size that the target server can still receive and store files.

[0081] In step S302 of some embodiments, if the free storage space is less than or equal to the target storage space, it indicates that the free storage space of the target server cannot meet the transmission requirements of the target file, then the current space usage status is the first usage status. Among them, the first usage status can specifically be a space shortage status, etc.

[0082] In step S303 of some embodiments, if the free storage space is greater than the target storage space, it indicates that the free storage space of the target server can meet the transmission requirements of the target file, then the current space usage status is the second usage status. Among them, the second usage status can specifically be a space sufficient status, etc.

[0083] Through the above steps S301 to S303, it is relatively convenient to determine whether the free storage space of the target server can meet the transmission requirements of the target file, so as to clean up the space of the target server in time when the free storage space of the target server is insufficient, which can improve the timeliness of space cleaning.

[0084] Please refer to Figure 4 , in some embodiments, step S203 may include but is not limited to steps S401 to S403:

[0085] Step S401, when the current space usage status is the first usage status, obtain the current stored data of the target server, where the current stored data includes the current storage space of the target server for storing the original file;

[0086] Step S402, screen out candidate files from the original files according to the target storage space and the current storage space;

[0087] Step S403: Clean the candidate files and execute the step of reading the current space usage status of the target server until the current space usage status changes from the first usage status to the second usage status.

[0088] In step S401 of some embodiments, in order to make the free storage space of the target server meet the transmission requirements, when the current space usage status is the first usage status, by writing a web crawler or a script program, after setting up the data source, crawl data purposefully to obtain the current stored data of the target server. The current stored data of the target server can also be obtained by other means, not limited to this. Among them, the current stored data includes the current storage space where the target server stores the original files.

[0089] In step S402 of some embodiments, determine the space occupied by each original file on the target server according to the current storage space, screen and process the original files according to the space occupied by each original file, and use the original files that need to be cleaned as candidate files.

[0090] In step S403 of some embodiments, automate the cleaning of the candidate files by writing a script program, clear all file data of the candidate files from the target server, so as to expand the free space of the target server. In order to make the free storage space of the target server meet the transmission requirements, it is necessary to continuously read the free storage space of the target server, analyze and clean the current storage space of the target server according to the size relationship between the free storage space and the target storage space until the current space usage status changes from the first usage status to the second usage status. At this time, the free storage space of the target server can meet the transmission requirements of the target files.

[0091] Through the above steps S401 to S403, the storage space of the target server can be conveniently cleaned and optimized, so that the storage space of the target server meets the transmission requirements.

[0092] Please refer to Figure 5 , in some embodiments, step S402 may include but is not limited to steps S501 to S503:

[0093] Step S501: Calculate the difference between the target storage space and the free storage space to obtain the candidate storage space;

[0094] Step S502: Compare the current storage space with the candidate storage space;

[0095] Step S503: Screen and process the original files according to the comparison result to obtain the candidate files.

[0096] In step S501 of some embodiments, a difference operation is performed on the target storage space and the free storage space to obtain a candidate storage space, where the candidate storage space = target storage space - free storage space, and this candidate storage space is the space that the target server still needs to reserve for the normal transmission of the target file.

[0097] In steps S502 and S503 of some embodiments, the storage memory size of each original file in the current storage space is compared with the size of the candidate storage space. To reduce the operation time, the original files with a storage memory larger than the candidate storage space are selected as initial files, and the initial file with the smallest storage memory among this series of initial files is used as the candidate file, that is, the candidate file is the original file whose storage memory is closest to the candidate storage space. By clearing the original file whose storage memory is closest to the candidate storage space, it is possible to reduce the number of file clearing times while ensuring that the released storage space meets the file transmission requirements.

[0098] Furthermore, since some original files in the target server should not be cleared according to the importance of the files, before clearing the original files, the original files can be marked through machine marking or manual marking, and the original files are divided into two types: cleanable and non-cleanable. When the free storage space of the target server is insufficient, according to the comparison between the current storage space and the candidate storage space, the cleanable original files are screened to obtain candidate files, and the candidate files are cleared.

[0099] Through the above steps S501 to S503, file cleaning can be performed according to the storage memory of the original files and the storage space that the target server actually needs to release, which can reduce the number of file cleaning times while ensuring that the released storage space meets the file transmission requirements. In addition, according to the importance of the files, only the cleanable original files are selected for cleaning, which can also improve the file storage standardization and security of the target server.

[0100] In step S204 of some embodiments, in order to improve the stability of file transmission, it is also necessary to obtain the process status of the target file through a preset script program when the current space usage status is the second usage status, where the process status includes an occupied status and an unoccupied status. If the target file is transmitted when it is in the occupied status, the transmission will fail. If the target file is transmitted when it is in the unoccupied status, the target file can be normally transmitted. Therefore, confirming the process status of the target file before file transmission can timely handle the target files that may fail to be transmitted, improving the stability and success rate of file transmission.

[0101] Please refer to Figure 6, after step S204 of some embodiments, the file transfer method includes but is not limited to steps S601 to S603:

[0102] Step S601, when the process status is the occupied state, obtain the target device and the device information of the target device; wherein, the target device is the device that occupies the target file;

[0103] Step S602, perform parsing processing on the device information to obtain the target address data of the target device;

[0104] Step S603, if the target address data is inconsistent with the reference address data, then control the target device to release the target file.

[0105] In step S601 of some embodiments, in order to improve the stability of file transfer, it is also necessary to analyze the occupancy situation of the target file when the process status is the occupied state, and adjust the process status of the target file in a timely manner. Specifically, when the process status is the occupied state, obtain the target device and the device information of the target device through a preset script program; wherein, the target device is the device that occupies the target file.

[0106] In step S602 of some embodiments, perform parsing processing on the device information, and divide the device information into multiple information fields according to different information types. Among them, the information types include address, model, factory date, etc. Therefore, the target address data of the target device belonging to the address type can be obtained, where the target address data includes the IP address of the target device, etc.

[0107] In step S603 of some embodiments, compare the target address data with the reference address data, where the reference address data includes the IP address of the device that has the priority occupancy right to the target file at any time. Therefore, by comparing the target address data with the reference address data, if the target address data is consistent with the reference address data, it indicates that in the current file transfer stage, the target device can preferentially occupy and run the target file, and then keep the occupancy state of the target file unchanged; if the target address data is inconsistent with the reference address data, it indicates that in order to improve the file transfer efficiency, the occupancy of the target file by the target device can be released, that is, control the target device to release the target file, and when the target device completely releases the target file, modify the process status of the target file from the occupied state to the unoccupied state.

[0108] Through the above steps S601 to S603, it is possible to conveniently analyze the occupancy situation of the target file, and modify the process status of the target file in a timely manner according to the actual business requirements, so that the target file can be normally transferred, improving the stability and transfer efficiency of file transfer.

[0109] Please refer to Figure 7, in some embodiments, the stored directory information includes a target directory, and step S205 includes but is not limited to steps S701 to S702:

[0110] Step S701, when the process status is unoccupied, perform parsing processing on the stored directory information to obtain a storage path;

[0111] Step S702, transfer the target file to the target directory of the target server according to the storage path; wherein, the storage path and the target directory are used to indicate that the target server stores the target file.

[0112] In step S701 of some embodiments, when the process status is unoccupied, perform parsing processing on the stored directory information, extract the text path in the stored directory information to obtain a storage path, wherein the storage path includes folder information for storing the target file, the target directory is the directory in the target server where the target file should be stored, the stored directory information includes the directory name of the target directory and the level to which the directory belongs, and the storage path and the target directory are used to indicate that the target server stores the target file. For example, according to the storage path and the target directory, it is indicated that the target server stores the target file in directory A of the first-level directory under the root directory.

[0113] In step S702 of some embodiments, since the storage path and the target directory can indicate that the target server stores the target file, therefore, according to the storage path and the target directory, the target file can be conveniently transferred and stored in the target directory of the target server.

[0114] Please refer to Figure 8 , after step S205 of some embodiments, the file transfer method may include but is not limited to steps S801 to S803:

[0115] Step S801, obtain the current storage information of the target server; wherein, the current storage information includes file information and directory information currently stored in the target server;

[0116] Step S802, perform visualization processing on the current stored directory information according to a preset graphic template to obtain a storage display diagram;

[0117] Step S803, display the storage display diagram on the target platform.

[0118] In step S801 of some embodiments, obtain the current storage information of the target server through a preset script program, and the current storage information includes file information and directory information currently stored in the target server, wherein the file information includes file name, file size, and storage path of the file, etc.

[0119] In step S802 of some embodiments, the preset image template can be represented as a tree diagram, a flowchart, etc. Taking the tree diagram as an example, the current storage directory information can be visualized through the tree diagram, and the file information and directory information of the target server can be clearly displayed in the tree diagram. For example, the first level is the root directory, and the directory name and storage space size of the root directory are displayed in the tree diagram. The second level is the first-level directory, including directory A and directory B. At the same time, the directory names and storage space sizes of directory A and directory B are displayed in the tree diagram. The third level is the second-level directory, including sub-directories a1 and a2 under directory A, sub-directories b1 and b2 under directory B, and so on. By analogy, a complete storage display diagram is formed.

[0120] In step S803 of some embodiments, in order to enable business personnel to clearly monitor the file transfer situation and the storage situation of the target server, the storage display diagram can be directly displayed to the business personnel on the target platform. Among them, the target platform can be the central control platform used by business personnel to control the target server or other third-party platforms, or the storage display diagram can be displayed through a preset UI display interface, without limitation.

[0121] The file transfer method according to the embodiment of the present application reads target storage data from a preset task configuration table. The target storage data includes the storage space information and storage directory information of the target file. The storage space information includes the information about the space required to store the target file, and the storage directory information includes the directory information for storing the target file, so that it can clearly obtain the directory where each target file should be stored and the size of the space required to store the target file. Further, it reads the current space usage status of the target server. The current space usage status includes a first usage status or a second usage status. When the current space usage status is the first usage status, it cleans the current storage space until the current space usage status changes from the first usage status to the second usage status, which can conveniently optimize the storage space of the target server to make the storage space of the target server meet the transfer requirements. Finally, when the current space usage status is the second usage status, it obtains the process status of the target file. When the process status is the unoccupied status, it transfers the target file to the target server according to the storage directory information. In this way, it can determine whether the target file can be normally transferred according to the process status of the target file, and then transfer the unoccupied target file and store the target file in the target server. The embodiment of the present application can realize the automatic transfer of files. When the storage space of the target server is insufficient, it can clean the space of the target server in time to make the storage space of the target server meet the file transfer requirements. It can also detect the process status of the target file. When the target file is in the occupied state, it can release the target file from the target device according to the actual business situation to make the target file be normally transferred, which can effectively improve the file transfer efficiency and save labor costs and time costs.

[0122] Please refer to Figure 9 , the embodiment of the present application also provides a file transfer device that can implement the above file transfer method. The device includes:

[0123] A data reading module 901, configured to read target storage data from a preset task configuration table. The target storage data includes the storage space information and storage directory information of the target file. The storage space information includes the information about the space required to store the target file, and the storage directory information includes the directory information for storing the target file;

[0124] A status reading module 902, configured to read the current space usage status of the target server. The current space usage status includes a first usage status or a second usage status;

[0125] A space cleaning module 903, configured to clean the current storage space when the current space usage status is the first usage status until the current space usage status changes from the first usage status to the second usage status;

[0126] A status acquisition module 904, configured to acquire the process status of a target file when the current space usage status is the second usage status;

[0127] A transmission module 905, configured to transmit the target file to a target server according to storage directory information when the process status is the unoccupied status.

[0128] In some embodiments, the storage space information includes a target storage space, and the status reading module 902 includes:

[0129] A reading unit, configured to read the free storage space of the target server;

[0130] A first status determination unit, configured to set the current space usage status as the first usage status if the free storage space is less than or equal to the target storage space;

[0131] A second status determination unit, configured to set the current space usage status as the second usage status if the free storage space is greater than the target storage space.

[0132] In some embodiments, the space cleaning module 903 includes:

[0133] A stored data acquisition unit, configured to acquire the current stored data of the target server when the current space usage status is the first usage status, where the current stored data includes the current storage space of the target server for storing the original file;

[0134] A screening unit, configured to screen candidate files from the original files according to the target storage space and the current storage space;

[0135] A cleaning unit, configured to clean the candidate files and perform the step of reading the current space usage status of the target server until the current space usage status changes from the first usage status to the second usage status.

[0136] In some embodiments, the screening unit includes:

[0137] A difference calculation subunit, configured to perform a difference calculation on the target storage space and the free storage space to obtain a candidate storage space;

[0138] A comparison subunit, configured to compare the current storage space and the candidate storage space;

[0139] A screening subunit, configured to perform a screening process on the original files according to the comparison result to obtain candidate files.

[0140] In some embodiments, the file transmission device further includes:

[0141] An information acquisition unit, configured to acquire a target device and device information of the target device when the process status is an occupied status; wherein, the target device is the device that occupies the target file.

[0142] A first information parsing unit, configured to perform parsing processing on the device information to obtain target address data of the target device.

[0143] A file release unit, configured to control the target device to release the target file if the target address data is inconsistent with the reference address data.

[0144] In some embodiments, the transmission module 905 includes:

[0145] A second information parsing unit, configured to perform parsing processing on the stored directory information to obtain a storage path when the process status is an unoccupied status.

[0146] A transmission unit, configured to transmit the target file to a target directory of a target server according to the storage path; wherein, the storage path and the target directory are used to indicate that the target server stores the target file.

[0147] In some embodiments, the file transmission device further includes:

[0148] An acquisition unit, configured to acquire current storage information of the target server; wherein, the current storage information includes file information and directory information currently stored in the target server.

[0149] A visualization unit, configured to perform visualization processing on the current stored directory information according to a preset graphic template to obtain a storage display diagram.

[0150] A display unit, configured to display the storage display diagram on a target platform.

[0151] The specific implementation manner of this file transmission device is basically the same as the specific embodiments of the above file transmission method, and will not be elaborated here.

[0152] An embodiment of the present application further provides an electronic device, which includes: a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for implementing connection communication between the processor and the memory. When the program is executed by the processor, the above file transmission method is implemented. This electronic device can be any intelligent terminal including a tablet computer, an in-vehicle computer, etc.

[0153] Please refer to Figure 10 , Figure 10 which schematically shows the hardware structure of an electronic device in another embodiment. The electronic device includes:

[0154] The processor 1001 can be implemented in the form of a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0155] The memory 1002 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM), etc. The memory 1002 can store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 1002, and are called by the processor 1001 to execute the file transfer method of the embodiments of the present application;

[0156] The input / output interface 1003 is used to implement information input and output;

[0157] The communication interface 1004 is used to implement communication interaction between this device and other devices, and can implement communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.);

[0158] The bus 1005 transmits information between the various components of the device (such as the processor 1001, the memory 1002, the input / output interface 1003, and the communication interface 1004);

[0159] Among them, the processor 1001, the memory 1002, the input / output interface 1003, and the communication interface 1004 are communicatively connected to each other inside the device through the bus 1005.

[0160] The embodiments of the present application also provide a storage medium. The storage medium is a computer-readable storage medium for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the above file transfer method.

[0161] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely set relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0162] The file transfer method, file transfer device, electronic device, and storage medium provided by the embodiments of the present application read target storage data from a preset task configuration table. Among them, the target storage data includes the storage space information and storage directory information of the target file. The storage space information includes the information on the space required to store the target file, and the storage directory information includes the directory information for storing the target file. It can clearly obtain the directory where each target file should be stored and the size of the space required to store the target file. Further, the current space usage status of the target server is read; wherein, the current space usage status includes a first usage status or a second usage status; when the current space usage status is the first usage status, the current storage space is cleaned until the current space usage status changes from the first usage status to the second usage status, which can conveniently optimize the storage space of the target server so that the storage space of the target server meets the transfer requirements. Finally, when the current space usage status is the second usage status, the process status of the target file is obtained; when the process status is the unoccupied status, the target file is transmitted to the target server according to the storage directory information. In this way, it can be determined whether the target file can be normally transmitted based on the process status of the target file, so as to transmit the unoccupied target file and store the target file on the target server. The embodiments of the present application can realize the automated transfer of files. When the storage space of the target server is insufficient, the space of the target server is cleaned in time so that the storage space of the target server meets the file transfer requirements. It can also detect the process status of the target file. When the target file is in the occupied state, the target file is released from the target device according to the actual business situation so that the target file can be normally transmitted, which can effectively improve the file transfer efficiency and save labor costs and time costs.

[0163] The embodiments described in the embodiments of the present application are for more clearly explaining the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art know that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

[0164] Those skilled in the art can understand that Figure 2-8 the technical solutions shown in

[0165] do not constitute a limitation to the embodiments of the present application. It may include more or fewer steps than those shown in the figures, or combine certain steps, or different steps.

[0166] Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, and their appropriate combinations.

[0167] The terms "first", "second", "third", "fourth", etc. (if any) in the description of the present application and the above accompanying drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0168] It should be understood that in the present application, "at least one (item)" means one or more, and "a plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist at the same time. Among them, A and B can be singular or plural. The character " / " generally means that the associated objects before and after are in an "or" relationship. "At least one (one) of the following" or its similar expressions refer to any combination of these items, including any combination of single item (one) or plural items (ones). For example, at least one (one) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0169] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the above units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.

[0170] The units described above as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0171] In addition, in each embodiment of the present application, each functional unit can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0172] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in each embodiment of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store programs.

[0173] The preferred embodiments of the embodiments of the present application have been described above with reference to the drawings, but this does not limit the scope of the rights of the embodiments of the present application. Any modifications, equivalent replacements, and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of the rights of the embodiments of the present application.

Claims

1. A file transfer method, characterized in that, The method includes: Reading target storage data from a preset task configuration table, where the target storage data includes storage space information and storage directory information of a target file. The storage space information includes information on the space required to store the target file and the target storage space, and the storage directory information includes directory information for storing the target file and the target directory; Reading the current space usage status of the target server; where the current space usage status includes a first usage status or a second usage status; When the current space usage status is the first usage status, obtaining the current storage data of the target server, where the current storage data includes the current storage space of the target server for storing the original file; performing a subtraction operation on the target storage space and the free storage space of the target server to obtain a candidate storage space, determining the original file with a storage memory larger than the candidate storage space in the current storage space as the initial file, and determining the initial file with the smallest storage memory as the candidate file; clearing the candidate file, and performing the step of reading the current space usage status of the target server until the current space usage status changes from the first usage status to the second usage status; When the current space usage status is the second usage status, obtaining the process status of the target file; when the process status is the unoccupied status, transmitting the target file to the target server according to the storage directory information; After obtaining the process status of the target file when the current space usage status is the second usage status, the file transmission method further includes: When the process status is the occupied status, obtaining the target device that occupies the target file and the device information of the target device; performing parsing processing on the device information to obtain the target address data of the target device; if the target address data is inconsistent with the reference address data, controlling the target device to release the target file, and when the target device completely releases the target file, modifying the process status of the target file from the occupied status to the unoccupied status. If the target address data is consistent with the reference address data, allowing the target device to preferentially occupy and run the target file, and keeping the occupied status of the target file unchanged; The step of transmitting the target file to the target server according to the storage directory information when the process status is the unoccupied status includes: When the process status is the unoccupied status, performing parsing processing on the storage directory information to obtain a storage path; transmitting the target file to the target directory of the target server according to the storage path; where the storage path and the target directory are used to indicate that the target server stores the target file.

2. The file transfer method according to claim 1, wherein The step of reading the current space usage status of the target server includes: Reading the free storage space of the target server; If the free storage space is less than or equal to the target storage space, the current space usage status is the first usage status; If the free storage space is greater than the target storage space, the current space usage status is the second usage status.

3. The file transfer method according to any one of claims 1 to 2, characterized in that After the step of transmitting the target file to the target server when the process status is the unoccupied status, the method further includes: Obtaining the current storage information of the target server; wherein, the current storage information includes the file information and directory information currently stored on the target server; Performing visualization processing on the current storage directory information according to a preset graphic template to obtain a storage display diagram; Displaying the storage display diagram on a target platform.

4. A file transfer device, characterized in that, The device includes: A data reading module, configured to read target storage data from a preset task configuration table, wherein the target storage data includes the storage space information and storage directory information of a target file, the storage space information includes the information of the space required to store the target file and the target storage space, and the storage directory information includes the directory information for storing the target file and the target directory; A status reading module, configured to read the current space usage status of the target server; wherein, the current space usage status includes a first usage status or a second usage status; A space cleaning module, configured to, when the current space usage status is the first usage status, obtain the current storage data of the target server, the current storage data including the current storage space of the target server for storing the original file; performing a difference operation on the target storage space and the free storage space of the target server to obtain a candidate storage space, determining the original file with a storage memory greater than the candidate storage space in the current storage space as an initial file, and determining the initial file with the smallest storage memory as a candidate file; cleaning the candidate file, and performing the step of reading the current space usage status of the target server until the current space usage status changes from the first usage status to the second usage status; A status obtaining module, configured to obtain the process status of the target file when the current space usage status is the second usage status; A transmission module, configured to transmit the target file to the target server according to the storage directory information when the process status is the unoccupied status; After obtaining the process status of the target file when the current space usage status is the second usage status, the file transmission device further includes: When the process status is the occupied status, obtaining the target device that occupies the target file and the device information of the target device; performing parsing processing on the device information to obtain the target address data of the target device; if the target address data is inconsistent with the reference address data, controlling the target device to release the target file, and when the target device completely releases the target file, modifying the process status of the target file from the occupied status to the unoccupied status, and if the target address data is consistent with the reference address data, allowing the target device to preferentially occupy and run the target file, and keeping the occupied status of the target file unchanged; When the process status is the unoccupied state, transmitting the target file to the target server according to the storage directory information includes: When the process status is the unoccupied state, parsing the storage directory information to obtain a storage path; transmitting the target file to a target directory of the target server according to the storage path; wherein, the storage path and the target directory are used to indicate that the target server stores the target file.

5. An electronic device, characterized in that, The electronic device includes a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for realizing connection communication between the processor and the memory. When the program is executed by the processor, the steps of the file transmission method according to any one of claims 1 to 3 are implemented.

6. A storage medium, the storage medium being a computer-readable storage medium for computer-readable storage, characterized in that, The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the file transmission method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method and device for transmitting file

    CN106412001A

  • Data transmission method and device, application server and data transmission system

    CN111586187A