Large folder detail statistical method and device, electronic equipment and medium

By using distributed cache system and asynchronous event mechanism in the large folder details statistics method, the problems of slow statistics speed of large folders and degraded system performance in traditional methods are solved, and rapid update and optimized data management and user experience are achieved.

CN119493775APending Publication Date: 2025-02-21E-SURFING DIGITAL LIFE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411560711.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

Traditional methods are slow when calculating large folders, resulting in system performance degradation and prone to resource bottlenecks.

Method used

Through the first service, the updated folder information table is cached to the distributed cache system, and a folder details update event is generated. Through the second service, the update event is received asynchronously and the information table is obtained from the cache system, and the folder details in the database are updated. data.

Benefits of technology

It realizes rapid update of large folder details data, optimizes data management and system performance, and significantly improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119493775A_ABST
    Figure CN119493775A_ABST
Patent Text Reader

Abstract

The invention discloses a large folder detail statistical method and device, electronic equipment and a medium, and the method comprises the steps: when monitoring that a target folder changes, caching an updated folder information table to a distributed cache system through a first service, and generating a folder detail update event; and asynchronously receiving a folder detail update event through the second service, obtaining the folder information table from the distributed cache system, and further updating folder detail data of the target folder in the database according to the folder information table. According to the method, the user can quickly obtain the detail data of the large folder, the data management, system maintenance and storage efficiency is optimized, the system performance is improved, the user experience is also remarkably improved, and the method can be widely applied to the technical field of information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information technology, and in particular to a method, device, electronic equipment and medium for counting details of a large folder. Background Art

[0002] In today's data-driven world, as the amount of data continues to increase, the number of files and folders has also surged, and small folders have gradually turned into large folders. Large folders usually contain a large number of files and subfolders. Traditional methods may become extremely slow when counting these folders, and even have a negative impact on system performance. Traditional tools are prone to bottlenecks or excessive resource consumption when processing big data, so it is particularly important to develop efficient statistical methods. Efficiently counting detailed information of large folders has become a key task in many workflows, and this problem needs to be solved urgently to improve efficiency and system performance.

[0003] Terminology explanation:

[0004] Statistics: refers to the process of collecting, organizing, analyzing and interpreting data. In the present invention, "statistics" refers to the operation of calculating and summarizing the data in a large folder (such as the size and number of files and subfolders).

[0005] Large folders: refers to folders that contain a large number of files and subfolders. Such folders are usually large in size, contain a large amount of data and multiple levels, so it takes a long time to count and may require special processing methods.

[0006] Details: refers to the specific situation or detailed information of a thing. In the present invention, "details" refers to specific information about a large folder, such as the total size of the folder, the internal structure, the size of each subfolder and file, etc. Summary of the invention

[0007] The purpose of the present invention is to solve one of the technical problems existing in the prior art to at least a certain extent.

[0008] To this end, an object of an embodiment of the present invention is to provide a method for statistics of large folder details, which enables users to quickly obtain detailed data of large folders, optimizes data management, system maintenance and storage efficiency, improves system performance, and significantly improves user experience.

[0009] Another object of an embodiment of the present invention is to provide a device for collecting statistics on the details of a large folder.

[0010] In order to achieve the above technical objectives, the technical solutions adopted by the embodiments of the present invention include:

[0011] On the one hand, an embodiment of the present invention provides a method for collecting details of a large folder, comprising the following steps:

[0012] When a change in the target folder is detected, the updated folder information table is cached to the distributed cache system through the first service, and a folder details update event is generated;

[0013] The folder details update event is asynchronously received through the second service, and the folder information table is obtained from the distributed cache system, and then the folder details data of the target folder in the database is updated according to the folder information table.

[0014] Further, in one embodiment of the present invention, caching the updated folder information table to the distributed cache system through the first service specifically includes:

[0015] Obtaining, through the first service, the folder ID, current folder size, parent directory ID, and current number of files of the target folder after the change;

[0016] Obtaining the corresponding folder information table from the distributed cache system or the database according to the folder ID, and modifying the folder information table according to the current folder size, the parent directory ID, and the current number of files to obtain an updated folder information table;

[0017] The updated folder information table is cached to the distributed cache system according to a preset cache strategy.

[0018] Further, in one embodiment of the present invention, the obtaining the corresponding folder information table from the distributed cache system or the database according to the folder ID specifically includes:

[0019] Performing query matching in the distributed cache system according to the folder ID;

[0020] When the query matches successfully, the corresponding folder information table is obtained from the distributed cache system;

[0021] When the query match is unsuccessful, the corresponding folder detail data is obtained from the database according to the folder ID, and the folder information table is generated according to the folder detail data.

[0022] Further, in an embodiment of the present invention, caching the updated folder information table to the distributed cache system according to a preset cache strategy specifically includes:

[0023] Determine the data type of the target folder according to the modification frequency of the folder information table;

[0024] Determine a corresponding cache expiration time according to the data type, and then cache the updated folder information table to the distributed cache system according to the cache expiration time;

[0025] The data types include hotspot data and non-hotspot data.

[0026] Furthermore, in one embodiment of the present invention, the generating of the folder details update event specifically includes:

[0027] Generate the corresponding folder details update event according to the folder ID;

[0028] The folder details update event is added to a preset first message queue.

[0029] Further, in an embodiment of the present invention, the asynchronously receiving the folder details update event through the second service and obtaining the folder information table from the distributed cache system specifically includes:

[0030] Asynchronously receiving the folder details update event based on the first message queue through the second service, and obtaining the corresponding folder ID;

[0031] The corresponding folder information table is obtained from the distributed cache system according to the folder ID.

[0032] Further, in one embodiment of the present invention, updating the folder details data of the target folder in the database according to the folder information table specifically includes:

[0033] Acquire the corresponding folder detail data from the database according to the folder ID;

[0034] Determine the current folder size, the parent directory ID and the current file quantity according to the folder information table;

[0035] The folder details data is updated according to the current folder size, the parent directory ID, and the current number of files.

[0036] On the other hand, an embodiment of the present invention provides a device for collecting statistics of details of a large folder, including:

[0037] An information table cache module is used to cache the updated folder information table to the distributed cache system through the first service when a change in the target folder is detected, and generate a folder details update event;

[0038] The folder details update module is used to asynchronously receive the folder details update event through the second service, obtain the folder information table from the distributed cache system, and then update the folder details data of the target folder in the database according to the folder information table.

[0039] On the other hand, an embodiment of the present invention provides an electronic device, comprising a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein the program, when executed by the processor, realizes the large folder detail statistics method as described above.

[0040] On the other hand, an embodiment of the present invention further provides a storage medium, which is a computer-readable storage medium used for computer-readable storage, and the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the large folder detail statistics method as described above.

[0041] The advantages and beneficial effects of the present invention will be partly given in the following description, partly become apparent from the following description, or be understood through the practice of the present invention:

[0042] The embodiment of the present invention obtains when a change in a target folder is monitored, caches the updated folder information table to the distributed cache system through the first service, generates a folder details update event, asynchronously receives the folder details update event through the second service, obtains the folder information table from the distributed cache system, and then updates the folder details data of the target folder in the database according to the folder information table. The embodiment of the present invention first caches the updated folder information table to the distributed cache system through the first service, then notifies the second service for subsequent processing through the folder details update event, asynchronously receives the folder details update event through the second service, and updates the folder details data of the corresponding folder in the database according to the cached folder information table, uses the distributed cache system to achieve efficient update of folder details, and uses the asynchronous event mechanism to share the computing pressure and database update burden, thereby improving the response speed and performance of the system, enabling users to quickly obtain the details data of large folders, optimizing data management, system maintenance and storage efficiency, and significantly improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solution in the embodiments of the present invention, the following introduction is made to the drawings required for use in the embodiments of the present invention. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solution of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0044] Figure 1 A flowchart of a method for counting details of a large folder provided by an embodiment of the present invention;

[0045] Figure 2 A schematic diagram of an implementation architecture of a large folder details statistics method provided by an embodiment of the present invention;

[0046] Figure 3 A step flow chart of step S101 provided in an embodiment of the present invention;

[0047] Figure 4 A step flow chart of step S1012 provided in an embodiment of the present invention;

[0048] Figure 5 A step flow chart of step S1013 provided in an embodiment of the present invention;

[0049] Figure 6 Another step flow chart of step S101 provided in an embodiment of the present invention;

[0050] Figure 7 A step flow chart of step S102 provided in an embodiment of the present invention;

[0051] Figure 8 Another step flow chart of step S102 provided in an embodiment of the present invention

[0052] Fig. 9 A schematic diagram of the structure of a large folder details statistics device provided by an embodiment of the present invention;

[0053] Fig.10 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention;

[0054] Fig.11 A schematic diagram of the structure of a storage medium provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0055] Embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limitations on the present application. It should be noted that, although the functional module division is performed in the system schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in a different order from the module division in the system schematic diagram or the flow chart. For the step numbers in the following embodiments, they are only set for the convenience of explanation, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.

[0056] In the description of the present invention, the meaning of "a plurality" is two or more. If there is a description of the first or the second, it is only for the purpose of distinguishing the technical features, and it cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features. In addition, unless otherwise defined, all technical and scientific terms used in this document have the same meaning as those commonly understood by technicians in the technical field of this application. The terms used in this document are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0057] The large folder details statistics method provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a set-top box, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the large folder details statistics method, etc., but is not limited to the above forms.

[0058] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0059] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.

[0060] like Figure 1 FIG. 1 is a flowchart of a method for counting details of a large folder provided by an embodiment of the present invention. Figure 1 The embodiment of the present invention provides a method for counting details of a large folder, which specifically includes the following steps:

[0061] S101, when a change in a target folder is detected, the updated folder information table is cached to a distributed cache system through a first service, and a folder details update event is generated;

[0062] S102: asynchronously receive a folder details update event through a second service, obtain a folder information table from a distributed cache system, and then update the folder details data of the target folder in the database according to the folder information table.

[0063] Specifically, the present invention can be applied to cloud disk services, operating systems, and other business scenarios that require processing and statistics of large folders, including file storage and management platforms, enterprise-level data management systems, system backup and recovery solutions, and any applications and services involving statistics of a large number of folders and their detailed information. The present invention can significantly improve processing efficiency and system performance in these environments and meet statistical needs in different scenarios.

[0064] like Figure 2 The figure shows a schematic diagram of the implementation architecture of the large folder details statistics method provided by an embodiment of the present invention. When a folder changes, the present invention first caches the updated folder information table in the distributed cache system through the first service, and then notifies the second service for subsequent processing through the folder details update event, asynchronously receives the folder details update event through the second service, and updates the folder details data of the corresponding folder in the database according to the cached folder information table. The distributed cache system is used to implement efficient update of folder details, and the asynchronous event mechanism is used to share the computing pressure and database update burden, thereby improving the response speed and performance of the system, enabling users to quickly obtain the details data of large folders, optimizing data management, system maintenance and storage efficiency, and significantly improving user experience.

[0065] like Figure 3 FIG. 1 is a flowchart of step S101 provided in an embodiment of the present invention, referring to FIG. Figure 3 As an optional implementation, caching the updated folder information table to the distributed cache system through the first service specifically includes:

[0066] S1011, obtaining the folder ID, current folder size, parent directory ID, and current number of files of the changed target folder through the first service;

[0067] S1012, obtaining a corresponding folder information table from a distributed cache system or database according to the folder ID, and modifying the folder information table according to the current folder size, the parent directory ID, and the current number of files to obtain an updated folder information table;

[0068] S1013. Cache the updated folder information table to the distributed cache system according to a preset cache strategy.

[0069] Specifically, the embodiment of the present invention creates a table specifically for storing folder information. The table does not store actual file data, but only records metadata related to the folder. This table contains key fields, such as:

[0070] Current folder size: only records the total size of the first-level subdirectory files in the current folder;

[0071] Parent directory ID: identifies the parent directory where the current folder is located;

[0072] Current File Count: Counts the total number of files in the current folder and all its direct subdirectories.

[0073] Each folder record only reflects the size and number of files contained in its direct subdirectories. In this way, each folder record provides detailed information about its direct subdirectories, without including further subdirectories or files. With this design, when counting the information of the upper folder, by recursively traversing and collecting information about each folder and its contents, the data of all direct subdirectories can be accumulated to calculate the total size and number of files of the upper folder.

[0074] Compared with traditional file tables, which store data of both folders and files, query operations need to traverse all file and folder records. This design not only increases the complexity and computational burden of queries, but also leads to higher database connection time and data processing delays. By separating the records of folders and files and focusing on statistics of direct subdirectories, this optimization significantly reduces the amount of data that needs to be traversed during queries, reduces the number of loops, and thus reduces database connection time. This method improves the query efficiency of the system and greatly improves the query speed of large folders.

[0075] In addition, the table is designed to support efficient data updates and maintenance. When the folder structure changes, such as adding or deleting a subdirectory, the system only needs to update the records of the relevant folders without a comprehensive scan of the entire file table. This optimization greatly improves the flexibility and responsiveness of data processing and demonstrates higher performance when processing large-scale data.

[0076] like Figure 4 FIG. 1 is a flow chart of step S1012 provided in an embodiment of the present invention, referring to FIG. Figure 4 As an optional implementation, obtaining a corresponding folder information table from a distributed cache system or database according to the folder ID specifically includes:

[0077] S10121. Perform query matching in the distributed cache system according to the folder ID;

[0078] S10122. When the query matches successfully, obtain the corresponding folder information table from the distributed cache system;

[0079] S10123. When the query match is unsuccessful, the corresponding folder detail data is obtained from the database according to the folder ID, and a folder information table is generated according to the folder detail data.

[0080] like Figure 5FIG. 1 is a flow chart of step S1013 provided in an embodiment of the present invention, referring to FIG. Figure 5 As an optional implementation, the updated folder information table is cached to the distributed cache system according to a preset cache strategy, which specifically includes:

[0081] S10131, determining the data type of the target folder according to the modification frequency of the folder information table;

[0082] S10132, determining a corresponding cache expiration time according to the data type, and then caching the updated folder information table to the distributed cache system according to the cache expiration time;

[0083] The data types include hotspot data and non-hotspot data.

[0084] Specifically, the embodiments of the present invention improve the immediacy and consistency of data through a distributed cache system. When the system processes data changes, it gives priority to updating the cache layer instead of directly operating the database. In order to optimize cache performance and resource utilization, the cache system divides data into two categories: hot data and ordinary data (non-hot data).

[0085] Hot data: refers to data with high access frequency and frequent changes. For this data, the cache system sets a longer cache expiration time to reduce the performance overhead caused by frequent database access and cache invalidation. By extending the cache expiration time of hot data, the system can handle a large number of concurrent requests more efficiently and ensure fast access to data.

[0086] Ordinary data: refers to data with relatively low access frequency. For this type of data, the cache system sets a shorter cache expiration time so that it can be updated and released in time. This can avoid taking up too much cache space and keep the cache system running efficiently.

[0087] The expiration time of the cache is set to be dynamically adjusted to adapt to the access patterns of different data. The expiration time of hot data is longer to adapt to its high-frequency access needs, while the expiration time of ordinary data is shorter to ensure the efficiency of the cache and the rational use of resources.

[0088] When data changes, the system first writes the change information to the cache and applies the corresponding expiration policy based on the data category. After the data changes, the cache is updated immediately, while the actual update of the database is handled asynchronously by the background process. This ensures that users get the latest data when accessing the cache, while reducing direct pressure on the database.

[0089] like Figure 6 FIG. 1 is another step flow chart of step S101 provided in an embodiment of the present invention, referring to FIG. Figure 6As an optional implementation, a folder details update event is generated, which specifically includes:

[0090] S1014, generating a corresponding folder details update event according to the folder ID;

[0091] S1015: Add the folder details update event to a preset first message queue.

[0092] like Figure 7 FIG. 1 is a flow chart of step S102 provided in an embodiment of the present invention, referring to FIG. Figure 7 As an optional implementation, the folder details update event is asynchronously received through the second service, and the folder information table is obtained from the distributed cache system, which specifically includes:

[0093] S1021. Asynchronously receiving a folder details update event based on the first message queue through the second service, and obtaining a corresponding folder ID;

[0094] S1022. Obtain a corresponding folder information table from the distributed cache system according to the folder ID.

[0095] like Figure 8 FIG. 1 is another step flow chart of step S102 provided in an embodiment of the present invention, referring to FIG. Figure 8 As an optional implementation, updating the folder details data of the target folder in the database according to the folder information table specifically includes:

[0096] S1023, obtaining corresponding folder details data from the database according to the folder ID;

[0097] S1024, determining the current folder size, parent directory ID, and current file quantity according to the folder information table;

[0098] S1025. Update folder detail data according to the current folder size, parent directory ID, and current number of files.

[0099] The implementation process of the present invention is further described below in conjunction with a specific embodiment.

[0100] In the cloud disk project, in order to improve the speed and efficiency of users viewing the details of large folders, the method of the embodiment of the present invention is introduced to realize the detailed information display of large folders to accelerate the user experience. The specific process is as follows:

[0101] 1) User edits folder:

[0102] When a user edits a file in a folder, they first request to save the changes through the interface. At this point, the system enters the processing flow.

[0103] 2) Cache data processing:

[0104] Get cached data: When processing a user request, the system first gets the data of the current folder from the cache. To ensure data consistency and prevent data problems caused by concurrent operations, the relevant data will be locked when getting the cache.

[0105] Cache preheating: Before the user requests, the system can preload the cache based on the folder access frequency and user habits to reduce the delay during the first access.

[0106] Adjust data size: After obtaining the cached data, the system will adjust the folder size information accordingly based on the user's editing operations.

[0107] Update cache: After the adjustment is completed, the system will write the updated data back to the cache and release the previously added lock after the update is completed. This ensures that the data in the cache is up to date and will not be interfered with by other operations during the update process.

[0108] Delayed write: For data that does not need to be reflected immediately, a delayed write strategy can be adopted to process update operations in batches to improve overall system efficiency.

[0109] 3) Trigger event drive:

[0110] Event notification: After the cache update is completed, the first service will trigger the event-driven mechanism to notify the second service for subsequent processing.

[0111] Database modification operation: The second service will listen to the event and perform database update operations based on the event content. This step ensures that the data in the database is consistent with the data in the cache, and supports data persistence and backup.

[0112] 4) Incremental scanning: Implement an incremental scanning mechanism to scan only the changed parts of the file to reduce duplication of work. Use file system event notifications (such as inotify on Linux) to update file data in real time.

[0113] Through this process, we can ensure that users can quickly obtain the latest information when viewing the details of a large folder, and that the system's cache and database data remain synchronized, thereby improving overall performance and user experience.

[0114] 5) Statistics: Summarize the file size in each folder, calculate the total number of files, total file size and other data details, and use the distributed computing framework, multi-threading or multi-process technology to split the statistical calculation task into multiple parallel tasks to improve computing efficiency.

[0115] The above is an explanation of the method steps of the embodiment of the present invention. It can be recognized that the embodiment of the present invention first caches the updated folder information table into the distributed cache system through the first service, then notifies the second service for subsequent processing through the folder details update event, asynchronously receives the folder details update event through the second service, and updates the folder details data of the corresponding folder in the database according to the cached folder information table, and uses the distributed cache system to achieve efficient update of folder details, and uses the asynchronous event mechanism to share the computing pressure and database update burden, thereby improving the response speed and performance of the system, enabling users to quickly obtain the details data of large folders, optimizing data management, system maintenance and storage efficiency, and significantly improving user experience.

[0116] Compared with the prior art, the embodiments of the present invention also have the following advantages:

[0117] 1) Recursive hierarchical analysis: Folders are analyzed by recursive hierarchical method. First, the main folders are classified, and then each subfolder is further counted. This hierarchical technology significantly simplifies the processing process and reduces processing complexity.

[0118] 2) Parallel processing mechanism: By using parallel processing technology, the folder is split into multiple subtasks for parallel execution, thereby making full use of the computing power of multi-core processors and significantly speeding up the statistical process.

[0119] 3) Incremental update algorithm: The incremental update algorithm of the present invention only counts the changed parts in the folder, rather than scanning the entire folder each time, which greatly reduces computing resources and time consumption.

[0120] 4) Intelligent caching mechanism: Combined with intelligent caching technology, intermediate results and folder status are stored to avoid repeated calculations and improve the overall efficiency of the statistical process.

[0121] 5) Dynamic resource adjustment: Automatically adjust computing resources based on real-time load conditions to ensure efficient performance when processing folders of different sizes.

[0122] like Fig. 9 FIG. 1 is a schematic diagram of a large folder details statistics device provided by an embodiment of the present invention, referring to FIG. Fig. 9 The embodiment of the present invention provides a large folder details statistics device, including:

[0123] An information table cache module is used to cache the updated folder information table to the distributed cache system through the first service when a change in the target folder is detected, and generate a folder details update event;

[0124] The folder details update module is used to asynchronously receive the folder details update event through the second service, and obtain the folder information table from the distributed cache system, and then update the folder details data of the target folder in the database according to the folder information table.

[0125] The contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0126] The embodiment of the present invention further provides an electronic device, the electronic device comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein the program is executed by the processor to realize the above-mentioned large folder detail statistics method. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.

[0127] like Fig.10 FIG. 1 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention, referring to FIG. Fig.10 , an embodiment of the present invention provides an electronic device, including:

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

[0129] The memory 1002 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM). The memory 1002 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1002, and the processor 1001 calls and executes the large folder details statistics method of the embodiment of the present invention;

[0130] Input / output interface 1003, used to implement information input and output;

[0131] The communication interface 1004 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);

[0132] A bus 1005 , which transmits information between various components of the device (e.g., the processor 1001 , the memory 1002 , the input / output interface 1003 , and the communication interface 1004 );

[0133] The processor 1001 , the memory 1002 , the input / output interface 1003 and the communication interface 1004 are connected to each other in communication within the device via the bus 1005 .

[0134] like Fig.11 FIG. 1 is a schematic diagram of a storage medium according to an embodiment of the present invention. Fig.11 The embodiment of the present invention further provides a storage medium, which is a computer-readable storage medium used for computer-readable storage. The storage medium stores one or more programs 1101, and the one or more programs 1101 can be executed by one or more processors to implement the above-mentioned large folder detail statistics method.

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

[0136] The embodiment of the present invention also discloses a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes Figure 1 The method shown.

[0137] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the above-mentioned boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.

[0138] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified to the contrary, one or more of the above-mentioned functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.

[0139] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the above methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0140] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0141] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the above-mentioned program is printed, since the above-mentioned program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or processing in other suitable ways as necessary, and then stored in a computer memory.

[0142] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0143] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0144] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

[0145] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.

Claims

1. A method for collecting statistics on large folder details, characterized in that: The following steps are involved: When a change in the target folder is detected, the updated folder information table is cached to the distributed cache system through the first service, and a folder details update event is generated; The folder details update event is asynchronously received through the second service, and the folder information table is obtained from the distributed cache system, and then the folder details data of the target folder in the database is updated according to the folder information table.

2. A method for counting details of a large folder according to claim 1, characterized in that: The step of caching the updated folder information table to the distributed cache system through the first service specifically includes: Obtaining, through the first service, the folder ID, current folder size, parent directory ID, and current number of files of the target folder after the change; Obtaining the corresponding folder information table from the distributed cache system or the database according to the folder ID, and modifying the folder information table according to the current folder size, the parent directory ID, and the current number of files to obtain an updated folder information table; The updated folder information table is cached to the distributed cache system according to a preset cache strategy.

3. A method for counting details of a large folder according to claim 2, characterized in that: The step of obtaining the corresponding folder information table from the distributed cache system or the database according to the folder ID specifically includes: Performing query matching in the distributed cache system according to the folder ID; When the query matches successfully, the corresponding folder information table is obtained from the distributed cache system; When the query match is unsuccessful, the corresponding folder detail data is obtained from the database according to the folder ID, and the folder information table is generated according to the folder detail data.

4. A method for counting details of a large folder according to claim 2, characterized in that: The step of caching the updated folder information table to the distributed cache system according to a preset cache strategy specifically includes: Determine the data type of the target folder according to the modification frequency of the folder information table; Determine a corresponding cache expiration time according to the data type, and then cache the updated folder information table to the distributed cache system according to the cache expiration time; The data types include hotspot data and non-hotspot data.

5. A method for counting details of a large folder according to claim 2, characterized in that: The generating of the folder details update event specifically includes: Generate the corresponding folder details update event according to the folder ID; The folder details update event is added to a preset first message queue.

6. A method for counting details of a large folder according to claim 5, characterized in that: The step of asynchronously receiving the folder details update event through the second service and acquiring the folder information table from the distributed cache system specifically includes: Asynchronously receiving the folder details update event based on the first message queue through the second service, and obtaining the corresponding folder ID; The corresponding folder information table is obtained from the distributed cache system according to the folder ID.

7. A method for counting large folder details according to claim 2, characterized in that: The updating of the folder details data of the target folder in the database according to the folder information table specifically includes: Acquire the corresponding folder detail data from the database according to the folder ID; Determine the current folder size, the parent directory ID and the current file quantity according to the folder information table; The folder details data is updated according to the current folder size, the parent directory ID, and the current number of files.

8. A device for collecting statistics on large folder details, characterized in that: include: An information table cache module is used to cache the updated folder information table to the distributed cache system through the first service when a change in the target folder is detected, and generate a folder details update event; The folder details update module is used to asynchronously receive the folder details update event through the second service, obtain the folder information table from the distributed cache system, and then update the folder details data of the target folder in the database according to the folder information table.

9. An electronic device, characterized in that: The electronic device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the large folder detail statistics method as described in any one of claims 1 to 7 are realized.

10. A storage medium, the storage medium being a computer-readable storage medium, used for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the large folder detail statistics method as described in any one of claims 1 to 7.