CN112491938A - JavaFX-custom-based object storage uploading and downloading method - Google Patents
JavaFX-custom-based object storage uploading and downloading method Download PDFInfo
- Publication number
- CN112491938A CN112491938A CN201910859414.2A CN201910859414A CN112491938A CN 112491938 A CN112491938 A CN 112491938A CN 201910859414 A CN201910859414 A CN 201910859414A CN 112491938 A CN112491938 A CN 112491938A
- Authority
- CN
- China
- Prior art keywords
- uploading
- task
- file
- downloading
- download
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5038—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/34—Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention provides an object storage uploading and downloading method based on JavaFX self-definition. The object storage uploading method comprises the following steps: step S1, selecting the uploaded file, and acquiring the path of the selected uploaded file; step S2, establishing an uploading task of uploading files; setting a task state of an uploaded file, and setting uploading progress monitoring of the uploaded task; and step S3, calling an uploading method in the function jar package, and adding the uploading task into the unified thread pool for execution. The JavaFX-custom-based object storage uploading and downloading method is novel in design and high in practicability.
Description
Technical Field
The invention relates to the technical field of uploading and downloading, in particular to a JavaFX-based custom object storage uploading and downloading method.
Background
JavaFX is a Java library used to build rich Internet applications. Applications written using the Java library may run consistently across multiple platforms. Applications developed using JavaFX may run on a variety of devices, such as desktop computers, cell phones, televisions, tablets, and the like. Before the advent of JavaFX, programmers were required to rely on libraries such as the Advanced Window Toolkit (AWT) and Swings in order to develop GUI applications using the Java programming language. After the advent of JavaFX, rich class libraries can be effectively utilized to develop GUI applications.
The object storage has the characteristics of high capacity, high safety, high reliability, low cost and the like, and is a cloud storage product used for storing unstructured data such as pictures, audios and videos, documents and the like. The method supports high concurrent access, has complete API and SDK interfaces, and can help user data to be quickly clouded.
Currently, the storage of the client operation object can only be used for uploading/downloading files through a console of a mobile cloud, and the client cannot pause in the uploading/downloading process or upload a plurality of files simultaneously. The problem cannot be solved by the conventional object storage client developed by adopting JavaFX at present, and particularly, the object storage client developed by calling JavaFXAPI cannot provide a good suspension method and state, cannot control UI (user interface) prompt display and subsequent operation, cannot uniformly manage an uploading/downloading thread pool, and meets the requirement of running specified task numbers at most simultaneously.
Disclosure of Invention
The invention provides an object storage uploading and downloading method based on JavaFX self-definition, aiming at the problems.
The technical scheme provided by the invention for the technical problem is as follows:
the invention provides an object storage uploading method, which comprises the following steps:
step S1, selecting the uploaded file, and acquiring the path of the selected uploaded file;
step S2, establishing an uploading task of uploading files; setting a task state of an uploaded file, and setting uploading progress monitoring of the uploaded task;
and step S3, calling an uploading method in the function jar package, and adding the uploading task into the unified thread pool for execution.
In the above method for uploading object storage of the present invention, the method further includes:
step S4, when a command of suspending the uploading task of the uploaded file is acquired, changing the task state of the uploaded file, and deleting the corresponding uploading progress monitoring;
and step S5, calling the function jar packet to suspend the uploading task of the uploaded file, and recording the object of the uploaded file for returning and continuing uploading after suspension.
In the above method for uploading object storage of the present invention, after step S4, the method for uploading object storage further includes: judging whether the task state of the uploaded file is a waiting state, if not, entering a step S5;
and if so, deleting the uploading task of the uploaded file in the unified thread pool.
In the above method for uploading and storing an object, the method for uploading and storing an object further includes:
step S6, when a command of continuing uploading the uploaded file is acquired, changing the task state of the uploaded file; newly building an uploading task of the uploading file, and setting uploading progress monitoring of the uploading task;
and step S7, calling a method for continuing uploading in the function jar packet, transmitting an object of the uploaded file for returning and continuing uploading after suspension, and then adding the uploading task of the uploaded file into the unified thread pool for execution.
The invention also provides an object storage downloading method, which comprises the following steps:
step S1, selecting the download file and obtaining the path of the selected download file;
step S2, establishing a downloading task of the downloaded file; setting a task state of a download file, and setting download progress monitoring of the download task;
and step S3, calling a downloading method in the function jar package, and adding the downloading task into the unified thread pool for execution.
The object storage downloading method of the present invention further includes:
step S4, when acquiring the command of suspending the download task of the download file, changing the task state of the download file, and deleting the corresponding download progress monitoring;
and step S5, calling the function jar package to suspend the downloading task of the downloaded file, and recording the objects of the downloaded file for returning and continuing downloading after suspension.
In the foregoing object storage downloading method of the present invention, after step S4, the object storage downloading method further includes: judging whether the task state of the downloaded file is a waiting state, if not, entering the step S5;
and if so, deleting the downloading task of the downloading file in the unified thread pool.
In the foregoing object storage downloading method of the present invention, the object storage downloading method further includes:
step S6, when a command of continuing downloading the downloaded file is obtained, changing the task state of the downloaded file; newly building a download task of the download file, and setting download progress monitoring of the download task;
and step S7, calling a method for continuing downloading in the function jar package, introducing an object of the downloaded file for returning and continuing downloading after suspension, and then adding the downloading task of the downloaded file into the unified thread pool for execution.
In summary, the invention realizes the task suspension function and manages the number of tasks running simultaneously by the JavaFX-based customized uploading/downloading method, and on this basis, the object storage client is realized by the JavaFX, which brings better use experience to the client, so that the object storage product can be better popularized. The JavaFX-custom-based object storage uploading and downloading method is novel in design and high in practicability.
Drawings
FIG. 1 is a flow chart showing the preferred embodiment of the JavaFX custom-based object store uploading method.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
As shown in fig. 1, fig. 1 is a flowchart illustrating a preferred embodiment of the object repository uploading method based on javascript fx customization, specifically, the object repository uploading method includes the following steps:
step S1, selecting the uploaded file, and acquiring the path of the selected uploaded file;
step S2, establishing an uploading task of uploading files; setting a task state of an uploaded file, and setting uploading progress monitoring of the uploaded task; here, the task state is the state of JavaFX custom under different operations.
And step S3, calling an uploading method in the function jar package, and adding the uploading task into the unified thread pool for execution.
In the prior art, a thread pool is widely applied in the field of internet, and by introducing the thread pool, threads can be effectively managed, the upper limit total number of the threads can be effectively controlled, and expenses caused by creating and destroying the threads can be reduced. In the basic scheme, the number of tasks which can run simultaneously is managed by compiling logic codes of the uploading files, manually setting a unified thread pool to add the uploading tasks into the thread pool to run in a background, and when the threads are full, enabling the rest of the tasks to enter a blocking queue. And setting the current state and the prompt information of the task after deserialization by self-defining the state and the prompt information and exposing the set to the outside. Therefore, the invention adopts the unified thread pool and carries out unified management on the uploading task through the thread pool queue of the unified thread pool, thereby reducing the resource consumption of the system and improving the stability of the system. Meanwhile, the requirement that the specified task number is operated at most at the same time can be met.
Further, the object storage uploading method further comprises the following steps:
step S4, when a command of suspending the uploading task of the uploaded file is acquired, changing the task state of the uploaded file, and deleting the corresponding uploading progress monitoring;
and step S5, calling the function jar packet to suspend the uploading task of the uploaded file, and recording the object of the uploaded file for returning and continuing uploading after suspension.
After step S4, the method for uploading object storage further includes: judging whether the task state of the uploaded file is a waiting state, if not, entering a step S5;
and if so, deleting the uploading task of the uploaded file in the unified thread pool.
Here, when a command to suspend the uploading task of the upload file is acquired, the task state of the upload file may be a suspended state or a waiting state. If the state is the suspended state, the process proceeds to step S5. If the file is in the waiting state, the uploading task of the uploaded file is deleted in the blocking queue in the unified thread pool, and then the task of the suspension method in the object storage jar packet in the suspension state is called to realize the suspension function in the uploading, so that the suspension is really realized, and the uploading task is re-created when the task is continued next time.
Specifically, the object storage uploading method further comprises the following steps:
step S6, when a command of continuing uploading the uploaded file is acquired, changing the task state of the uploaded file; newly building an uploading task of the uploading file, and setting uploading progress monitoring of the uploading task;
and step S7, calling a method for continuing uploading in the function jar packet, transmitting an object of the uploaded file for returning and continuing uploading after suspension, and then adding the uploading task of the uploaded file into the unified thread pool for execution.
Correspondingly, the preferred embodiment of the present invention further provides an object storage downloading method, which comprises the following steps:
step S1, selecting the download file and obtaining the path of the selected download file;
step S2, establishing a downloading task of the downloaded file; setting a task state of a download file, and setting download progress monitoring of the download task; here, the task state is the state of JavaFX custom under different operations.
And step S3, calling a downloading method in the function jar package, and adding the downloading task into the unified thread pool for execution.
In the prior art, a thread pool is widely applied in the field of internet, and by introducing the thread pool, threads can be effectively managed, the upper limit total number of the threads can be effectively controlled, and expenses caused by creating and destroying the threads can be reduced. In the basic scheme, the logic codes of the download files are compiled, the download tasks are added into the thread pool to run in a background mode through manually setting the uniform thread pool, and when the threads are full, the rest tasks enter the blocking queue, so that the task number capable of running simultaneously is managed. And setting the current state and the prompt information of the task after deserialization by self-defining the state and the prompt information and exposing the set to the outside. Therefore, the invention adopts the uniform thread pool and uniformly manages the downloading task through the thread pool queue of the uniform thread pool, thereby reducing the resource consumption of the system and improving the stability of the system. Meanwhile, the requirement that the specified task number is operated at most at the same time can be met.
Further, the object storage downloading method further comprises the following steps:
step S4, when acquiring the command of suspending the download task of the download file, changing the task state of the download file, and deleting the corresponding download progress monitoring;
and step S5, calling the function jar package to suspend the downloading task of the downloaded file, and recording the objects of the downloaded file for returning and continuing downloading after suspension.
After step S4, the object storage downloading method further includes: judging whether the task state of the downloaded file is a waiting state, if not, entering the step S5;
and if so, deleting the downloading task of the downloading file in the unified thread pool.
Here, when a command to suspend the download job of the download file is acquired, the job status of the download file may be a suspended status or a waiting status. If the state is the suspended state, the process proceeds to step S5. If the state is a waiting state, the downloading task of the downloaded file is deleted in the blocking queue in the unified thread pool, and then the task of the suspension state in the object storage jar packet is called to suspend the suspension method, so that the suspension function in the downloading is realized, the suspension is really realized, and the downloading task is re-created when the task is continued next time.
Specifically, the object storage downloading method further includes:
step S6, when a command of continuing downloading the downloaded file is obtained, changing the task state of the downloaded file; newly building a download task of the download file, and setting download progress monitoring of the download task;
and step S7, calling a method for continuing downloading in the function jar package, introducing an object of the downloaded file for returning and continuing downloading after suspension, and then adding the downloading task of the downloaded file into the unified thread pool for execution.
In summary, the invention realizes the task suspension function and manages the number of tasks running simultaneously by the JavaFX-based customized uploading/downloading method, and on this basis, the object storage client is realized by the JavaFX, which brings better use experience to the client, so that the object storage product can be better popularized. The JavaFX-custom-based object storage uploading and downloading method is novel in design and high in practicability.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (8)
1. An object storage uploading method, comprising the steps of:
step S1, selecting the uploaded file, and acquiring the path of the selected uploaded file;
step S2, establishing an uploading task of uploading files; setting a task state of an uploaded file, and setting uploading progress monitoring of the uploaded task;
and step S3, calling an uploading method in the function jar package, and adding the uploading task into the unified thread pool for execution.
2. The object storage uploading method of claim 1, further comprising:
step S4, when a command of suspending the uploading task of the uploaded file is acquired, changing the task state of the uploaded file, and deleting the corresponding uploading progress monitoring;
and step S5, calling the function jar packet to suspend the uploading task of the uploaded file, and recording the object of the uploaded file for returning and continuing uploading after suspension.
3. The object storage uploading method according to claim 2, wherein after step S4, the object storage uploading method further comprises: judging whether the task state of the uploaded file is a waiting state, if not, entering a step S5;
and if so, deleting the uploading task of the uploaded file in the unified thread pool.
4. The object storage uploading method of claim 3, further comprising:
step S6, when a command of continuing uploading the uploaded file is acquired, changing the task state of the uploaded file; newly building an uploading task of the uploading file, and setting uploading progress monitoring of the uploading task;
and step S7, calling a method for continuing uploading in the function jar packet, transmitting an object of the uploaded file for returning and continuing uploading after suspension, and then adding the uploading task of the uploaded file into the unified thread pool for execution.
5. An object storage downloading method, characterized by comprising the steps of:
step S1, selecting the download file and obtaining the path of the selected download file;
step S2, establishing a downloading task of the downloaded file; setting a task state of a download file, and setting download progress monitoring of the download task;
and step S3, calling a downloading method in the function jar package, and adding the downloading task into the unified thread pool for execution.
6. The object store downloading method of claim 5, further comprising:
step S4, when acquiring the command of suspending the download task of the download file, changing the task state of the download file, and deleting the corresponding download progress monitoring;
and step S5, calling the function jar package to suspend the downloading task of the downloaded file, and recording the objects of the downloaded file for returning and continuing downloading after suspension.
7. The object store downloading method of claim 6, wherein after step S4, the object store downloading method further comprises: judging whether the task state of the downloaded file is a waiting state, if not, entering the step S5;
and if so, deleting the downloading task of the downloading file in the unified thread pool.
8. The object store downloading method of claim 7, wherein the object store downloading method further comprises:
step S6, when a command of continuing downloading the downloaded file is obtained, changing the task state of the downloaded file; newly building a download task of the download file, and setting download progress monitoring of the download task;
and step S7, calling a method for continuing downloading in the function jar package, introducing an object of the downloaded file for returning and continuing downloading after suspension, and then adding the downloading task of the downloaded file into the unified thread pool for execution.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910859414.2A CN112491938B (en) | 2019-09-11 | 2019-09-11 | JavaFX-custom-based object storage uploading and downloading method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910859414.2A CN112491938B (en) | 2019-09-11 | 2019-09-11 | JavaFX-custom-based object storage uploading and downloading method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112491938A true CN112491938A (en) | 2021-03-12 |
CN112491938B CN112491938B (en) | 2023-04-07 |
Family
ID=74920109
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910859414.2A Active CN112491938B (en) | 2019-09-11 | 2019-09-11 | JavaFX-custom-based object storage uploading and downloading method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112491938B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102567097A (en) * | 2011-12-29 | 2012-07-11 | Tcl王牌电器(惠州)有限公司 | Method and terminal for downloading multiple tasks |
US8677083B1 (en) * | 2010-09-21 | 2014-03-18 | Amazon Technologies, Inc. | System and method for toggling a storage system versioning feature |
CN106055253A (en) * | 2016-05-30 | 2016-10-26 | 乐视控股(北京)有限公司 | Virtual key triggering method and mobile terminal employing same |
CN108566417A (en) * | 2018-03-22 | 2018-09-21 | 四川长虹电器股份有限公司 | A kind of multithread breakpoint continued transmission download system based on android system and method |
CN108965407A (en) * | 2018-07-02 | 2018-12-07 | 广东飞企互联科技股份有限公司 | A kind of processing implementation method of mobile Internet file download |
CN109413138A (en) * | 2018-09-03 | 2019-03-01 | 视联动力信息技术股份有限公司 | File uploading method and device |
-
2019
- 2019-09-11 CN CN201910859414.2A patent/CN112491938B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8677083B1 (en) * | 2010-09-21 | 2014-03-18 | Amazon Technologies, Inc. | System and method for toggling a storage system versioning feature |
CN102567097A (en) * | 2011-12-29 | 2012-07-11 | Tcl王牌电器(惠州)有限公司 | Method and terminal for downloading multiple tasks |
CN106055253A (en) * | 2016-05-30 | 2016-10-26 | 乐视控股(北京)有限公司 | Virtual key triggering method and mobile terminal employing same |
CN108566417A (en) * | 2018-03-22 | 2018-09-21 | 四川长虹电器股份有限公司 | A kind of multithread breakpoint continued transmission download system based on android system and method |
CN108965407A (en) * | 2018-07-02 | 2018-12-07 | 广东飞企互联科技股份有限公司 | A kind of processing implementation method of mobile Internet file download |
CN109413138A (en) * | 2018-09-03 | 2019-03-01 | 视联动力信息技术股份有限公司 | File uploading method and device |
Also Published As
Publication number | Publication date |
---|---|
CN112491938B (en) | 2023-04-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10467025B2 (en) | Managing delivery of code and dependent data using application containers | |
US9501319B2 (en) | Method and apparatus for scheduling blocking tasks | |
US10901593B2 (en) | Configuring components in a display template based on a user interface type | |
US9614931B2 (en) | Identifying a resource set require for a requested application and launching the resource set in a container for execution in a host operating system | |
US8918776B2 (en) | Self-adapting software system | |
CN111475142B (en) | Method, device and equipment for generating applet file package | |
CN110989487B (en) | PLC initialization method and device for industrial server and readable storage medium | |
CN101778169A (en) | Dynamic display method of application program interface and device | |
EP2951678B1 (en) | Remotely executing operations of an application using a schema that provides for executable scripts in a nodal hierarchy | |
US10684895B1 (en) | Systems and methods for managing containerized applications in a flexible appliance platform | |
CN112491938B (en) | JavaFX-custom-based object storage uploading and downloading method | |
CN109639827A (en) | Client side upgrading method and device | |
WO2020135129A1 (en) | Method and device for loading plug-in of application, and terminal | |
CN112235132A (en) | Method, device, medium and server for dynamically configuring service | |
CA2878759C (en) | Methods and systems for providing software applications | |
CN112905225A (en) | Method and device for creating continuous integration tool construction task | |
CN113688343B (en) | Page authority control method, device, equipment and readable storage medium | |
WO2017084358A1 (en) | Camera parameter read-write method and apparatus, and terminal device | |
US10482007B2 (en) | Memory allocation on non-volatile storage | |
CN104866329A (en) | Starting method and electronic equipment | |
KR101553539B1 (en) | Dynamic link providing method and computer readable storage medium for program therefor | |
CN114416381B (en) | Processing resource over-partitioning method, device, equipment and storage medium | |
US20210218689A1 (en) | Decentralized approach to automatic resource allocation in cloud computing environment | |
CN113805858A (en) | Method and device for continuously deploying software developed by scripting language | |
JP6135193B2 (en) | Program execution device, program execution method, and program execution program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |