File monitoring method, device, medium, equipment and program product

By receiving file monitoring instructions and monitoring the data writing in the folder, it solves the problem of difficult monitoring of disk file writing during application running, and realizes the identification and optimization of data writing exceptions in the business scenario of the application.

CN114546961BActive Publication Date: 2024-09-20BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210172949.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-24
Publication Date
2024-09-20
Estimated Expiration
2042-02-24

AI Technical Summary

Technical Problem

The existing technology cannot effectively monitor the writing of disk files during the running process of the application, resulting in reduced running smoothness and lagging problems.

Method used

Provide a file monitoring method that determines the files to be monitored in the folder to be monitored by receiving file monitoring instructions sent by the server, obtains file status information during data writing operations, and sends it to the server to determine whether the preset exception conditions are met. , and then identify data writing anomalies.

Benefits of technology

It enables online monitoring of folder data writing status of applications in different business scenarios, and guides development and operation and maintenance personnel to optimize application functions and improve system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114546961B
    Figure CN114546961B
Patent Text Reader

Abstract

The present disclosure provides a file monitoring method, device, electronic device, storage medium and program product, which relates to the field of computer technology. The file monitoring method includes: receiving a file monitoring instruction sent by a server; determining at least one file to be monitored in a folder to be monitored corresponding to a folder to be monitored identifier; when a data write operation for the file to be monitored is detected, determining that the file to be monitored is a target file, and determining the file status information of the target file; sending the file status information of the target file to the server, so that when the server determines that the target folder meets a preset abnormal condition according to the file status information, it determines that the data write abnormality of the user terminal in the business scenario associated with the target folder is determined, and the target folder is a folder to be monitored containing the target file. The present disclosure provides an online monitoring solution for folders corresponding to applications, which is convenient for making more targeted guidance for application optimization based on the monitoring results.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] An application program (APP) is a program written for a specific user purpose and is widely used in various terminal devices.

[0003] As the functions that applications can achieve become more diverse, the amount and frequency of disk files written to store application running data are also increasing during application running. Excessive file write volume and frequency may affect the running smoothness of the application and cause the application to freeze.

[0004] Related technologies provide a solution for determining the amount of data written to a folder associated with an application. However, the solution is generally implemented through theoretical writing data obtained through offline testing, which has no practical reference significance for determining the data writing status of the folder during the actual operation of the application. Summary of the invention

[0005] The present disclosure provides a file monitoring method, device, electronic device, storage medium and program product, which can solve the problem in the related art that the writing status of the disk file of the application program in the running process cannot be monitored. The technical solution of the present disclosure is as follows:

[0006] According to a first aspect of an embodiment of the present disclosure, a file monitoring method is provided, the method being applied to a user terminal, comprising:

[0007] Receive a file monitoring instruction sent by a server, wherein the file monitoring instruction includes a folder identifier to be monitored, and the folder identifier to be monitored is an identifier of a data storage folder corresponding to a business scenario;

[0008] Determine at least one file to be monitored in the folder to be monitored corresponding to the folder to be monitored identifier;

[0009] When a data writing operation for the file to be monitored is detected, determining the file to be monitored as a target file, and determining file status information of the target file;

[0010] The file status information of the target file is sent to the server, so that when the server determines that the target folder meets the preset abnormal condition based on the file status information, it determines that the data writing abnormality of the user terminal in the business scenario associated with the target folder is abnormal, and the target folder is the folder to be monitored that contains the target file.

[0011] Optionally, the file status information includes a data write increment of the target file. After determining at least one file to be monitored in the folder to be monitored, the method further includes:

[0012] Determining a first data volume of the file to be monitored;

[0013] The determining of the file status information of the target file includes:

[0014] A second data volume of the target file is determined, and a write data increment of the target file is determined according to the first data volume and the second data volume of the target file.

[0015] Optionally, the file status information includes a data writing frequency of the target file, and determining the file status information of the target file includes:

[0016] The data writing frequency of the target file is determined according to the frequency of data writing operations on the target file within a preset time period.

[0017] Optionally, the determining at least one file to be monitored in the folder to be monitored corresponding to the folder to be monitored identifier includes:

[0018] Determine the file type of each to-be-processed file contained in the to-be-monitored folder;

[0019] If it is determined that the to-be-processed file is a file-type to-be-processed file, then determining that the to-be-processed file is the to-be-monitored file;

[0020] If it is determined that the to-be-processed file is a folder-type to-be-processed file, then the to-be-processed folder is determined to be a to-be-monitored folder, and the above process is continued until all file-type to-be-processed files in the to-be-monitored files are determined, and at least one to-be-monitored file in the to-be-monitored folder is obtained.

[0021] According to a second aspect of an embodiment of the present disclosure, a file monitoring method is provided, the method being applied to a server, comprising:

[0022] In response to a configuration operation of a folder to be monitored, configuration information is acquired, the configuration information including device information and an identifier of the folder to be monitored, the identifier of the folder to be monitored being an identifier of a data storage folder corresponding to the business scenario;

[0023] Sending a file monitoring instruction including the to-be-monitored folder identifier to a user terminal corresponding to the device information, so that the user terminal determines at least one to-be-monitored file in the to-be-monitored folder corresponding to the to-be-monitored folder identifier, and when a data writing operation for the to-be-monitored file is detected, determining that the to-be-monitored file is a target file, and sending file status information of the target file to the server;

[0024] Receive file status information sent by the user terminal, and when determining that a target folder meets a preset abnormal condition based on the file status information, determine that data writing of the user terminal in the business scenario associated with the target folder is abnormal, and the target folder is the folder to be monitored that contains the target file.

[0025] Optionally, the file status information includes a write data increment of the target file, and determining that the target folder meets a preset abnormal condition according to the file status information includes:

[0026] If it is determined that the write data increment is greater than or equal to a preset write data increment threshold, it is determined that the target folder meets a preset abnormal condition.

[0027] Optionally, the file status information includes a data writing frequency of the target file, and determining that the target folder meets a preset abnormal condition according to the file status information includes:

[0028] If it is determined that the data writing frequency is greater than or equal to a preset data writing frequency threshold, it is determined that the target folder meets a preset abnormal condition.

[0029] According to a third aspect of an embodiment of the present disclosure, a file monitoring device is provided, the device being applied to a user terminal, comprising:

[0030] A first receiving module is configured to receive a file monitoring instruction sent by a server, wherein the file monitoring instruction includes a folder identifier to be monitored, and the folder identifier to be monitored is an identifier of a data storage folder corresponding to a business scenario;

[0031] A first determining module is configured to determine at least one file to be monitored in the folder to be monitored corresponding to the identifier of the folder to be monitored;

[0032] The second determination module is configured to determine that the file to be monitored is a target file when a data write operation to the file to be monitored is detected, and to determine the file status information of the target file

[0033] The first sending module is configured to send the file status information of the target file to the server, so that when the server determines that the target folder meets the preset abnormal condition based on the file status information, it determines that the data writing abnormality of the user terminal in the business scenario associated with the target folder is abnormal, and the target folder is the folder to be monitored that contains the target file.

[0034] Optionally, the file status information includes a data write increment of the target file, and the device further includes a third determination module configured to:

[0035] Determining a first data volume of the file to be monitored;

[0036] The second determining module is configured to:

[0037] A second data volume of the target file is determined, and a write data increment of the target file is determined according to the first data volume and the second data volume of the target file.

[0038] Optionally, the file status information includes a data writing frequency of the target file, and the second determining module is configured to:

[0039] The data writing frequency of the target file is determined according to the frequency of data writing operations on the target file within a preset time period.

[0040] Optionally, the first determining module is configured to:

[0041] Determine the file type of each to-be-processed file contained in the to-be-monitored folder;

[0042] If it is determined that the to-be-processed file is a file-type to-be-processed file, then determining that the to-be-processed file is the to-be-monitored file;

[0043] If it is determined that the to-be-processed file is a folder-type to-be-processed file, then the to-be-processed folder is determined to be a to-be-monitored folder, and the above process is continued until all file-type to-be-processed files in the to-be-monitored files are determined, and at least one to-be-monitored file in the to-be-monitored folder is obtained.

[0044] According to a fourth aspect of an embodiment of the present disclosure, a file monitoring device is provided, the device being applied to a server, comprising:

[0045] An information configuration module, configured to obtain configuration information in response to a configuration operation of a folder to be monitored, wherein the configuration information includes device information and an identifier of the folder to be monitored, wherein the identifier of the folder to be monitored is an identifier of a data storage folder corresponding to a business scenario;

[0046] A second sending module is configured to send a file monitoring instruction including the to-be-monitored folder identifier to a user terminal corresponding to the device information, so that the user terminal determines at least one to-be-monitored file in the to-be-monitored folder corresponding to the to-be-monitored folder identifier, and when a data writing operation for the to-be-monitored file is detected, determines that the to-be-monitored file is a target file, and sends file status information of the target file to the server;

[0047] The second receiving module is configured to receive file status information sent by the user terminal, and when it is determined according to the file status information that the target folder meets the preset abnormal condition, determine that the data writing abnormality of the user terminal in the business scenario associated with the target folder is present, and the target folder is the folder to be monitored that contains the target file.

[0048] Optionally, the file status information includes a write data increment of the target file, and the second receiving module is configured to:

[0049] If it is determined that the write data increment is greater than or equal to a preset write data increment threshold, it is determined that the target folder meets a preset abnormal condition.

[0050] Optionally, the file status information includes a data writing frequency of the target file, and the second receiving module is configured to:

[0051] If it is determined that the data writing frequency is greater than or equal to a preset data writing frequency threshold, it is determined that the target folder meets a preset abnormal condition.

[0052] According to a fifth aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0053] processor;

[0054] a memory for storing instructions executable by the processor;

[0055] The processor is configured to execute the instructions to implement the file monitoring method as described in the first aspect or the second aspect.

[0056] According to a sixth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute the file monitoring method described in the first aspect or the second aspect.

[0057] According to a seventh aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the file monitoring method as described in the first aspect or the second aspect is implemented.

[0058] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0059] The present disclosure provides a file monitoring method, device, electronic device, computer-readable storage medium and computer program product. Among them, the user terminal can receive a file monitoring instruction sent by a server, and determine at least one file to be monitored in a folder to be monitored corresponding to the folder to be monitored identifier in the file monitoring instruction, and when a data write operation for the file to be monitored is detected, the file to be monitored is determined to be a target file, and the file status information of the target file is determined, and the file status information of the target file is sent to the server, so that when the server determines that the target folder meets the preset abnormal condition according to the file status information, the data write abnormality of the user terminal in the business scenario associated with the target folder is determined; on the one hand, an online monitoring solution for the corresponding folders of the application in various business scenarios is provided; on the other hand, according to the file status information of the file to be monitored in the folder associated with the business scenario after the data write operation is performed during the operation of the application, the developers and operation and maintenance personnel can be guided to optimize the application functions corresponding to different business scenarios.

[0060] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0062] Figure 1 It is a schematic architecture diagram of a file monitoring system according to an exemplary embodiment.

[0063] Figure 2 The figure is a flow chart of a file monitoring method according to an exemplary embodiment.

[0064] Figure 3 The figure is a flow chart showing another file monitoring method according to an exemplary embodiment.

[0065] Figure 4 The figure is a flow chart of another file monitoring method according to an exemplary embodiment.

[0066] Figure 5 The present invention is a block diagram of a file monitoring device according to an exemplary embodiment.

[0067] Figure 6 is a block diagram of another file monitoring device according to an exemplary embodiment.

[0068] Figure 7 The diagram is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0069] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0070] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0071] An exemplary embodiment of the present disclosure provides a file monitoring system. Figure 1 The schematic architecture diagram of the file monitoring system is shown in FIG. Figure 1 As shown, the file monitoring system 100 may include a server 110 and at least one user terminal 120. The server 110 may include a system server or a third-party server, and the third-party server may include a background server of a third-party application, for example, a server of an e-commerce application, a server of a live broadcast application, or a server of an audio and video application. The user terminal 120 may be a terminal device installed with a third-party application, and the terminal device may be a mobile phone, a computer, a tablet, or a wearable device. The server 110 and the user terminal 120 may establish a connection through a network, and when the third-party application in the user terminal 120 is running, the server 110 may provide services for the application.

[0072] Among them, the server 110 can obtain configuration information in response to the configuration operation of the folder to be monitored, wherein the configuration information includes the folder to be monitored identifier, and the folder to be monitored identifier is the identifier of the data storage folder corresponding to the business scenario; further, the server 110 can send a file monitoring instruction containing the folder to be monitored identifier to the user terminal 120 corresponding to the device information.

[0073] The user terminal 120 may receive the file monitoring instruction sent by the server 110, and determine at least one file to be monitored in the folder to be monitored corresponding to the folder to be monitored identifier; when a data write operation for the file to be monitored is detected, determine the file to be monitored as a target file, and determine the file status information of the target file; and send the file status information of the target file to the server 110;

[0074] The server 110 can receive the file status information sent by the user terminal, and when it is determined according to the file status information that the target folder meets the preset abnormal condition, it is determined that the data writing of the user terminal in the business scenario associated with the target folder is abnormal, wherein the target folder is the folder to be monitored containing the target file. Online monitoring of the disk files corresponding to the application can be realized; and according to the file status information after the data writing operation is performed on the files to be monitored in the folder associated with the business scenario during the operation of the application, the developers and operation and maintenance personnel can be guided to optimize the application functions corresponding to different business scenarios.

[0075] Figure 2 is a flowchart of a file monitoring method according to an exemplary embodiment. Figure 2 As shown, the file monitoring method is used in a user terminal, and the file monitoring method includes the following steps S201 to S204:

[0076] Step S201: Receive a file monitoring instruction sent by a server.

[0077] In the disclosed embodiment, the file monitoring instruction includes a to-be-monitored folder identifier, which is an identifier of a data storage folder corresponding to a business scenario, and a business scenario is an operation scenario in which a corresponding business function can be realized during the operation of an application. For example, for a live broadcast application, the business scenario may include a live broadcast business scenario, a video browsing business scenario, or a video upload business scenario. It should be noted that the data storage folder is used to store data generated by the application during operation in the corresponding business scenario. For example, a data storage folder corresponding to a live broadcast business scenario is used to store data generated by the application during the live broadcast process.

[0078] Step S202: Determine at least one file to be monitored in the folder to be monitored corresponding to the folder to be monitored identifier.

[0079] Step S203: when a data writing operation on the file to be monitored is detected, the file to be monitored is determined to be a target file, and file status information of the target file is determined.

[0080] Step S204: Send the file status information of the target file to the server, so that when the server determines that the target folder meets the preset abnormal condition according to the file status information, it determines that the data writing of the user terminal in the business scenario associated with the target folder is abnormal.

[0081] In the embodiment of the present disclosure, the target folder is a folder to be monitored that contains a target file.

[0082] To sum up, the user terminal can receive the file monitoring instruction sent by the server, and determine at least one file to be monitored in the folder to be monitored corresponding to the folder to be monitored identifier in the file monitoring instruction; when a data write operation is detected for the file to be monitored, the file to be monitored is determined to be a target file, and the file status information of the target file is determined, and the file status information of the target file is sent to the server, so that when the server determines that the target folder meets the preset abnormal condition according to the file status information, it determines that the data write abnormality of the user terminal in the business scenario associated with the target folder; on the one hand, an online monitoring solution for the folder corresponding to the application is provided; on the other hand, according to the file status information of the file to be monitored in the folder associated with the business scenario after the data write operation is performed during the operation of the application, the developers and operation and maintenance personnel can be guided to optimize the application functions corresponding to different business scenarios.

[0083] In an optional embodiment, in the above step S201, the user terminal may receive a file monitoring instruction sent by the server.

[0084] In the disclosed embodiment, the server may send a file monitoring instruction to the user terminal, wherein the file monitoring instruction includes a folder identifier to be monitored, and the file monitoring instruction is used to instruct the user terminal to monitor all the file-type to-be-processed files in the folder corresponding to the folder identifier to be monitored. The file-type to-be-processed files may include text files, image files, table files, or video files, etc.

[0085] In an optional embodiment, the process of the server sending a file monitoring instruction to a user terminal may include: the server may obtain configuration information in response to a configuration operation of the folder to be monitored, wherein the configuration information includes device information and an identifier of the folder to be monitored, and the device information may include a device identifier of the user terminal, an operating system identifier, an operating system version identifier, and a device model identifier, etc.; and send a file monitoring instruction containing the identifier of the folder to be monitored to the user terminal corresponding to the device information.

[0086] Among them, the process of the server sending a file monitoring instruction containing a folder to be monitored identifier to the user terminal corresponding to the device information may include: after the server responds to the connection request sent by the user terminal corresponding to the device information, the server establishes a connection between the server and the user terminal, and generates a file monitoring instruction according to the folder to be monitored identifier in the configuration information, and sends the file monitoring instruction to the user terminal corresponding to the device information, wherein the connection request is generated by the user terminal in response to the start operation of the target application, and the target application is an application in the user terminal for which data services are provided by the server.

[0087] In an optional implementation, after the user terminal responds to the start operation of the target application, it can establish a connection with the server and receive the file monitoring instruction sent by the server. It is understandable that after the user terminal receives the file monitoring instruction sent by the server, it can obtain at least one to-be-monitored folder identifier in the file monitoring instruction.

[0088] In an optional embodiment, in the above step S202, the user terminal may determine at least one file to be monitored in the folder to be monitored corresponding to the folder to be monitored identifier.

[0089] In the embodiment of the present disclosure, the folder to be monitored corresponding to the folder identifier to be monitored is a folder in all folders of the user terminal, and the folder identifier is the same as the folder identifier to be monitored. The files to be monitored may include at least one file to be processed, and the types of the files to be processed may include at least one file to be processed. The files to be processed may include file-type files to be processed and folder-type files to be processed. Among them, the file-type files to be processed are used to store data of the corresponding type, for example, the file files are used to store text data.

[0090] In an optional embodiment, the process of the user terminal determining at least one file to be monitored in the folder to be monitored corresponding to the folder to be monitored identifier may include: determining the file type of each file to be processed contained in the folder to be monitored; if the file to be processed is determined to be a file-type file to be processed, then determining the file to be processed as a file to be monitored; if the file to be processed is determined to be a folder-type file to be processed, then determining the folder to be processed as a folder to be monitored, and continuing to perform the above process until all the file-type files to be processed in the files to be monitored are determined, and at least one file to be monitored in the folder to be monitored is obtained. During the operation of the application, the data writing status of each file to be monitored in the folder to be monitored can be monitored to improve the accuracy of determining whether the data writing status of the business scenario corresponding to the folder to be monitored is abnormal.

[0091] For example, assuming that the folder to be monitored A includes a file to be processed a1, a file to be processed a2 and a file to be processed. If the file to be processed a1 and the file to be processed a2 are respectively file-type files to be processed, the file to be processed a1 and the file to be processed a2 are determined as files to be monitored; if the file to be processed a3 is a folder-type file to be processed, the file to be processed a3 is determined as a folder to be monitored, and the file types of the files to be processed a31 and a32 in the folder to be monitored are continuously obtained. Assuming that the file to be processed a32 is a file-type file to be processed, the file to be processed a32 is determined as a file to be monitored; if the file to be processed 31 is a folder-type file to be processed, the file to be processed a31 is determined as a folder to be monitored, and the file types of the files to be processed in the folder to be monitored a31 are continuously obtained until all the file-type files to be processed in the folder to be monitored A are obtained, and at least one file to be monitored in the folder to be monitored A is obtained.

[0092] It should be noted that since the file monitoring instruction may include multiple folder identifiers to be monitored, for each folder identifier to be monitored, the user terminal can determine at least one file to be monitored in the folder to be monitored corresponding to the folder identifier to be monitored according to the method in step S201.

[0093] In an optional embodiment, in the above step S203, when the user terminal detects a data writing operation on the file to be monitored, it may determine that the file to be monitored is a target file, and determine the file status information of the target file.

[0094] In an embodiment of the present disclosure, the file status information of the target file may include the amount of data after the target file is subjected to a data write operation, the write data increment after the target file is subjected to a data write operation, and / or the data write frequency after the target file is subjected to a data write operation, etc.

[0095] In an optional embodiment, the file status information of the target file includes the incremental data written after the target file is subjected to a data write operation. After determining at least one file to be monitored in the folder to be monitored, the user terminal also needs to determine the first data volume of the file to be monitored; and the process of the user terminal determining the file status information of the target file may include: determining the second data volume of the target file, and determining the incremental data written for the target file based on the first data volume and the second data volume of the target file. It should be noted that the first data volume is the data volume before the data write operation is performed on the target file; the second data volume is the data volume after the data write operation is performed on the target file. It is possible to use the size of the incremental data of the written data of the folder to be monitored to determine whether the data writing of the application is abnormal in the business scenario corresponding to the folder to be monitored.

[0096] The process in which the user terminal determines the write data increment of the target file according to the first data volume and the second data volume of the target file may include: determining the difference between the second data volume and the first data volume to obtain the write data increment of the target file.

[0097] In an optional real-time method, in order to analyze the data writing status of the application in the business scenario corresponding to the monitored folder within a preset time period, the user terminal determines the target file's write data increment based on the first data volume and the second data volume of the target file. The process may include: determining the second data volume of the target file at the end time of the preset time period, and determining the difference between the first data volume of the target file at the start time of the preset time period, and obtaining the write data increment of the target file within the preset time period. The preset time period can be determined based on actual needs, and the embodiments of the present disclosure are not limited to this. For example, the preset time period can be the running time period of the application. For example, the user terminal starts running the target application at 10:13:24 am on January 10, 2022, and ends running the target application at 10:52:09 am on January 10, 2022. The preset duration can be from 10:13:24 am on January 10, 2022 to 10:52:09 am on January 10, 2022; or, the preset duration can be the duration of each data collection cycle corresponding to the preset data collection cycle. For example, the preset data collection cycle is to collect the data writing status of the monitored folder every 15 minutes. In this case, the write data increment of the target file can be obtained every 15 minutes.

[0098] In an optional real-time method, the file status information of the target file includes the frequency of data writing operations performed on the target file. The process of the user terminal determining the file status information of the target file may include: determining the data writing frequency of the target file according to the frequency of data writing operations on the target file within a preset time. The preset time can be determined based on actual needs, and the embodiments of the present disclosure do not limit this. It is possible to use the frequency of data writing operations on the folder to be monitored to determine whether the data writing of the application is abnormal in the business scenario corresponding to the folder to be monitored.

[0099] Among them, the process of determining the data writing frequency of the target file based on the frequency of data writing operations on the target file within the preset time length may include: determining the frequency of data writing operations on the target file within the preset time length, determining the ratio of the data writing frequency and the preset time length, and obtaining the data writing frequency of the target file.

[0100] In an optional embodiment, in the above step S204, the user terminal can send the file status information of the target file to the server, so that when the server determines that the target folder meets the preset abnormal condition based on the file status information, it determines that the data writing abnormality of the user terminal in the business scenario associated with the target folder.

[0101] In an embodiment of the present disclosure, the file status information may also include device information of the user terminal and basic file information of the target file. The basic file information is used to characterize attribute information of the target file. The basic file information may include a target folder identifier, a file name of the target file, and a file path of the target file, etc. The target folder is a folder to be monitored that contains the target file.

[0102] In an optional implementation, the file status information may include device information of the user terminal, basic file information of the target file, and a write data increment after a data write operation is performed on the target file. The user terminal sends the file status information of the target file to the server, so that the server determines that the target folder meets the preset abnormal condition according to the file status information. The process may include:

[0103] The user terminal sends the file status information to the server. If the server determines that the write data increment in the file status information is greater than or equal to the preset write data increment threshold, it is determined that the target folder meets the preset abnormal condition; if the server determines that the write data increment in the file status information is less than the preset write data increment threshold, it is determined that the target folder does not meet the preset abnormal condition. The data increment threshold can be determined based on actual needs, and the embodiments of the present disclosure do not limit this.

[0104] In an optional implementation, within a preset time period, when an application is running in a certain business scenario, among the files to be monitored corresponding to the business scenario, the files to be monitored on which the data writing operation is performed may include multiple files, and the file status information may include the increment of written data after the data writing operation is performed on each target file within the preset time period, wherein the user terminal sends the file status information of the target file to the server so that the server determines whether the target folder meets the preset abnormal condition according to the file status information, and the process may include:

[0105] The user terminal sends the file status information to the server, and the server determines the sum of the write data increments of each target file after the data write operation is performed within a preset time period in the file status information, and obtains the total write data increment value of the target folder. If the server determines that the total write data increment value of the target folder is greater than or equal to the preset write data increment threshold, it is determined that the target folder meets the preset abnormal condition; if the server determines that the total write data increment value of the target folder is less than the preset write data increment threshold, it is determined that the target folder does not meet the preset abnormal condition.

[0106] In an optional embodiment, the file status information may include device information of the user terminal, basic file information of the target file, and the data writing frequency of the target file when the data writing operation is performed. The user terminal sends the file status information of the target file to the server, so that the server determines that the target folder meets the preset abnormal condition based on the file status information. The process may include: if it is determined that the data writing frequency is greater than or equal to the preset data writing frequency threshold, then it is determined that the target folder meets the preset abnormal condition; if it is determined that the data writing frequency is less than the preset data writing frequency threshold, then it is determined that the target folder does not meet the preset abnormal condition.

[0107] In an optional real-time mode, when the application is running in a certain business scenario within a preset time period, the files to be monitored corresponding to the business scenario may include multiple files to be monitored on which data writing operations are performed, and the file status information may include the data writing frequency of each target file on which data writing operations are performed within the preset time period, wherein the user terminal sends the file status information of the target file to the server so that the server determines whether the target folder meets the preset abnormal condition according to the file status information, and the process may include:

[0108] The user terminal sends the file status information to the server, and the server determines the sum of the data write frequencies of each target file in the file status information within a preset time period, and obtains the total data write frequency of the target folder. If the server determines that the total data write frequency of the target folder is greater than or equal to the preset data write frequency threshold, it is determined that the target folder meets the preset abnormal condition; if the server determines that the total data write frequency of the target folder is less than the preset data write frequency threshold, it is determined that the target folder does not meet the preset abnormal condition.

[0109] In an optional implementation, the server may pre-store a mapping relationship between folder identifiers and business scenarios, and the process by which the server determines that a user terminal has a data write exception in a business scenario associated with a target folder may include: determining the business scenario associated with the target folder in the mapping relationship between folder identifiers and business scenarios based on the target folder identifier in the file status information, and determining that the user terminal has a data write exception in the business scenario associated with the target folder. The mapping relationship between folder identifiers and business scenarios may be obtained after the application is developed.

[0110] For example, Figure 3 As shown, Figure 3 The present invention shows a user terminal whose operating system is the iOS (iPhone operating system) operating system, and a method flow chart of a method for monitoring files in a monitored folder based on the system function GCD SOURCE (Grand Central Dispatch) technology or hook write technology of the operating system. The file monitoring method includes:

[0111] Step S301, receiving a file monitoring instruction sent by a server;

[0112] Step S302, determining the folder to be monitored corresponding to the folder to be monitored identifier carried by the file monitoring instruction;

[0113] Step S303, determining whether the file type of each to-be-processed file contained in the to-be-monitored folder is a file-type to-be-processed file;

[0114] Step S304: if it is determined that the file to be processed is a folder-type file to be processed, then the file to be processed is determined to be a folder to be monitored;

[0115] In this step S304, the user terminal may continue to execute the above steps S303 to S304 until all the files to be processed of the file type in the files to be monitored are determined, and at least one file to be monitored in the folder to be monitored is obtained.

[0116] Step S305: If it is determined that the file to be processed is a file type file to be processed, then the file to be processed is determined to be a file to be monitored;

[0117] In this step S305, a file descriptor (FD) of the file to be monitored may be obtained, and the file descriptor may be registered to the operating system function module GCD SOURCE.

[0118] Step S306: when a data writing operation for the file to be monitored is detected, determining that the file to be monitored is a target file, and determining file status information of the target file;

[0119] In this step S306, if the operating system function module GCD SOURCE detects a data write operation on the file to be monitored corresponding to the registered file descriptor, the file to be monitored is determined to be a target file, and the file status information of the target file is determined.

[0120] Step S307: Send the file status information of the target file to the server, so that when the server determines that the target folder meets the preset abnormal condition according to the file status information, it determines that the data writing of the user terminal in the business scenario associated with the target folder is abnormal.

[0121] Figure 4 is a flowchart of a file monitoring method according to an exemplary embodiment. Figure 4 As shown, the file monitoring method is used in a server, and the file monitoring method includes the following steps S401 to S403:

[0122] Step S401: Acquire configuration information in response to a configuration operation of a folder to be monitored.

[0123] In the disclosed embodiment, the configuration information includes device information and a folder identifier to be monitored. The folder identifier to be monitored is an identifier of a data storage folder corresponding to a business scenario. The business scenario is an operating scenario in which corresponding business functions can be implemented during the operation of an application.

[0124] Step S402: Send a file monitoring instruction including a folder to be monitored identifier to the user terminal corresponding to the device information, so that the user terminal determines at least one file to be monitored in the folder to be monitored corresponding to the folder to be monitored identifier, and when a data write operation for the file to be monitored is detected, determines that the file to be monitored is a target file, and sends the file status information of the target file to the server.

[0125] Step S403: receiving file status information sent by the user terminal, and when determining that the target folder meets a preset abnormal condition according to the file status information, determining that data writing of the user terminal in a business scenario associated with the target folder is abnormal.

[0126] In the embodiment of the present disclosure, the target folder is a folder to be monitored that contains a target file.

[0127] In an embodiment of the present disclosure, the server can obtain configuration information in response to a configuration operation of a folder to be monitored, and send a file monitoring instruction containing a folder to be monitored identifier to a user terminal corresponding to the device information, so that the user terminal determines at least one file to be monitored in the folder to be monitored corresponding to the folder to be monitored identifier, and when a data write operation on the file to be monitored is detected, determines that the file to be monitored is a target file, and sends the file status information of the target file to the server, so that when the server determines that the target folder meets a preset abnormal condition according to the file status information, it determines that the user terminal has a data write abnormality in a business scenario associated with the target folder; on the one hand, an online monitoring solution for folders corresponding to applications is provided; on the other hand, according to the file status information of the files to be monitored in the folders associated with the business scenarios after the data write operation is performed during the operation of the application, developers and operation and maintenance personnel can be guided to optimize the application functions corresponding to different business scenarios.

[0128] In an optional real-time manner, the process of the server sending a file monitoring instruction including an identifier of a folder to be monitored to a user terminal corresponding to the device information can refer to the above embodiment, which is not described in detail in the embodiment of the present disclosure.

[0129] In an optional embodiment, in the above step S403, the server may receive file status information sent by the user terminal, and when determining that the target folder meets a preset abnormal condition based on the file status information, determine that data writing of the user terminal in a business scenario associated with the target folder is abnormal.

[0130] In an optional real-time manner, the file status information may include device information of the user terminal, basic information of the target file, and a written data increment after the target file is written with data. The process of the server determining whether the target folder meets the preset abnormal condition according to the file status information may include:

[0131] If it is determined that the write data increment is greater than or equal to the preset write data increment threshold, it is determined that the target folder meets the preset abnormal condition; if it is determined that the write data increment is less than the preset write data increment threshold, it is determined that the target folder does not meet the preset abnormal condition. It is possible to use the size of the data increment of the write data of the folder to be monitored to determine whether the data writing of the application is abnormal in the business scenario corresponding to the folder to be monitored.

[0132] In an optional real-time manner, the file status information may include device information of the user terminal, basic file information of the target file, and a data writing frequency of the target file when the data writing operation is performed. The process of the server determining whether the target folder meets the preset abnormal condition according to the file status information may include:

[0133] If it is determined that the data writing frequency is greater than or equal to the preset data writing frequency threshold, it is determined that the target folder meets the preset abnormal condition; if it is determined that the data writing frequency is less than the preset data writing frequency threshold, it is determined that the target folder does not meet the preset abnormal condition. The frequency of data writing operations on the folder to be monitored can be used to determine whether the data writing of the application is abnormal in the business scenario corresponding to the folder to be monitored.

[0134] Figure 5 is a schematic diagram of a file monitoring device according to an exemplary embodiment, the device is applied to a user terminal, such as Figure 5 As shown, the file monitoring device 500 includes:

[0135] The first receiving module 501 is configured to receive a file monitoring instruction sent by a server, where the file monitoring instruction includes a folder identifier to be monitored, where the folder identifier to be monitored is an identifier of a data storage folder corresponding to a business scenario;

[0136] A first determining module 502 is configured to determine at least one file to be monitored in the folder to be monitored corresponding to the folder to be monitored identifier;

[0137] The second determination module 503 is configured to determine that the file to be monitored is a target file when a data write operation to the file to be monitored is detected, and determine the file status information of the target file

[0138] The first sending module 504 is configured to send the file status information of the target file to the server, so that when the server determines that the target folder meets the preset abnormal condition based on the file status information, it determines that the data writing abnormality of the user terminal in the business scenario associated with the target folder is determined, and the target folder is the folder to be monitored containing the target file.

[0139] Optionally, the file status information includes the data write increment of the target file, such as Figure 5 As shown, the file monitoring device 500 further includes a third determining module 505, which is configured to:

[0140] Determining a first data volume of a file to be monitored;

[0141] The second determining module 503 is configured to:

[0142] A second data volume of the target file is determined, and a write data increment of the target file is determined according to the first data volume and the second data volume of the target file.

[0143] Optionally, the file status information includes a data writing frequency of the target file, and the second determining module 503 is configured to:

[0144] The data writing frequency of the target file is determined according to the frequency of data writing operations on the target file within a preset time period.

[0145] Optionally, the first determining module 502 is configured to:

[0146] determining the file type of each file to be processed contained in the folder to be monitored;

[0147] If it is determined that the file to be processed is a file-type file to be processed, then the file to be processed is determined to be a file to be monitored;

[0148] If it is determined that the to-be-processed file is a folder-type to-be-processed file, the to-be-processed folder is determined to be a to-be-monitored folder, and the above process is continued until all the file-type to-be-processed files in the to-be-monitored files are determined, and at least one to-be-monitored file in the to-be-monitored folder is obtained.

[0149] Figure 6 is a structural diagram of a file monitoring device according to an exemplary embodiment, a file monitoring device, the device is applied to a server, such as Figure 6 As shown, the file monitoring device 600 includes:

[0150] The information configuration module 601 is configured to obtain configuration information in response to a configuration operation of a folder to be monitored, wherein the configuration information includes device information and an identifier of the folder to be monitored, and the identifier of the folder to be monitored is an identifier of a data storage folder corresponding to a business scenario;

[0151] The second sending module 602 is configured to send a file monitoring instruction including a to-be-monitored folder identifier to the user terminal corresponding to the device information, so that the user terminal determines at least one to-be-monitored file in the to-be-monitored folder corresponding to the to-be-monitored folder identifier, and when a data write operation for the to-be-monitored file is detected, determines that the to-be-monitored file is a target file, and sends file status information of the target file to the server;

[0152] The second receiving module 603 is configured to receive file status information sent by the user terminal, and when it is determined based on the file status information that the target folder meets the preset abnormal condition, determine that the data writing of the user terminal in the business scenario associated with the target folder is abnormal, and the target folder is the folder to be monitored containing the target file.

[0153] Optionally, the file status information includes a write data increment of the target file, and the second receiving module 603 is configured to:

[0154] If it is determined that the write data increment is greater than or equal to the preset write data increment threshold, it is determined that the target folder meets the preset abnormal condition.

[0155] Optionally, the file status information includes a data writing frequency of the target file, and the second receiving module 603 is configured to:

[0156] If it is determined that the data writing frequency is greater than or equal to the preset data writing frequency threshold, it is determined that the target folder meets the preset abnormal condition.

[0157] The exemplary embodiment of the present disclosure also provides an electronic device, which may be a user terminal or a server. Figure 7 The electronic device is described. It should be understood that the following reference Figure 7 The electronic device is described. It should be understood that Figure 7 The electronic device 700 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0158] like Figure 7 As shown, the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 may include but are not limited to: at least one processing unit 710, at least one storage unit 720, and a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710).

[0159] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 performs the steps of various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 710 can perform the following steps: Figure 2 The method steps shown, etc.

[0160] The storage unit 720 may include a volatile storage unit, such as a random access storage unit (RAM) 721 and / or a cache storage unit 722 , and may further include a read-only storage unit (ROM) 723 .

[0161] The storage unit 720 may also include a program / utility 724 having a set (at least one) of program modules 725, such program modules 725 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0162] The bus 730 may include a data bus, an address bus, and a control bus.

[0163] The electronic device 700 may also communicate with one or more external devices 800 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), and such communication may be performed via an input / output (I / O) interface 740. The electronic device 700 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 750. As shown, the network adapter 750 communicates with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0164] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0165] It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or implementations combining hardware and software aspects, which may be collectively referred to herein as "circuit", "module" or "system". Those skilled in the art will readily think of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses or adaptive changes of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and implementation are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

[0166] In addition, the present disclosure also provides a computer-readable storage medium. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute the file monitoring method provided in the above embodiment.

[0167] In addition, the present disclosure also provides a computer program product, including computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the file monitoring method provided in the above embodiment.

[0168] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0169] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

Claims

1. A file monitoring method, characterized in that: The method is applied to a user terminal, comprising: Receive a file monitoring instruction sent by a server, wherein the file monitoring instruction includes a folder identifier to be monitored, and the folder identifier to be monitored is an identifier of a data storage folder corresponding to a business scenario; Determine at least one file to be monitored in the folder to be monitored corresponding to the folder to be monitored identifier; When a data writing operation for the file to be monitored is detected, determining the file to be monitored as a target file, and determining file status information of the target file; The file status information of the target file is sent to the server, so that when the server determines that the target folder meets the preset abnormal condition based on the file status information, it determines that the data writing abnormality of the user terminal in the business scenario associated with the target folder is abnormal, and the target folder is the folder to be monitored that contains the target file.

2. The file monitoring method according to claim 1, characterized in that: The file status information includes a data write increment of the target file. After determining at least one file to be monitored in the folder to be monitored, the method further includes: Determining a first data volume of the file to be monitored; The determining of the file status information of the target file includes: A second data volume of the target file is determined, and a write data increment of the target file is determined according to the first data volume and the second data volume of the target file.

3. The file monitoring method according to claim 1, characterized in that: The file status information includes a data writing frequency of the target file, and determining the file status information of the target file includes: The data writing frequency of the target file is determined according to the frequency of data writing operations on the target file within a preset time period.

4. The file monitoring method according to claim 1, characterized in that: The step of determining at least one file to be monitored in the folder to be monitored corresponding to the folder to be monitored identifier comprises: Determine the file type of each to-be-processed file contained in the to-be-monitored folder; If it is determined that the to-be-processed file is a file-type to-be-processed file, then determining that the to-be-processed file is the to-be-monitored file; If it is determined that the to-be-processed file is a folder-type to-be-processed file, then the to-be-processed folder is determined to be a to-be-monitored folder, and the above process is continued until all file-type to-be-processed files in the to-be-monitored files are determined, and at least one to-be-monitored file in the to-be-monitored folder is obtained.

5. A file monitoring method, characterized in that: The method is applied to a server and comprises: In response to a configuration operation of a folder to be monitored, configuration information is acquired, the configuration information including device information and an identifier of the folder to be monitored, the identifier of the folder to be monitored being an identifier of a data storage folder corresponding to the business scenario; Sending a file monitoring instruction including the to-be-monitored folder identifier to a user terminal corresponding to the device information, so that the user terminal determines at least one to-be-monitored file in the to-be-monitored folder corresponding to the to-be-monitored folder identifier, and when a data writing operation for the to-be-monitored file is detected, determining that the to-be-monitored file is a target file, and sending file status information of the target file to the server; Receive file status information sent by the user terminal, and when determining that a target folder meets a preset abnormal condition based on the file status information, determine that data writing of the user terminal in the business scenario associated with the target folder is abnormal, and the target folder is the folder to be monitored that contains the target file.

6. The file monitoring method according to claim 5, characterized in that: The file status information includes a write data increment of the target file, and determining that the target folder meets a preset abnormal condition according to the file status information includes: If it is determined that the write data increment is greater than or equal to a preset write data increment threshold, it is determined that the target folder meets a preset abnormal condition.

7. The file monitoring method according to claim 5, characterized in that: The file status information includes a data writing frequency of the target file, and determining that the target folder meets a preset abnormal condition according to the file status information includes: If it is determined that the data writing frequency is greater than or equal to a preset data writing frequency threshold, it is determined that the target folder meets a preset abnormal condition.

8. A file monitoring device, characterized in that: The device is applied to a user terminal and includes: A first receiving module is configured to receive a file monitoring instruction sent by a server, wherein the file monitoring instruction includes a folder identifier to be monitored, and the folder identifier to be monitored is an identifier of a data storage folder corresponding to a business scenario; A first determining module is configured to determine at least one file to be monitored in the folder to be monitored corresponding to the identifier of the folder to be monitored; The second determination module is configured to determine that the file to be monitored is a target file when a data write operation to the file to be monitored is detected, and to determine the file status information of the target file The first sending module is configured to send the file status information of the target file to the server, so that when the server determines that the target folder meets the preset abnormal condition based on the file status information, it determines that the data writing abnormality of the user terminal in the business scenario associated with the target folder is abnormal, and the target folder is the folder to be monitored that contains the target file.

9. The file monitoring device according to claim 8, characterized in that: The file status information includes a data write increment of the target file, and the device further includes a third determination module configured to: Determining a first data volume of the file to be monitored; The second determining module is configured to: A second data volume of the target file is determined, and a write data increment of the target file is determined according to the first data volume and the second data volume of the target file.

10. The file monitoring device according to claim 8, characterized in that: The file status information includes a data writing frequency of the target file, and the second determining module is configured to: The data writing frequency of the target file is determined according to the frequency of data writing operations on the target file within a preset time period.

11. The file monitoring device according to claim 8, characterized in that: The first determining module is configured to: Determine the file type of each to-be-processed file contained in the to-be-monitored folder; If it is determined that the to-be-processed file is a file-type to-be-processed file, then determining that the to-be-processed file is the to-be-monitored file; If it is determined that the to-be-processed file is a folder-type to-be-processed file, then the to-be-processed folder is determined to be a to-be-monitored folder, and the above process is continued until all file-type to-be-processed files in the to-be-monitored files are determined, and at least one to-be-monitored file in the to-be-monitored folder is obtained.

12. A file monitoring device, characterized in that: The device is applied to a server and includes: An information configuration module, configured to obtain configuration information in response to a configuration operation of a folder to be monitored, wherein the configuration information includes device information and an identifier of the folder to be monitored, wherein the identifier of the folder to be monitored is an identifier of a data storage folder corresponding to a business scenario; A second sending module is configured to send a file monitoring instruction including the to-be-monitored folder identifier to a user terminal corresponding to the device information, so that the user terminal determines at least one to-be-monitored file in the to-be-monitored folder corresponding to the to-be-monitored folder identifier, and when a data writing operation for the to-be-monitored file is detected, determines that the to-be-monitored file is a target file, and sends file status information of the target file to the server; The second receiving module is configured to receive file status information sent by the user terminal, and when it is determined according to the file status information that the target folder meets the preset abnormal condition, determine that the data writing abnormality of the user terminal in the business scenario associated with the target folder is present, and the target folder is the folder to be monitored that contains the target file.

13. The file monitoring device according to claim 12, characterized in that: The file status information includes the write data increment of the target file, and the second receiving module is configured to: If it is determined that the write data increment is greater than or equal to a preset write data increment threshold, it is determined that the target folder meets a preset abnormal condition.

14. The file monitoring device according to claim 12, characterized in that: The file status information includes a data writing frequency of the target file, and the second receiving module is configured to: If it is determined that the data writing frequency is greater than or equal to a preset data writing frequency threshold, it is determined that the target folder meets a preset abnormal condition.

15. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the file monitoring method as described in any one of claims 1 to 4 or claims 5 to 7.

16. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the file monitoring method as claimed in any one of claims 1 to 4 or claims 5 to 7.

17. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the file monitoring method according to any one of claims 1 to 4 or claims 5 to 7 is implemented.

Citation Information

Patent Citations

  • File access control method and system

    CN113672966A

  • Document management systems and methods

    US20140101212A1