CN109831358B - Client flow statistical method and device, server and readable storage medium - Google Patents

Client flow statistical method and device, server and readable storage medium Download PDF

Info

Publication number
CN109831358B
CN109831358B CN201910098144.8A CN201910098144A CN109831358B CN 109831358 B CN109831358 B CN 109831358B CN 201910098144 A CN201910098144 A CN 201910098144A CN 109831358 B CN109831358 B CN 109831358B
Authority
CN
China
Prior art keywords
client
user name
file system
mounting
directory
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.)
Active
Application number
CN201910098144.8A
Other languages
Chinese (zh)
Other versions
CN109831358A (en
Inventor
陈二奇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN201910098144.8A priority Critical patent/CN109831358B/en
Publication of CN109831358A publication Critical patent/CN109831358A/en
Application granted granted Critical
Publication of CN109831358B publication Critical patent/CN109831358B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The application relates to a client flow statistical method, a client flow statistical device, a server and a readable storage medium. The method comprises the following steps: determining a client mounted with a network file system; acquiring a user name used by a client for mounting a network file system; the user name used by the client is consistent with the mounting directory of the network file system mounted by the client; and counting the flow of the client according to the variable quantity of the file size under the mounting directory. Therefore, the mounting directory of the network file system mounted by the client can be determined according to the user name used by the network file system mounted by the client, and the flow of the client can be counted according to the mounting directory.

Description

Client flow statistical method and device, server and readable storage medium
Technical Field
The present application relates to the field of file system technologies, and in particular, to a client traffic statistical method, an apparatus, a server, and a readable storage medium.
Background
Currently, data can be stored and managed through a network file system. For example, the data may be stored and managed by a network file system CephFS. The client can mount the CephFS through the network, and then can access files under the mounted CephFS directory through the network.
The inventor finds that, in the process of implementing the present application, because the ability of the CephFS to process data is limited, when some clients write a large number of files, the pressure of the CephFS to process data becomes large, so that the data writing speed of other clients becomes slow, and even the writing service of other clients cannot be performed. However, when the pressure of the CephFS processing data is increased, the traffic of the client cannot be counted at present, and thus it is impossible to know which clients the pressure of the CephFS processing data is caused by.
Disclosure of Invention
In order to overcome the problems in the related art, the application provides a client traffic statistical method, a client traffic statistical device, a server and a readable storage medium.
According to a first aspect of the embodiments of the present application, there is provided a client traffic statistical method, applied to a server, including:
determining a client mounted with a network file system;
acquiring a user name used by a client for mounting a network file system; the user name used by the client is consistent with the mounting directory of the network file system mounted by the client;
and counting the flow of the client according to the variable quantity of the file size under the mounting directory.
Optionally, before the step of determining that the client of the network file system is mounted, the method may further include:
generating a mounting catalog carrying mounting keywords according to a registration request sent by a user; the registration request carries user-defined mounting keywords;
sending the user name of the mounting directory to a user so that the user inputs the user name to a client and the client mounts the network file system through the user name;
and when the client is detected to mount the network file system, storing the user name into a mounting user list.
Optionally, the step of sending the user name as the mount directory to the user, so that the user inputs the user name into the client, and the client mounts the network file system by using the user name may include:
and sending the user name and the key corresponding to the user name which are used as the mounting catalog to the user, so that the user inputs the user name and the key to the client, and the client mounts the network file system through the user name and the key.
Optionally, the step of counting traffic of the client according to a variable of a file size in the mount directory may include:
calculating the variable quantity of the file size of the files in the mounting catalog in a preset time period;
and calculating the average flow of the client in the preset time period according to the variable quantity and the duration of the preset time period.
Optionally, the step of counting traffic of the client according to a variable of a file size in the mount directory may include:
determining a user name with preset keywords in the obtained user names as a target user name;
and calculating the flow of the client corresponding to the target user name according to the variable quantity of the file size under the mounting directory corresponding to the target user name.
Optionally, after the step of obtaining the user name used by the client to mount the network file system, the method may further include:
counting the size of the storage space occupied by the files under the mount directory;
counting the number of files in the mount directory;
and determining a write speed analysis result of the client according to the size of the storage space, the number of files and a preset write speed analysis table.
Optionally, after the step of counting the traffic of the client according to the variable quantity of the file size in the mount directory, the method may further include:
generating a flow display diagram corresponding to the flow of the client;
and sending the flow display diagram to the flow display equipment so that the flow display equipment displays the flow display diagram.
According to a second aspect of the embodiments of the present application, there is provided a client traffic statistic apparatus, applied to a server, including:
a first determination module configured to determine a client mounted with a network file system;
the obtaining module is configured to obtain a user name used by the client to mount the network file system; the user name used by the client is consistent with the mounting directory of the network file system mounted by the client;
and the first statistical module is configured to count the flow of the client according to the variable quantity of the file size under the mounting directory.
Optionally, in this embodiment of the present application, the method may further include:
the generating unit is configured to generate a mounting directory carrying mounting keywords according to a registration request sent by a user before determining that a client of the network file system is mounted; the registration request carries user-defined mounting keywords;
the sending unit is configured to send the user name of the mounting directory to the user, so that the user inputs the user name to the client, and the client mounts the network file system through the user name;
the storage unit is configured to store the user name into the mount user list when the fact that the network file system is mounted on the client side is detected.
Optionally, in an embodiment of the present application, the sending unit is configured to:
and sending the user name and the key corresponding to the user name which are used as the mounting catalog to the user, so that the user inputs the user name and the key to the client, and the client mounts the network file system through the user name and the key.
Optionally, in this embodiment of the present application, the first statistical module may include:
a first calculation unit configured to calculate a variation amount of a file size of a file under a mount directory within a preset time period;
and the second calculation unit is configured to calculate the average flow of the client within the preset time period according to the variation and the duration of the preset time period.
Optionally, in this embodiment of the present application, the first statistical module may include:
a determining unit configured to determine a user name having a preset keyword among the obtained user names as a target user name;
and the third calculating unit is configured to calculate the flow of the client corresponding to the target user name according to the variable quantity of the file size under the mount directory corresponding to the target user name.
Optionally, in this embodiment of the present application, the method may further include:
the second counting module is configured to count the size of the storage space occupied by the files in the mount directory after the user name used by the network file system mounted by the client is obtained;
the third statistical module is configured to count the number of files in the mount directory;
and the second determining module is configured to determine the writing speed analysis result of the client according to the size of the storage space, the number of files and a preset writing speed analysis table.
Optionally, in this embodiment of the present application, the method may further include:
the generating module is configured to generate a flow display diagram corresponding to the flow of the client after counting the flow of the client according to the variable quantity of the file size in the mount directory;
the sending module is configured to send the traffic display map to the traffic display device so that the traffic display device displays the traffic display map.
According to a third aspect of embodiments of the present application, there is provided a server, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the method steps of any of the above-described client traffic statistics methods of the first aspect.
According to a fourth aspect of embodiments of the present application, there is provided a readable storage medium, wherein instructions that, when executed by a processor of a server, enable the server to perform the method steps of the client traffic statistical method according to any one of the first aspect. Wherein the readable storage medium is a computer readable storage medium.
According to a fifth aspect of embodiments herein, there is provided a computer program product which, when run on a server, causes the server to perform: method steps of the client traffic statistics method of any of the above first aspects.
In an embodiment of the present application, a server may determine that a client of a network file system is mounted. The username with which the client mounts the network file system can then be obtained. The user name used by the client for mounting the file system is consistent with the mounting directory, so that the server can determine the mounting directory for mounting the network file by the client. Then, the server may count the traffic of the client according to the amount of change in the size of the file in the mount directory. In this way, the server can count the traffic of the client, and further can determine which clients the network file system is stressed to process data according to the obtained traffic.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 is a flow chart illustrating a method for client traffic statistics in accordance with an exemplary embodiment.
FIG. 2 is a schematic diagram illustrating a client mount network file system in accordance with an exemplary embodiment.
Fig. 3 is a block diagram illustrating a client traffic statistics apparatus in accordance with an example embodiment.
FIG. 4 is a block diagram illustrating a server in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
In order to solve technical problems in the prior art, embodiments of the present application provide a client traffic statistical method, an apparatus, a server, and a readable storage medium.
First, a client traffic statistical method provided in an embodiment of the present application is described below.
The client flow statistical method provided by the embodiment of the application can be applied to a server. The server may be a central control server in a network file system, or may also be a server designated in advance for performing client traffic statistics, which is not limited to this.
It will be appreciated that a network file system may perform storage management on data. The network file system includes, but is not limited to, a CephFS.
The client traffic statistical method provided by the embodiment of the present application is described below with reference to fig. 1 and fig. 2. Fig. 1 is a flow chart illustrating a client traffic statistical method according to an exemplary embodiment. FIG. 2 is a schematic diagram illustrating a client mount network file system in accordance with an exemplary embodiment.
As shown in fig. 1, the client traffic statistical method may include the following steps:
s101: determining a client mounted with a network file system;
it is understood that the client may mount the network file system over a network, the network file system being configured in a network storage device. Moreover, the client can access the mounted files in the network file system directory through the network, that is, the client can access the files in the mounting directory corresponding to the client through the network.
Mount refers to mounting a storage device to an existing directory. In order to access a file in the storage device, the partition in which the file is located needs to be mounted on an existing directory, and then the storage device is accessed by accessing the directory.
As shown in fig. 2, the client a may access a file under the mounted network file system CephFS directory a through a TCP (Transmission Control Protocol) network, that is, may access a file under the mounted directory a corresponding to the client a through the TCP network. The network file system CephFS is configured in a Ceph distributed storage system, wherein the Ceph distributed storage system may also be referred to as a Ceph cluster.
In addition, as shown in fig. 2, the client B may access the mounted file under the CephFS directory B of the network file system through the TCP network; the client C can access the mounted files under the network file system CephFS directory C through the TCP network.
In the embodiment of the application, before determining that the client of the network file system is mounted, the server may further generate a mounting directory carrying the mounting keyword according to a registration request sent by a user. The registration request carries user-defined mounting keywords.
The user-defined mount keyword may include: the key related to the service requirement, such as the fact that the user needs to store music files using the mounted network file system, may be a music. Of course, the user-defined mount keyword may further include: keywords for identifying the user, such as the user name zhangsan, etc., are, of course, not limited thereto.
After generating the mount directory from the registration request, the server may use the mount directory as a username for the client to mount the network file system. The username can then be sent to the user. In this way, after the user inputs the user name into the client, the client can use the user name to pass the authentication of the network file system, so that the client can mount the network file system. The clients of the network file system are mounted through the same user name, and are considered to be the same client.
Of course, for improved security, the server may also send the user name and the user name corresponding key to the user. In this way, after the user inputs the user name and the key to the client, the client can pass authentication of the network file system by using the user name and the key, so that the client can mount the network file system. Wherein, the clients of the network file system are mounted by the same user name and key and are considered as the same client. This is also reasonable.
When the server detects that the client mounts the network file system, the server can store the user name in a mounting user list. In this way, the user name used by the client mounting the network file system is recorded in the mounting user list. In this way, the server can determine that the client of the network file system is mounted through the mounting user list.
S102: acquiring a user name used by a client for mounting a network file system; the user name used by the client is consistent with the mounting directory of the network file system mounted by the client;
after determining that the client of the network file system is mounted, the server may obtain a username used by the client to mount the network file system. The user name used by the client is consistent with the mount directory on which the network file system is mounted by the client, so that the server can obtain the mount directory of the network file system mounted by the client.
In the related art, the user name used by the network file system mounted by the client is a mail address, a mobile phone number and the like provided by the user, and the user name is not associated with the mounting directory. Moreover, in the related art, it can only be determined which clients mount the network file system, but it cannot be determined which directories of the network file system are mounted by the clients mounting the network file system. Therefore, in the related art, the traffic of the clients cannot be counted, and further, the clients to which the CephFS process data are stressed cannot be known.
S103: and counting the flow of the client according to the variable quantity of the file size under the mounting directory.
After determining the user name used by the client to mount the network file system, the mounting directory of the network file system can be determined to be mounted by the client. Furthermore, the traffic of the client can be counted according to the variable quantity of the file size in the mount directory.
It is understood that after the client traffic is obtained statistically, it can be determined from the client traffic which clients the network file system is stressed to process data. For example, when the traffic of a client exceeds a preset traffic threshold, it may be determined that the client causes a large data processing pressure on the network file system.
The method for counting the traffic of the client may be as follows: and calculating the variable quantity of the file size of the file in the mount directory of the client in a preset time period. And then, calculating the average flow of the client in the preset time period according to the variable quantity and the duration of the preset time period. In this way, the average flow of the client in the preset time period can be calculated.
The preset time period may be set by a person skilled in the art according to an actual situation, for example, the preset time period may be set to a time period corresponding to 20:00 to 22:00 of each day, but is not limited thereto.
Of course, the amount of change in the file size in the mount directory may be counted once per minute, that is, the counting interval is 1 minute. Then, it is also reasonable to calculate the average flow rate for one minute from the amount of change. For example, a file under a mount directory of a client is increased by 900MB of data in one minute, and then the average traffic of the client in this minute is 15 MB/s.
In addition, the method for counting the traffic of the client may be as follows: and determining the user name with the preset keyword in the obtained user names as a target user name. The preset keyword may also be referred to as a sampling tag. For example, three user names of the obtained user names carry a preset keyword "music", and then the three user names may be used as target user names. Then, the flow of the client corresponding to the target user name can be calculated according to the variable quantity of the file size under the mount directory corresponding to the target user name. Therefore, the flow of the client corresponding to the target user name in the client can be counted.
It is understood that one skilled in the art can set the statistical intervals and sampling tags by configuration files. For example, the sampling label "video" may be added, and the statistical interval may be modified to 1 hour, which is reasonable.
In an embodiment of the present application, a server may determine that a client of a network file system is mounted. The username with which the client mounts the network file system can then be obtained. The user name used by the client for mounting the file system is consistent with the mounting directory, so that the server can determine the mounting directory for mounting the network file by the client. Then, the server may count the traffic of the client according to the amount of change in the size of the file in the mount directory. In this way, the server can count the traffic of the client, and further can determine which clients the network file system is stressed to process data according to the obtained traffic.
In addition, after the server obtains the user name used by the client for mounting the network file system, the size of the storage space occupied by the files in the mounting directory can be counted. And, the number of files under the mount directory can be counted. Then, the write speed analysis result of the client can be determined according to the size of the storage space, the number of files and a preset write speed analysis table.
Wherein, the preset writing speed analysis table may record: and mounting the mapping relation among the size of the storage space occupied by the files in the directory, the number of the files and the writing speed analysis result. For example, when the storage space occupied by the target file is 1G and the number of files is 1 ten thousand, the writing speed analysis result can be obtained according to the writing speed analysis table: the reason for the slow writing speed is that the size of a single file is small and the number of files is large. Therefore, the reason of low writing speed can be quickly analyzed according to the size of the storage space occupied by the files in the mount directory and the number of the files.
Wherein the number of files comprises the number of files of the secondary directory under the mount directory.
In addition, after the server counts the traffic of the client according to the variable quantity of the file size in the mount directory, a traffic display diagram corresponding to the traffic of the client can be generated. The traffic display map may then be sent to the traffic display device to cause the traffic display device to display the traffic display map. Therefore, the flow of the client can be visually displayed, so that a technician can quickly know which clients cause the pressure of processing data by the network file system.
For example, a traffic exposure graph corresponding to the traffic of each client mounting the network file system may be generated by Falcon. Of course, a traffic demo corresponding to the traffic of the client having the sampling tag mounted on the network file system may be generated by Falcon.
The method comprises the following steps of obtaining a file security monitoring platform of a Web server, wherein the Falcon is a Web server file security monitoring platform developed based on inotify-tools. In the embodiment of the application, a Falcon-Screen graph can be created by using a web page provided by a Falcon, and then the Falcon-Screen graph can show the traffic of the client obtained by statistics as a traffic display graph. The flow rate display graph may be a graph or a bar graph, but is not limited thereto.
It is understood that a file size presentation graph corresponding to the size of each client mount directory file on which the network file system is mounted can also be generated by Falcon. Furthermore, a file number display diagram corresponding to the number of the mount directory files of each client mounted with the network file system can be generated through Falcon. In this way, a technician can combine the file size presentation graph and the file number presentation graph to determine which clients the stress of the network file system on processing data is caused by, and analyze the reason causing the stress.
In summary, by applying the client traffic statistical method provided by the embodiment of the present application, the mount directory of the network file system mounted by the client can be determined according to the user name used by the network file system mounted by the client, so that the client traffic can be counted according to the mount directory. Further, it can be determined from the client traffic which clients the network file system is stressed to process the data.
Corresponding to the foregoing method embodiment, an embodiment of the present application further provides a client traffic statistic apparatus, applied to a server, and referring to fig. 3, the apparatus may include:
a first determining module 301 configured to determine a client mounted with a network file system;
an obtaining module 302 configured to obtain a user name used by the client to mount the network file system; the user name used by the client is consistent with the mounting directory of the network file system mounted by the client;
and the first statistical module 303 is configured to count the traffic of the client according to the variable quantity of the file size in the mount directory.
By applying the device provided by the embodiment of the application, the server can determine the client mounted with the network file system. The username with which the client mounts the network file system can then be obtained. The user name used by the client for mounting the file system is consistent with the mounting directory, so that the server can determine the mounting directory for mounting the network file by the client. Then, the server may count the traffic of the client according to the amount of change in the size of the file in the mount directory. In this way, the server can count the traffic of the client, and further can determine which clients the network file system is stressed to process data according to the obtained traffic.
Optionally, in this embodiment of the present application, the apparatus may further include:
the generating unit is configured to generate a mounting directory carrying mounting keywords according to a registration request sent by a user before determining that a client of the network file system is mounted; the registration request carries user-defined mounting keywords;
the sending unit is configured to send the user name of the mounting directory to the user, so that the user inputs the user name to the client, and the client mounts the network file system through the user name;
the storage unit is configured to store the user name into the mount user list when the fact that the network file system is mounted on the client side is detected.
Optionally, in an embodiment of the present application, the sending unit is configured to:
and sending the user name and the key corresponding to the user name which are used as the mounting catalog to the user, so that the user inputs the user name and the key to the client, and the client mounts the network file system through the user name and the key.
Optionally, in an embodiment of the present application, the first statistical module 303 may include:
a first calculation unit configured to calculate a variation amount of a file size of a file under a mount directory within a preset time period;
and the second calculation unit is configured to calculate the average flow of the client within the preset time period according to the variation and the duration of the preset time period.
Optionally, in another embodiment of the present application, the first statistical module 303 may include:
a determining unit configured to determine a user name having a preset keyword among the obtained user names as a target user name;
and the third calculating unit is configured to calculate the flow of the client corresponding to the target user name according to the variable quantity of the file size under the mount directory corresponding to the target user name.
Optionally, in this embodiment of the present application, the apparatus may further include:
the second counting module is configured to count the size of the storage space occupied by the files in the mount directory after the user name used by the network file system mounted by the client is obtained;
the third statistical module is configured to count the number of files in the mount directory;
and the second determining module is configured to determine the writing speed analysis result of the client according to the size of the storage space, the number of files and a preset writing speed analysis table.
Optionally, in this embodiment of the present application, the apparatus may further include:
the generating module is configured to generate a flow display diagram corresponding to the client flow after counting the flow of the client according to the variable quantity of the file size in the mount directory;
the sending module is configured to send the traffic display map to the traffic display device so that the traffic display device displays the traffic display map.
Fig. 4 is a block diagram illustrating an apparatus 1900 for implementing client traffic statistics in accordance with an exemplary embodiment. For example, the apparatus 1900 may be provided as a server. Referring to fig. 4, the device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by the processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform method steps of any of the client traffic statistics methods described above.
The device 1900 may also include a power component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to a network, and an input/output (I/O) interface 1958. The device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
In an embodiment of the present application, a server may determine that a client of a network file system is mounted. The username with which the client mounts the network file system can then be obtained. The user name used by the client for mounting the file system is consistent with the mounting directory, so that the server can determine the mounting directory for mounting the network file by the client. Then, the server may count the traffic of the client according to the amount of change in the size of the file in the mount directory. In this way, the server can count the traffic of the client, and further can determine which clients the network file system is stressed to process data according to the obtained traffic.
Corresponding to the foregoing method embodiment, an embodiment of the present application further provides a readable storage medium, and when the instructions in the storage medium are executed by a processor of the server, the server is enabled to perform the method steps of any one of the foregoing client traffic statistical methods. Wherein the readable storage medium is a computer readable storage medium.
After the computer program stored in the readable storage medium provided by the embodiment of the present application is executed by the processor of the server, the server may determine that the client of the network file system is mounted. The username with which the client mounts the network file system can then be obtained. The user name used by the client for mounting the file system is consistent with the mounting directory, so that the server can determine the mounting directory for mounting the network file by the client. Then, the server may count the traffic of the client according to the amount of change in the size of the file in the mount directory. In this way, the server can count the traffic of the client, and further can determine which clients the network file system is stressed to process data according to the obtained traffic.
Corresponding to the above method embodiment, this application embodiment also provides a computer program product, which when run on a server, causes the server to perform: method steps of any of the above client traffic statistics methods.
After the computer program product provided by the embodiment of the application is executed by the processor of the server, the server can determine that the client of the network file system is mounted. The username with which the client mounts the network file system can then be obtained. The user name used by the client for mounting the file system is consistent with the mounting directory, so that the server can determine the mounting directory for mounting the network file by the client. Then, the server may count the traffic of the client according to the amount of change in the size of the file in the mount directory. In this way, the server can count the traffic of the client, and further can determine which clients the network file system is stressed to process data according to the obtained traffic.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the server, the readable storage medium and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to the description, reference may be made to some of the description of the method embodiments.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (16)

1. A client traffic statistical method is applied to a server, and the method comprises the following steps:
determining a client mounted with a network file system;
obtaining a user name used by the client for mounting the network file system; the user name used by the client is consistent with the mounting directory of the network file system mounted by the client;
according to the variable quantity of the file size under the mounting catalog, the flow of the client is counted, wherein the client accesses the file under the mounting catalog corresponding to the client through a network;
before the step of determining that the client of the network file system is mounted, the method further includes:
generating a mounting catalog carrying mounting keywords according to a registration request sent by a user; the registration request carries the user-defined mounting keywords;
and sending the user name of the mounting directory to the user, so that the user inputs the user name to the client, and the client mounts the network file system through the user name.
2. The method of claim 1, further comprising, prior to the step of determining that the client of the network file system is mounted:
and when the client is detected to mount the network file system, storing the user name into a mounting user list.
3. The method of claim 1, wherein the step of sending the user name as the mount directory to the user, so that the user inputs the user name to the client, and the client mounts the network file system via the user name comprises:
and sending the user name and the key corresponding to the user name which are taken as the mounting directory to the user, so that the user inputs the user name and the key to the client, and the client mounts the network file system through the user name and the key.
4. The method according to claim 1, wherein the step of counting traffic of the client according to the amount of change in the file size under the mount directory comprises:
calculating the variable quantity of the file size of the files in the mounting catalog in a preset time period;
and calculating the average flow of the client in the preset time period according to the variable quantity and the duration of the preset time period.
5. The method according to claim 1, wherein the step of counting traffic of the client according to the amount of change in the file size under the mount directory comprises:
determining a user name with preset keywords in the obtained user names as a target user name;
and calculating the flow of the client corresponding to the target user name according to the variable quantity of the file size under the mounting directory corresponding to the target user name.
6. The method of claim 1, after the step of obtaining a username used by the client to mount the network file system, further comprising:
counting the size of the storage space occupied by the files under the mount directory;
counting the number of files in the mount directory;
and determining a writing speed analysis result of the client according to the size of the storage space, the number of the files and a preset writing speed analysis table.
7. The method according to any one of claims 1-6, wherein after the step of counting the traffic of the client according to the variation of the file size under the mount directory, the method further comprises:
generating a flow display diagram corresponding to the flow of the client;
sending the flow display diagram to flow display equipment so that the flow display equipment displays the flow display diagram.
8. A client flow statistic device applied to a server, the device comprising:
a first determination module configured to determine a client mounted with a network file system;
an obtaining module configured to obtain a user name used by the client to mount the network file system; the user name used by the client is consistent with the mounting directory of the network file system mounted by the client;
the first statistical module is configured to count the flow of the client according to the variable quantity of the file size under the mounting directory, wherein the client accesses the file under the mounting directory corresponding to the client through a network;
the device further comprises:
the generating unit is configured to generate a mounting directory carrying mounting keywords according to a registration request sent by a user before determining that a client of the network file system is mounted; the registration request carries the user-defined mounting keywords;
and the sending unit is configured to send the user name as the mounting directory to the user, so that the user inputs the user name to the client, and the client mounts the network file system through the user name.
9. The apparatus of claim 8, further comprising:
a storage unit configured to store the user name in a mount user list when it is detected that the client mounts the network file system.
10. The apparatus of claim 8, wherein the transmitting unit is configured to:
and sending the user name and the key corresponding to the user name which are taken as the mounting directory to the user, so that the user inputs the user name and the key to the client, and the client mounts the network file system through the user name and the key.
11. The apparatus of claim 8, wherein the first statistics module comprises:
a first calculation unit configured to calculate a variation amount of a file size of a file under the mount directory within a preset time period;
and the second calculation unit is configured to calculate the average flow of the client within the preset time period according to the variation and the duration of the preset time period.
12. The apparatus of claim 8, wherein the first statistics module comprises:
a determining unit configured to determine a user name having a preset keyword among the obtained user names as a target user name;
and the third calculating unit is configured to calculate the flow of the client corresponding to the target user name according to the variable quantity of the file size under the mount directory corresponding to the target user name.
13. The apparatus of claim 8, further comprising:
the second counting module is configured to count the size of the storage space occupied by the files in the mount directory after the user name used by the network file system mounted by the client is obtained;
the third counting module is configured to count the number of files in the mount directory;
and the second determining module is configured to determine a writing speed analysis result of the client according to the size of the storage space, the number of the files and a preset writing speed analysis table.
14. The apparatus of any one of claims 8-13, further comprising:
the generating module is configured to generate a flow display diagram corresponding to the flow of the client after counting the flow of the client according to the variable quantity of the file size in the mount directory;
a sending module configured to send the traffic display map to a traffic display device so that the traffic display device displays the traffic display map.
15. A server, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to: method steps for performing the client traffic statistics method of any of the preceding claims 1-7.
16. A readable storage medium, wherein the instructions when executed by a processor of a server, enable the server to perform the method steps of the client traffic statistics method of any of claims 1-7.
CN201910098144.8A 2019-01-31 2019-01-31 Client flow statistical method and device, server and readable storage medium Active CN109831358B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910098144.8A CN109831358B (en) 2019-01-31 2019-01-31 Client flow statistical method and device, server and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910098144.8A CN109831358B (en) 2019-01-31 2019-01-31 Client flow statistical method and device, server and readable storage medium

Publications (2)

Publication Number Publication Date
CN109831358A CN109831358A (en) 2019-05-31
CN109831358B true CN109831358B (en) 2021-01-01

Family

ID=66863157

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910098144.8A Active CN109831358B (en) 2019-01-31 2019-01-31 Client flow statistical method and device, server and readable storage medium

Country Status (1)

Country Link
CN (1) CN109831358B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110809056B (en) * 2019-11-12 2022-03-22 浪潮云信息技术股份公司 Method for counting file storage user usage amount
CN112988694A (en) * 2019-12-12 2021-06-18 北京车和家信息技术有限公司 Operation and maintenance method and device for batch management of network file systems by centralized management platform
CN111083012B (en) * 2019-12-18 2021-10-26 苏州浪潮智能科技有限公司 Data center switch flow statistical method and equipment
CN111314183B (en) * 2020-04-09 2022-02-22 网易(杭州)网络有限公司 Flow information detection method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107870734A (en) * 2016-09-27 2018-04-03 苏宁云商集团股份有限公司 The exchange method and device of a kind of distributed file system
CN108628727A (en) * 2018-04-19 2018-10-09 山东省计算中心(国家超级计算济南中心) It is a kind of based on mode operation when feature mode operations running state analysis method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010079713A1 (en) * 2009-01-08 2010-07-15 日本電気株式会社 Distributed file name resolution system, distributed file name resolution method, and distributed file name resolution program
CN104158886B (en) * 2014-08-21 2017-05-24 中南大学 Flow-type performing method for applications
CN106230938A (en) * 2016-07-29 2016-12-14 浪潮(北京)电子信息产业有限公司 Directory information synchronous method between a kind of client and server and system
CN107484201B (en) * 2017-09-30 2020-08-14 Oppo广东移动通信有限公司 Flow statistical method and device, terminal and computer readable storage medium
CN107958051A (en) * 2017-11-28 2018-04-24 郑州云海信息技术有限公司 A kind of method, apparatus and medium of statistics and Display directory size

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107870734A (en) * 2016-09-27 2018-04-03 苏宁云商集团股份有限公司 The exchange method and device of a kind of distributed file system
CN108628727A (en) * 2018-04-19 2018-10-09 山东省计算中心(国家超级计算济南中心) It is a kind of based on mode operation when feature mode operations running state analysis method

Also Published As

Publication number Publication date
CN109831358A (en) 2019-05-31

Similar Documents

Publication Publication Date Title
CN109831358B (en) Client flow statistical method and device, server and readable storage medium
US20200328932A1 (en) Timestamp-based matching of identifiers
US9503502B1 (en) Feedback mechanisms providing contextual information
US10491621B2 (en) Website security tracking across a network
WO2012101243A1 (en) Systems, methods, and media for managing ambient adaptability of web applications and web services
CN109039787B (en) Log processing method and device and big data cluster
CN109213604B (en) Data source management method and device
JP2016504687A (en) Management of information technology services
US20240048434A1 (en) Timestamp-based association of identifiers
US20150278157A1 (en) Generating anonymous data from web data
US8862667B2 (en) Network based audience measurement
US20180331924A1 (en) System monitoring device
US10715413B2 (en) Timestamp-based session association
EP2332119A2 (en) Recording and/or use of generation information
CN112287326A (en) Security authentication method and device, electronic equipment and storage medium
CN108011936B (en) Method and device for pushing information
CN109542743B (en) Log checking method and device, electronic equipment and computer readable storage medium
US20170223136A1 (en) Any Web Page Reporting and Capture
CN110674426A (en) Webpage behavior reporting method and device
CN108418827B (en) Network behavior analysis method and device
US8825843B2 (en) System and methods for monitoring a geographic information system
US11308403B1 (en) Automatic identification of critical network assets of a private computer network
CN113114611A (en) Method and device for managing blacklist
US11900398B1 (en) Call management system
CN109086428B (en) Forwarding information access frequency counting method and device

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