File processing method and device

文档序号:1952025 发布日期:2021-12-10 浏览:3次 中文

阅读说明:本技术 一种文件处理方法和装置 (File processing method and device ) 是由 石慧兴 刘岩 于 2021-01-28 设计创作,主要内容包括:本发明公开了一种文件处理方法和装置,涉及计算机技术领域。该方法的一具体实施方式包括:获取文件操作命令;解析所述文件操作命令,得到文件操作参数;根据所述文件操作参数,确定是否限制操作速度,如果是,确定限制速度;根据所述限制速度,对文件执行操作;其中,所述操作的类型,包括:复制、压缩和解压中任意一种或多种。该实施方式能够降低操作过程对其他服务的影响,避免其他服务发生崩溃。(The invention discloses a file processing method and device, and relates to the technical field of computers. One embodiment of the method comprises: acquiring a file operation command; analyzing the file operation command to obtain file operation parameters; determining whether to limit the operation speed according to the file operation parameters, and if so, determining to limit the speed; executing operation on the file according to the limiting speed; wherein the type of operation comprises: any one or more of replication, compression and decompression. The method and the device can reduce the influence of the operation process on other services and avoid the collapse of the other services.)

1. A file processing method, comprising:

acquiring a file operation command;

analyzing the file operation command to obtain file operation parameters;

determining whether to limit the operation speed according to the file operation parameters, and if so, determining to limit the speed;

executing operation on the file according to the limiting speed; wherein the type of operation comprises: any one or more of replication, compression and decompression.

2. The method of claim 1,

after the obtaining the file operation command, before analyzing the file operation command to obtain the file operation parameter, the method further includes:

and checking whether the grammar of the file operation command meets a preset rule, and if so, executing the analysis of the file operation command to obtain file operation parameters.

3. The method of claim 1,

the determining whether to limit the operating speed according to the file operating parameter includes:

and determining whether the speed limit state in the file operation parameters is open.

4. The method of claim 1,

the file operating parameters comprise: parameters of the original file, parameters of the target file and the type of the operation;

and executing operation on the file according to the limit speed, wherein the operation comprises the following steps:

generating a token according to the limiting speed;

adding the token to a token bucket;

reading a byte stream from the original file according to the parameters of the original file;

and writing the byte stream into the target file according to the number of tokens in the token bucket, the type of the operation and the parameters of the target file.

5. The method of claim 4,

writing the byte stream into the target file according to the number of tokens in the token bucket, the type of the operation and the parameters of the target file, including:

determining the number of tokens required for the byte stream;

when the number of tokens required by the byte stream is not more than the number of tokens in the token bucket, determining the writing speed according to the number of tokens required by the byte stream;

and writing the byte stream into the target file according to the writing speed, the type of the operation and the parameters of the target file.

6. The method of claim 4,

writing the byte stream into the target file according to the number of tokens in the token bucket, the type of the operation and the parameters of the target file, including:

determining the number of tokens required for the byte stream;

when the number of tokens required by the byte stream is larger than the number of tokens in the token bucket, splitting the byte stream into a first byte stream and a second byte stream;

determining a first writing speed according to the number of tokens in the token bucket;

writing the first byte stream into the target file according to the first writing speed, the type of the operation and the parameters of the target file;

adding the second byte stream to a preset queue;

when the number of tokens in the token bucket is not less than the number of tokens required by the second byte stream, determining a second writing speed according to the number of tokens required by the second byte stream;

writing a second byte stream in the queue into the target file according to the second writing speed, the type of the operation and the parameters of the target file;

wherein the number of tokens required for the first byte stream is equal to the number of tokens in the token bucket.

7. The method of claim 4,

writing the byte stream into the target file according to the number of tokens in the token bucket, the type of the operation and the parameters of the target file, including:

determining a writing speed according to the number of tokens in the token bucket;

and writing the byte stream into the target file according to the writing speed, a preset blocking pipeline, the type of the operation and the parameters of the target file.

8. A document processing apparatus, characterized by comprising:

the acquisition module is configured to acquire a file operation command;

the analysis module is configured to analyze the file operation command to obtain a file operation parameter;

the determining module is configured to determine whether to limit the operation speed according to the file operation parameters, and if so, determine to limit the speed;

the operation module is configured to execute operation on the file according to the limit speed; wherein the type of operation comprises: any one or more of replication, compression and decompression.

9. An electronic device, comprising:

one or more processors;

a storage device for storing one or more programs,

when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.

10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.

Technical Field

The invention relates to the technical field of computers, in particular to a file processing method and device.

Background

In an actual application scenario, a plurality of services running on a server may share one disk, and if one of the services is operated, other services sharing the disk may be affected.

For example, the service A, B, C shares a disk, and now compresses the data file of the service a, the compression process will use the maximum I/O (Input/Output) capability that the disk can provide. At this point, the service B, C will be unable to use the disk to perform I/O operations.

Therefore, the current file processing method may affect other services of the shared disk, and even cause other services to crash.

Disclosure of Invention

In view of this, embodiments of the present invention provide a file processing method and apparatus, which can reduce the influence of an operation process on other services and avoid the breakdown of the other services.

In a first aspect, an embodiment of the present invention provides a file processing method, including:

acquiring a file operation command;

analyzing the file operation command to obtain file operation parameters;

determining whether to limit the operation speed according to the file operation parameters, and if so, determining to limit the speed;

executing operation on the file according to the limiting speed; wherein the type of operation comprises: any one or more of replication, compression and decompression.

Alternatively,

after the obtaining the file operation command, before analyzing the file operation command to obtain the file operation parameter, the method further includes:

and checking whether the grammar of the file operation command meets a preset rule, and if so, executing the analysis of the file operation command to obtain file operation parameters.

Alternatively,

the determining whether to limit the operating speed according to the file operating parameter includes:

and determining whether the speed limit state in the file operation parameters is open.

Alternatively,

the file operating parameters comprise: parameters of the original file, parameters of the target file and the type of the operation;

and executing operation on the file according to the limit speed, wherein the operation comprises the following steps:

generating a token according to the limiting speed;

adding the token to a token bucket;

reading a byte stream from the original file according to the parameters of the original file;

and writing the byte stream into the target file according to the number of tokens in the token bucket, the type of the operation and the parameters of the target file.

Alternatively,

writing the byte stream into the target file according to the number of tokens in the token bucket, the type of the operation and the parameters of the target file, including:

determining the number of tokens required for the byte stream;

when the number of tokens required by the byte stream is not more than the number of tokens in the token bucket, determining the writing speed according to the number of tokens required by the byte stream;

and writing the byte stream into the target file according to the writing speed, the type of the operation and the parameters of the target file.

Alternatively,

writing the byte stream into the target file according to the number of tokens in the token bucket, the type of the operation and the parameters of the target file, including:

determining the number of tokens required for the byte stream;

when the number of tokens required by the byte stream is larger than the number of tokens in the token bucket, splitting the byte stream into a first byte stream and a second byte stream;

determining a first writing speed according to the number of tokens in the token bucket;

writing the first byte stream into the target file according to the first writing speed, the type of the operation and the parameters of the target file;

adding the second byte stream to a preset queue;

when the number of tokens in the token bucket is not less than the number of tokens required by the second byte stream, determining a second writing speed according to the number of tokens required by the second byte stream;

writing a second byte stream in the queue into the target file according to the second writing speed, the type of the operation and the parameters of the target file;

wherein the number of tokens required for the first byte stream is equal to the number of tokens in the token bucket.

Alternatively,

writing the byte stream into the target file according to the number of tokens in the token bucket, the type of the operation and the parameters of the target file, including:

determining a writing speed according to the number of tokens in the token bucket;

and writing the byte stream into the target file according to the writing speed, a preset blocking pipeline, the type of the operation and the parameters of the target file.

In a second aspect, an embodiment of the present invention provides a file processing apparatus, including:

the acquisition module is configured to acquire a file operation command;

the analysis module is configured to analyze the file operation command to obtain a file operation parameter;

the determining module is configured to determine whether to limit the operation speed according to the file operation parameters, and if so, determine to limit the speed;

the operation module is configured to execute operation on the file according to the limit speed; wherein the type of operation comprises: any one or more of replication, compression and decompression.

In a third aspect, an embodiment of the present invention provides an electronic device, including:

one or more processors;

a storage device for storing one or more programs,

when executed by the one or more processors, cause the one or more processors to implement a method as in any one of the embodiments described above.

In a fourth aspect, the present invention provides a computer readable medium, on which a computer program is stored, and when the program is executed by a processor, the computer program implements the method according to any one of the above embodiments.

One embodiment of the above invention has the following advantages or benefits: the speed of file operation is limited based on the file operation command, so that the file operation is prevented from occupying excessive disk I/O resources, the influence on other services is reduced, and the breakdown of other services is prevented.

Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.

Drawings

The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:

FIG. 1 is a flow diagram of a method of file processing according to an embodiment of the invention;

FIG. 2 is a flow chart of a method of document processing according to another embodiment of the invention;

FIG. 3 is a flowchart of a document processing apparatus according to an embodiment of the present invention;

FIG. 4 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;

fig. 5 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.

Detailed Description

Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.

During operations such as copying and compressing files, the existing tools do not limit the I/O speed of the disk. Under the condition that a plurality of services share one disk, if the data file of one service is operated, the operation writes the content into the disk at the maximum I/O speed, thereby influencing the operation of other services.

Based on this, as shown in fig. 1, an embodiment of the present invention provides a file processing method, including:

step 101: and acquiring a file operation command.

Step 102: and analyzing the file operation command to obtain file operation parameters.

The file operating parameters may include: any one or more of the type of operation, the speed limit state, the limit speed, the parameters of the original file and the parameters of the target file.

The original file refers to a file before operation, and the target file refers to a file obtained through operation. For example, the original file is compressed to obtain the target file.

Step 103: based on the file operating parameters, it is determined whether to limit the operating speed, if so, step 104 is performed, otherwise, step 106 is performed.

In an actual application scenario, the operation speed may be limited based on different rules, and specifically, it is determined whether to limit the operation speed based on the type of the operation, for example, limiting the speed of the copy operation; whether the operation speed is limited or not can be determined based on the speed limit state, if the speed limit state is open, the operation speed is limited, and if the speed limit state is closed, the operation speed is not limited, but the file is operated at the maximum operation speed.

Step 104: a limit speed is determined.

The limit speed may be a preset fixed value, for example, 50 bytes/s regardless of the operation. The limitation speed may also be included in the file operation parameter, i.e. the limitation speed resulting from different file operation commands may be different. It should be noted that limiting the operating speed means limiting the I/O speed of the disk, that is, limiting the speed of writing content to the disk.

Step 105: and according to the limiting speed, executing operation on the file and terminating the current flow.

Wherein the type of operation comprises: any one or more of replication, compression and decompression.

Step 106: and executing operation on the file according to the preset maximum operation speed.

Wherein the maximum operating speed refers to the maximum I/O speed of the disk.

The embodiment of the invention limits the file operation speed based on the file operation command, avoids the file operation from occupying excessive disk I/O resources, reduces the influence on other services, and prevents other services from being broken down.

In the prior art, different tools are required for copying, compressing and decompressing files in a server respectively, and the tools of different system platforms are different. For example, in the linux system, copying is performed based on a cp tool command, and compression and decompression are realized based on a tar tool command; in the windows system, copying is carried out based on a copy tool command, and compression and decompression are realized based on a rar tool command. Therefore, when different system platforms operate files, users need to know the use modes of different tools, confusion is easy to happen, and operation errors are caused.

In view of this, in a practical application scenario, the document processing method may be implemented by Golang language. The Golang language supports cross-platform compiling, file operation commands of different system platforms can be unified, and operation complexity among the different system platforms is reduced.

In this embodiment of the present invention, after obtaining the file operation command, before analyzing the file operation command to obtain the file operation parameter, the method further includes:

and checking whether the grammar of the file operation command meets a preset rule, and if so, executing and analyzing the file operation command to obtain file operation parameters.

Considering that the file operation command may not meet the rule, in order to filter the illegal command, the embodiment of the invention checks the grammar of the file operation command, reduces the consumption of the illegal command on system resources, and improves the system security.

In one embodiment of the present invention, determining whether to limit the operating speed based on the file operating parameter comprises:

and determining whether the speed limit state in the file operation parameters is open.

By the embodiment of the invention, a user can limit the speed of file operation through the file operation command according to actual requirements, flexibly adjust the file operation speed and coordinate the operation of each service.

In one embodiment of the invention, the file operation parameters comprise: parameters of an original file, parameters of a target file and types of operations;

performing operations on the file according to the limited speed, including:

generating a token according to the limiting speed;

adding the token to a token bucket;

reading a byte stream from an original file according to the parameters of the original file;

and writing the byte stream into the target file according to the number of tokens in the token bucket, the type of operation and the parameters of the target file.

The embodiment of the invention limits the file operation speed based on the token bucket algorithm and controls the occupation of the file operation on the disk I/O resources. In an actual application scenario, the token bucket algorithm may be replaced by a leaky bucket algorithm, and details of implementation of the leaky bucket algorithm are not described here.

In one embodiment of the present invention, writing a byte stream into a target file according to the number of tokens in a token bucket, the type of operation, and parameters of the target file includes:

determining the number of tokens required for the byte stream;

when the number of tokens required by the byte stream is not more than the number of tokens in the token bucket, determining the writing speed according to the number of tokens required by the byte stream;

the byte stream is written into the target file according to the writing speed, the type of operation, and the parameters of the target file.

In the embodiment of the present invention, one token corresponds to one byte, and if 20 bytes of data need to be written, 20 tokens need to be acquired. The method generates tokens based on a limiting speed, e.g., 50 bytes/s, and generates one token into the token bucket every 1/50 s. If the byte stream is 50 bytes and the token bucket contains 50 tokens, the byte stream can be written into the target file at 50 bytes/s. The embodiment of the invention can flexibly control the writing speed through the number of the tokens and reduce the influence of file operation on other services.

In one embodiment of the present invention, writing a byte stream into a target file according to the number of tokens in a token bucket, the type of operation, and parameters of the target file includes:

determining the number of tokens required for the byte stream;

when the number of tokens required by the byte stream is larger than that of tokens in the token bucket, splitting the byte stream into a first byte stream and a second byte stream;

determining a first writing speed according to the number of tokens in the token bucket;

writing the first byte stream into the target file according to the first writing speed, the type of operation and the parameters of the target file;

adding the second byte stream to a preset queue;

when the number of tokens in the token bucket is not less than the number of tokens required by the second byte stream, determining a second writing speed according to the number of tokens required by the second byte stream;

writing the second byte stream in the queue into the target file according to the second writing speed, the type of operation and the parameters of the target file;

wherein the number of tokens required for the first byte stream is equal to the number of tokens in the token bucket.

In the embodiment of the invention, if the number of tokens in the token bucket cannot realize one-time writing of the byte stream, the byte stream is split into the first byte stream and the second byte stream, the first byte stream is firstly written into a target file through the existing tokens in the token bucket, and the second byte stream is temporarily stored in a preset queue so as to wait for the number of tokens in the token bucket to meet the writing requirement of the second byte stream. The embodiment of the invention can improve the writing efficiency under the condition of meeting the speed limit.

In one embodiment of the present invention, writing a byte stream into a target file according to the number of tokens in a token bucket, the type of operation, and parameters of the target file includes:

determining the writing speed according to the number of tokens in the token bucket;

and writing the byte stream into the target file according to the writing speed, the preset blocking pipeline, the type of operation and the parameters of the target file.

The embodiment of the invention combines the blocking pipeline with the token bucket to further limit the file operation speed. Specifically, if the limit speed is 50 bytes/s and the capacity of the token bucket is 60 tokens, the byte stream may acquire all 60 tokens, and at this time, the writing speed of the byte stream may reach 60 bytes/s, exceeding the limit speed. In response to this situation, embodiments of the present invention use the blocking pipeline to further limit the operating speed to ensure that the write speed does not exceed the limit speed. For example, blocking the pipe allows a maximum speed of 50 bytes/s, even if the byte stream gets 60 tokens, it still needs to pass through the rate-limited pipe at 50 bytes/s. Thus, the speed of the speed-limiting pipe is determined by the limiting speed.

In an actual application scene, the speed-limiting pipeline can be used alone to limit the file operation speed, and the speed-limiting pipeline can be combined with a leaky bucket algorithm.

As shown in fig. 2, the embodiment of the present invention takes a copy operation as an example to describe in detail a file processing method, where the method includes:

step 201: and acquiring a file operation command.

The file operation command is as follows:

trans cp-originfile x-destfile y-limitspeed on 60B。

step 202: and checking whether the grammar of the file operation command meets a preset rule, if so, executing the step 203, and otherwise, terminating the current process.

Step 203: analyzing the file operation command to obtain file operation parameters;

the file operation parameters include: the type of operation: cp (i.e., replication); parameters of the original file: x; parameters of the target file: y; speed limiting: 60B/s.

Step 204: and determining whether the speed limit state in the file operation parameters is open, if so, executing step 205, otherwise, executing step 211.

Step 205: a limit speed is determined.

From the file operating parameters, a limit speed of 60B/s was determined.

Step 206: according to the limiting speed, generating the token.

A token is generated every 1/60 s.

Step 207: tokens are added to the token bucket.

The capacity of the token bucket is 70.

Step 208: and reading the byte stream from the original file according to the parameters of the original file.

The size of the byte stream is 65B.

Step 209: and determining the writing speed according to the number of tokens in the token bucket.

The number of tokens is 65, the writing speed is 65B/s.

Step 210: and writing the byte stream into the target file according to the writing speed, the preset blocking pipeline, the operation type and the parameters of the target file, and terminating the current process.

The embodiment of the invention adopts the blocking pipeline with the queue length of 60 bytes, and can limit the file copying speed to 60B/s. Thus, although the byte stream gets 65 tokens, the disk I/O speed can be controlled at 60B/s due to the presence of the blocking pipe.

Step 211: and executing operation on the file according to the preset maximum operation speed.

The embodiment of the invention combines the token bucket algorithm with the blocking pipeline, controls the file operation speed, can reduce the disk I/O overhead in the operation process, reduces the influence on other services, and improves the stability of the whole service on the server. By the method provided by the embodiment of the invention, the log files in the application service can be copied, compressed and the like.

As shown in fig. 3, an embodiment of the present invention provides a file processing apparatus, including:

an obtaining module 301 configured to obtain a file operation command;

the analysis module 302 is configured to analyze the file operation command to obtain a file operation parameter;

a determining module 303 configured to determine whether to limit the operating speed according to the file operating parameter, and if so, determine to limit the speed;

an operation module 304 configured to perform an operation on the file according to the limit speed; wherein the type of operation comprises: any one or more of replication, compression and decompression.

In an embodiment of the present invention, the parsing module 302 is configured to check whether a syntax of the file operation command satisfies a preset rule, and if so, execute parsing of the file operation command to obtain the file operation parameters.

In one embodiment of the invention, the determining module 303 is configured to determine whether the speed limit status in the file operation parameters is on.

In one embodiment of the invention, the file operation parameters comprise: parameters of an original file, parameters of a target file and types of operations; an operation module 304 configured to generate a token according to the limit speed; adding the token into a token bucket; reading a byte stream from an original file according to the parameters of the original file; and writing the byte stream into the target file according to the number of tokens in the token bucket, the type of operation and the parameters of the target file.

In one embodiment of the invention, the operation module 304 is configured to determine the number of tokens required for the byte stream; when the number of tokens required by the byte stream is not more than the number of tokens in the token bucket, determining the writing speed according to the number of tokens required by the byte stream; the byte stream is written into the target file according to the writing speed, the type of operation, and the parameters of the target file.

In one embodiment of the invention, the operation module 304 is configured to determine the number of tokens required for the byte stream; when the number of tokens required by the byte stream is larger than that of tokens in the token bucket, splitting the byte stream into a first byte stream and a second byte stream; determining a first writing speed according to the number of tokens in the token bucket; writing the first byte stream into the target file according to the first writing speed, the type of operation and the parameters of the target file; adding the second byte stream to a preset queue; when the number of tokens in the token bucket is not less than the number of tokens required by the second byte stream, determining a second writing speed according to the number of tokens required by the second byte stream; writing the second byte stream in the queue into the target file according to the second writing speed, the type of operation and the parameters of the target file; wherein the number of tokens required for the first byte stream is equal to the number of tokens in the token bucket.

In an embodiment of the present invention, the operation module 304 is configured to determine a writing speed according to the number of tokens in the token bucket; and writing the byte stream into the target file according to the writing speed, the preset blocking pipeline, the type of operation and the parameters of the target file.

An embodiment of the present invention provides an electronic device, including:

one or more processors;

a storage device for storing one or more programs,

when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method of any of the embodiments as described above.

Embodiments of the present invention provide a computer-readable medium, on which a computer program is stored, which when executed by a processor implements the method according to any of the above embodiments.

Fig. 4 shows an exemplary system architecture 400 of a file processing method or a file processing apparatus to which an embodiment of the present invention can be applied.

As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405. The network 404 serves as a medium for providing communication links between the terminal devices 401, 402, 403 and the server 405. Network 404 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.

A user may use terminal devices 401, 402, 403 to interact with a server 405 over a network 404 to receive or send messages or the like. The terminal devices 401, 402, 403 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).

The terminal devices 401, 402, 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.

The server 405 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 401, 402, 403. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.

It should be noted that the file processing method provided by the embodiment of the present invention is generally executed by the server 405, and accordingly, the file processing apparatus is generally disposed in the server 405.

It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.

Referring now to FIG. 5, shown is a block diagram of a computer system 500 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.

As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.

The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.

In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 501.

It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.

The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a sending module, an obtaining module, a determining module, and a first processing module. The names of these modules do not form a limitation on the modules themselves in some cases, and for example, the sending module may also be described as a "module sending a picture acquisition request to a connected server".

As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise:

acquiring a file operation command;

analyzing the file operation command to obtain file operation parameters;

determining whether to limit the operation speed according to the file operation parameters, and if so, determining to limit the speed;

executing operation on the file according to the limiting speed; wherein the type of operation comprises: any one or more of replication, compression and decompression.

According to the technical scheme of the embodiment of the invention, the speed of file operation is limited based on the file operation command, so that the file operation is prevented from occupying excessive disk I/O resources, the influence on other services is reduced, and the breakdown of other services is prevented.

The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:存储装置及其操作方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类