Method for updating resource data and electronic device
Patent Information
- Application Number
- CN202610877018.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-17
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2046-06-17
AI Technical Summary
[0004]本申请提供了一种资源数据的更新控制方法及电子设备,以至少解决相关技术中资源数据的更新时机灵活性差的问题
[0016]This application obtains a reference update time for the cache space and determines a target update time for the cache space based on historical access information prior to the reference update time. This allows the update timing of cached resource data to be correlated with the historical access history of that resource data. Since the target update time is before the target access time of the next access to the cached resource data, the cache space can complete the update before the next access to the resource data. Furthermore, at the target update time, the cached resource data is updated based on reference change information received within a first time interval. This ensures that reference change information received between the reference update time and the target update time, indicating changes in storage resources, can be used for resource data updates at the target update time, rather than triggering updates every time reference change information is received. In other words, the update timing of resource data is no longer solely determined by whether storage resources have changed, but can be determined by combining historical access history. This avoids the shortcomings of related technologies where frequent cache space updates due to storage resource changes occur even when resource data is not accessed, leading to ineffective resource occupation. This achieves the technical effect of improving the flexibility of resource data update timing.
Smart Images

Figure CN122432062B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of storage management software technology, and in particular to a method and electronic device for controlling the update of resource data. Background Technology
[0002] In related technologies, storage management software typically caches resource data in a cache space so that the corresponding resource data can be retrieved from the cache space when users access storage resource information. When storage resources change, the storage management software usually updates the corresponding resource data in the cache space according to the changes. However, during periods when resource data is not accessed by users or invoked by business applications, even if storage resources change and trigger cache updates, the updated resource data may not be read or used in a timely manner. This results in data acquisition, data processing, and data writing operations consuming system processing resources without generating corresponding access value, leading to wasted system processing resources and reduced cache management efficiency.
[0003] No effective solution has yet been proposed to address the technical issues, such as the lack of flexibility in updating resource data. Summary of the Invention
[0004] This application provides a method and electronic device for controlling the updating of resource data, so as to at least solve the problem of poor flexibility in the timing of resource data updates in related technologies.
[0005] This application provides a method for controlling the update of resource data, including:
[0006] Get the reference update time of the cache space, where the cache space caches the resource data of at least one storage resource, the resource data of at least one storage resource is used to display the resource attributes of at least one storage resource, and the reference update time is the time when the resource data cached in the cache space was last updated.
[0007] The target update time of the cache space is determined based on the historical access information of the cache space before the reference update time. The historical access information is used to indicate the historical access status of the resource data cached in the cache space. The target update time is before the target access time of the next access to the resource data cached in the cache space.
[0008] At the target update time, the resource data cached in the cache space is updated based on the reference change information received within the first time interval, wherein the reference change information is used to indicate the change status of at least one storage resource, and the first time interval is the time interval between the reference update time and the target update time.
[0009] This application also provides a resource data update control device, including:
[0010] The acquisition module is used to acquire the reference update time of the cache space. The cache space caches the resource data of at least one storage resource. The resource data of at least one storage resource is used to display the resource attributes of at least one storage resource. The reference update time is the time when the resource data cached in the cache space was last updated.
[0011] The determination module is used to determine the target update time of the cache space based on the historical access information of the cache space before the reference update time. The historical access information is used to indicate the historical access status of the resource data cached in the cache space, and the target update time is before the target access time of the next access to the resource data cached in the cache space.
[0012] The update module is used to update the resource data cached in the cache space at the target update time based on the reference change information received within the first time interval. The reference change information is used to indicate the change status of at least one storage resource, and the first time interval is the time interval between the reference update time and the target update time.
[0013] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the steps of any of the above-described resource data update control methods when executing the computer program.
[0014] This application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of any of the above-described resource data update control methods.
[0015] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described resource data update control methods.
[0016] This application obtains a reference update time for the cache space and determines a target update time for the cache space based on historical access information prior to the reference update time. This allows the update timing of cached resource data to be correlated with the historical access history of that resource data. Since the target update time is before the target access time of the next access to the cached resource data, the cache space can complete the update before the next access to the resource data. Furthermore, at the target update time, the cached resource data is updated based on reference change information received within a first time interval. This ensures that reference change information received between the reference update time and the target update time, indicating changes in storage resources, can be used for resource data updates at the target update time, rather than triggering updates every time reference change information is received. In other words, the update timing of resource data is no longer solely determined by whether storage resources have changed, but can be determined by combining historical access history. This avoids the shortcomings of related technologies where frequent cache space updates due to storage resource changes occur even when resource data is not accessed, leading to ineffective resource occupation. This achieves the technical effect of improving the flexibility of resource data update timing. Attached Figure Description
[0017] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a hardware structure block diagram of a computing device according to an embodiment of this application;
[0019] Figure 2 This is a flowchart of a resource data update control method according to an embodiment of this application;
[0020] Figure 3 This is a schematic diagram of a resource data update control system according to an embodiment of this application;
[0021] Figure 4 This is a schematic diagram of a resource change record processing flow according to an embodiment of this application;
[0022] Figure 5 This is a schematic diagram of a cached resource data update process according to an embodiment of this application;
[0023] Figure 6 This is a schematic diagram of a cached resource data access process according to an embodiment of this application;
[0024] Figure 7 This is a structural block diagram of a resource data update control device according to an embodiment of this application. Detailed Implementation
[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0026] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0027] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0028] The resource data update control method provided in this application embodiment can be executed in a server, storage array controller, management node, cloud platform node, edge computing node, or similar computing device with storage management software deployed, or it can be executed collaboratively by multiple devices. The following description uses running on a computing device as an example. Figure 1 This is a hardware structure block diagram of a computing device according to an embodiment of this application. Figure 1 As shown, the computing device may include at least one ( Figure 1 (Only one is shown) A processor 102, a memory 104 for storing data, a transmission device 106 for communication, and an input / output device 108. The processor 102 may include, but is not limited to, a central processing unit (CPU), a microprocessor (MCU), a field-programmable gate array (FPGA), or other processing devices capable of performing data processing operations. The memory 104 may be used to store computer programs, and the processor 102 can execute the resource data update control method in this embodiment by running the computer program stored in the memory 104. Those skilled in the art will understand that... Figure 1The structure shown is for illustrative purposes only and does not limit the structure of the computing device. For example, the computing device may also include components that are larger than... Figure 1 Showing more or fewer components, or having with Figure 1 The different configurations shown.
[0029] The memory 104 can be used to store computer programs, such as software programs and modules for storage management software, like the computer program corresponding to the resource data update control method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, thus implementing the methods described above. The memory 104 may include high-speed random access memory (RAM) and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may also include memories remotely located relative to the processor 102, which can be connected to a computing device via a network.
[0030] Transmission device 106 is used to receive or send data via a network. This network may include, but is not limited to, the Internet, corporate intranets, local area networks, storage area networks, mobile communication networks, and combinations thereof. In one example, transmission device 106 may be used to receive reference change information indicating changes in storage resources, or to interact with devices such as storage arrays, storage devices, resource management platforms, and user terminals. Input / output device 108 may be used to receive access requests input by a user, or to display to the user the resource attributes corresponding to resource data cached in the cache space.
[0031] This embodiment provides a method for controlling the update of resource data. Figure 2 This is a flowchart of a resource data update control method according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps:
[0032] Step S12: Obtain the reference update time of the cache space, wherein the cache space caches the resource data of at least one storage resource, the resource data of at least one storage resource is used to display the resource attributes of at least one storage resource, and the reference update time is the time when the resource data cached in the cache space was last updated.
[0033] Step S14: Determine the target update time of the cache space based on the historical access information of the cache space before the reference update time. The historical access information is used to indicate the historical access status of the resource data cached in the cache space. The target update time is before the target access time of the next access to the resource data cached in the cache space.
[0034] Step S16: At the target update time, update the resource data cached in the cache space according to the reference change information received within the first time interval, wherein the reference change information is used to indicate the change status of at least one storage resource, and the first time interval is the time interval between the reference update time and the target update time.
[0035] The following explanation uses the update control module running in the storage management software as an example. Figure 3 This is a schematic diagram of a resource data update control system according to an embodiment of this application. Figure 3 As shown, the resource data update control system may include an update control module and a cache space. The update control module may, but is not limited to, receive reference change information sent by the storage system or other monitoring modules through an underlying interface. The update control module may also determine the target update time of the cache space based on historical access information prior to the reference update time, and update the cached resource data in the cache space according to the reference change information at the target update time. The update control module may also obtain resource data of the storage resources included in the storage system through a command-line interface (CLI) or underlying services, and cache this resource data in the cache space. The cache space is used to cache the resource data of at least one storage resource.
[0036] Optionally, in this embodiment, storage resources may be, but are not limited to, resources such as volumes, storage pools, disks, ports, file systems, snapshot tasks, or remote replication tasks in a storage array. Resource data may be, but is not limited to, data used to describe the capacity, status, configuration, or operating status of storage resources. Resource attributes may include, but are not limited to, resource name, resource identifier, total capacity, used capacity, remaining capacity, health status, operating status, access status, configuration parameters, performance parameters, or alarm status. Cache space may be, but is not limited to, memory cache, disk cache, database cache, distributed cache, or a combination of the above caches used by storage management software to store resource data. When displaying storage resource information, the storage management software can read the corresponding resource data from the cache space and display the resource attributes of the storage resources based on the resource data.
[0037] In the embodiment provided in step S12 above, the reference update time is used to represent the time when the resource data cached in the cache space was last updated. It should be noted that the reference update time can be the time when all resource data in the cache space was last updated, or it can be the time when the resource data corresponding to a certain resource type in the cache space was last updated. For example, if the cache space caches the capacity data of volumes A, B, and C, and the capacity data of volumes A, B, and C was updated at 10:00, then 10:00 can be used as the reference update time for the cache space. As another example, if the cache space maintains volume resource data and storage pool resource data separately according to resource type, then the time when the volume resource data was last updated can be used as the reference update time for the corresponding volume resource data, and the time when the storage pool resource data was last updated can be used as the reference update time for the corresponding storage pool resource data.
[0038] Optionally, in this embodiment, the update control module may, but is not limited to, obtain the reference update time of the cache space by reading the update timestamp of the cache space, cache management records, resource data version records, or cache update logs, and determine the last update time position of the resource data currently stored in the cache space. The cache update log may, but is not limited to, be a log record generated each time the resource data in the cache space is updated.
[0039] In the embodiment provided in step S14 above, historical access information is used to indicate the historical access status of resource data cached in the cache space. Historical access information may include, but is not limited to, information such as the historical access time, number of historical accesses, and historical access frequency of the resource data before the reference update time. Historical access may include, but is not limited to, reading resource data when a user views storage resource information through storage management software, and may also include accessing resource data in the cache space by business modules, operation and maintenance modules, or monitoring modules.
[0040] Optionally, in this embodiment, the update control module may, but is not limited to, determine the target update time of the cache space in the following ways: based on the historical access information of the cache space before the reference update time, determine the access distribution of the resource data cached in the cache space within the historical time period; based on the access distribution, determine the target access time for the next access to the resource data cached in the cache space; and then determine the target update time from the time interval between the reference update time and the target access time. For example, if the historical access information indicates that the resource data in the cache space is usually accessed around 9:00 AM every day, then 9:00 AM can be determined as the target access time, and a certain time before 9:00 AM can be determined as the target update time. Thus, the resource data in the cache space can be updated before the next access, without needing to immediately update the resource data in the cache space every time a change in the storage resources is received.
[0041] It's important to note that while the target update time is prior to the target access time, this does not imply a fixed time interval between them. The target update time can be, but is not limited to, a preset duration preceding the target access time. It can also be a time determined based on resource data update time, the number of reference change messages, or the current processing capacity of the cache space. For example, when resource data updates typically require a preset duration (e.g., 30 seconds), the target update time can be set to the preset duration preceding the target access time or even earlier. Conversely, when there are many reference change messages or the resource data update takes a long time, the target update time can be set to an earlier time than the target access time to ensure that the resource data in the cache space is updated before the target access time.
[0042] In the embodiment provided in step S16 above, the reference change information may include, but is not limited to, information such as the resource identifier, resource type, or change time of the storage resource that has been changed. The first time interval is the time interval between the reference update time and the target update time. Therefore, the reference change information received within the first time interval refers to the information received after the resource data in the cache space was last updated and before the target update time, indicating that the storage resource has been changed.
[0043] Optionally, in this embodiment, updating the resource data cached in the cache space based on the reference change information received within the first time interval at the target update time may include, but is not limited to: determining at least one storage resource that has changed based on the reference change information received within the first time interval; obtaining the updated resource data corresponding to the at least one storage resource that has changed; and writing the updated resource data into the cache space to update the resource data cached in the cache space. For example, between the reference update time 10:00 and the target update time 10:30, if the update control module receives reference change information indicating a change in the capacity of volume A and reference change information indicating a change in the health status of volume B, then when 10:30 arrives, the update control module can obtain the updated capacity data of volume A and the updated health status data of volume B based on the aforementioned reference change information, and write the updated capacity data of volume A and the updated health status data of volume B into the cache space.
[0044] Optionally, in this embodiment, the reference change information can be sent to the update control module by the storage system, storage controller, storage resource management module, or monitoring module. The storage system, storage controller, storage resource management module, or monitoring module can be connected to the update control module through, but is not limited to, underlying interfaces. The cache space and the update control module can be deployed in the same storage management software, or they can be deployed on different devices or in different processes, and interact with each other through networks or inter-process communication. The update control module can, but is not limited to, obtain updated resource data from the storage system by calling the storage resource query interface or command-line interface.
[0045] The above embodiment will be illustrated using the volume resource data update process in storage management software as an example. Assume that the cache space contains capacity and health status data for multiple volumes, and the last update time for the resource data in the cache space was 8:00 AM. Therefore, 8:00 AM can be used as a reference update time. The update control module determines the target access time for the next access to the volume resource data in the cache space to be 9:00 AM based on historical access information before 8:00 AM, and sets 8:55 AM as the target update time. Between 8:00 AM and 8:55 AM, if the update control module receives multiple reference change messages indicating changes in volume capacity or health status, the update control module can choose not to immediately update the resource data in the cache space each time it receives a reference change message. Instead, it can update the resource data of the corresponding volume in the cache space at 8:55 AM based on these reference change messages. Thus, before accessing the volume resource data at 9:00 AM, the volume resource data in the cache space has already been updated according to the changes in storage resources.
[0046] This application resolves the issue that the timing of resource data updates is no longer solely determined by whether storage resources have changed. Instead, it allows for a comprehensive assessment based on historical access patterns, ensuring updates are performed before the data is accessed again. This avoids the shortcomings of related technologies, where frequent cache updates due to storage resource changes occur even when resource data is not accessed, leading to inefficient use of system processing resources. Therefore, this application addresses the technical problem of poor flexibility in resource data update timing in related technologies, achieving a significant improvement in the flexibility of resource data update timing.
[0047] As an optional approach, the target update time of the cache space is determined based on the historical access information of the cache space before the reference update time, including:
[0048] S21, based on at least one historical access time of the cache space before the reference update time, detect the access distribution information of the resource data cached in the cache space, wherein the historical access information includes at least one historical access time, and the access distribution information is used to indicate the distribution pattern of historical accesses of the resource data cached in the cache space over time.
[0049] S22, predict the target access time based on access distribution information;
[0050] S23, determine the target update time from the time interval between the reference update time and the target access time.
[0051] Optionally, in this embodiment, the historical access time can be, but is not limited to, the time when the resource data cached in the cache space was accessed before the reference update time. The historical access time can be the time when resource data corresponding to a certain resource type was accessed, or it can be the time when all resource data in the cache space was accessed. For example, if a user accesses the volume resource page at 8:55, 8:58, and 9:02, the above times can be used as the historical access time corresponding to the volume resource data in the cache space.
[0052] Optionally, in this embodiment, the access distribution information is used to represent the temporal distribution pattern of at least one historical access time. The access distribution information may, but is not limited to, representing the concentrated access time of resource data within a day, the concentrated access time within a business cycle, the time interval between two adjacent accesses, a period of frequent accesses, or a recurring pattern of access times. For example, if volume resource data in the cache space is accessed around 9:00 AM on multiple historical dates, the access distribution information can be used to represent that the historical access concentration of the volume resource data is around 9:00 AM. As another example, if storage pool resource data in the cache space is typically accessed every 30 minutes, the access distribution information can be used to represent that the storage pool resource data has an access interval pattern of approximately 30 minutes.
[0053] In the embodiment provided in step S21 above, historical access times within a preset number of days, preset number of hours, or preset duration period before the reference update time can be extracted from the access log, and the distribution of these historical access times in time can be statistically analyzed in chronological order.
[0054] In the embodiment provided in step S22 above, the update control module can predict the target access time based on the access distribution information. It should be noted that the target access time can be a predicted access time, and it is not required that this time be exactly the same as the actual access time that subsequently occurs. For example, if the access distribution information indicates that volume resource data in the cache space is accessed around 9:00 AM on multiple historical dates, the update control module can predict 9:00 AM on the current date as the target access time. As another example, if the access distribution information indicates that resource data in the cache space is typically accessed again approximately 30 minutes after the last access, the update control module can predict the target access time based on the most recent historical access time and this access interval pattern.
[0055] Optionally, in this embodiment, predicting the target access time based on access distribution information may include, but is not limited to: determining the time period in which the historical access set appears based on the access distribution information, and determining one time in that time period as the target access time; or, determining the time interval between adjacent accesses based on the access distribution information, and determining the target access time based on the most recent historical access time and that time interval; or, determining the time position where the number of historical accesses meets a preset condition based on the access distribution information, and determining the time corresponding to that time position as the target access time.
[0056] In the embodiment provided in step S23 above, the update control module can determine the target update time from the time interval between the reference update time and the target access time. That is, the target update time is later than or equal to the reference update time, and earlier than the target access time. Since the target update time is before the target access time, the update control module can update the resource data in the cache space before the resource data in the cache space is accessed next time, so that when the user or business module accesses the cache space at the target access time, it can read the resource data that has been updated according to the reference change information.
[0057] Through the above embodiments, the timing of resource data updates can be determined based on the access distribution pattern reflected by historical access times, rather than simply triggering updates immediately based on whether storage resources have changed. This avoids the drawback of frequently updating resource data in the cache space during periods when resource data has not yet been accessed, thereby improving the flexibility of resource data update timing and reducing the ineffective occupation of system processing resources.
[0058] As an optional approach, access distribution information of resource data cached in the cache space is detected based on at least one historical access time prior to the reference update time, including:
[0059] S31, detect the historical access status and target time interval of each reference sub-interval before the reference update time as access distribution information. The historical time before the reference update time is divided into at least one second time interval according to the target duration. Each second time interval includes multiple reference times, which include the start time and end time of the second time interval. Each second time interval is divided into multiple reference sub-intervals. Each reference sub-interval is the time interval between the start time and each of the other reference times among the multiple reference times except the start time. The historical access status is used to indicate the distribution of at least one historical access time in the corresponding reference sub-interval. The target time interval is the time interval from the corresponding reference sub-interval to the reference update time.
[0060] In the embodiment provided in step S31 above, the historical access status of each reference sub-interval before the reference update time and the target time interval of each reference sub-interval are detected as access distribution information. The historical time before the reference update time can be, but is not limited to, a continuous historical time before the reference update time, or the time corresponding to multiple historical periods before the reference update time. For example, if the reference update time is 8:00 on the current date, the historical time before the reference update time can be the time before 8:00 on the current date, or it can be the time of multiple days before the current date.
[0061] Optionally, in this embodiment, the target duration can be used to divide the historical time prior to the reference update time. The target duration can be, but is not limited to, a day, an hour, half an hour, a business cycle, or other durations set according to the access patterns of the storage management software. The second time interval is a time interval obtained by dividing the historical time prior to the reference update time according to the target duration. For example, if the target duration is a day, the historical time prior to the reference update time can be divided into multiple second time intervals according to calendar days; if the target duration is an hour, the historical time prior to the reference update time can be divided into multiple second time intervals according to hours.
[0062] Optionally, in this embodiment, each reference sub-interval is a time interval between the start time of the second time interval and each of the other reference times besides the start time. That is, the reference sub-interval starts from the start time of the second time interval and extends to each of the other reference times besides the start time. For example, the second time interval can be a target duration period prior to the reference update time. The start time of this second time interval is T0, and the end time is T0+TN. If TN is greater than 30 seconds, the multiple reference times can include T0, T0+20 seconds, T0+25 seconds, T0+30 seconds, and T0+TN, resulting in multiple reference sub-intervals such as T0 to T0+20 seconds, T0 to T0+25 seconds, T0 to T0+30 seconds, and T0 to T0+TN. The multiple reference times can be determined according to a preset time interval.
[0063] Optionally, in this embodiment, the historical access status is used to indicate the distribution of at least one historical access time within the corresponding reference sub-interval. The historical access status can be used, but is not limited to, to indicate whether a historical access time exists within the corresponding reference sub-interval, or it can be used to indicate the number of historical accesses within the corresponding reference sub-interval. For example, if a reference sub-interval is from 0:00 to 9:00, and the resource data cached in the cache space has been accessed at least once within that reference sub-interval, then the historical access status of that reference sub-interval can be used to indicate that historical access exists within that reference sub-interval; if no historical access occurs within that reference sub-interval, then the historical access status of that reference sub-interval can be used to indicate that no historical access exists within that reference sub-interval.
[0064] Optionally, in this embodiment, the target time interval is the time interval between the corresponding reference sub-interval and the reference update time. The target time interval can be used to represent the proximity of the corresponding reference sub-interval to the reference update time. For example, the target time interval can be determined based on the time difference between the representative time (start time, end time, or intermediate time) in the reference sub-interval and the reference update time. Using the target time interval, historical access cases closer to the reference update time and historical access cases farther from the reference update time can be distinguished in subsequent processing.
[0065] Through the above embodiments, the historical time prior to the reference update time is divided into at least one second time interval according to the target duration. Within each second time interval, multiple reference sub-intervals are formed based on multiple reference times. This allows the update control module to detect the historical access distribution of resource data across different historical periods and time spans. Furthermore, by detecting the historical access status of each reference sub-interval, it can be determined whether the historical access time falls within the corresponding reference sub-interval and the temporal distribution of historical access. By detecting the target time interval of each reference sub-interval, it can be determined how close the corresponding historical access distribution is to the reference update time. Therefore, the access distribution information reflects both the access patterns of resource data over historical time and the temporal proximity of these patterns to the reference update time, thereby improving the accuracy of the target update time prediction.
[0066] As an optional approach, the target access time can be predicted based on access distribution information, including:
[0067] S41, calculate the access parameters of each sub-interval set based on the historical access status and target time interval of the corresponding sub-intervals included in each sub-interval set in the multiple sub-interval sets, wherein the corresponding sub-interval is a sub-interval located at the same position in each second time interval in at least one second time interval, and the access parameters are used to indicate the probability that the resource data cached in the cache space of the target sub-interval located at the target position in the target interval with the target duration after the reference update time will be accessed, and the target position is the position of the corresponding sub-interval in the second time interval;
[0068] S42, Filter the target sub-interval set from multiple sub-interval sets according to the access parameters;
[0069] S43, determine the target access time based on the sub-interval lengths and reference update times of the sub-intervals included in the target sub-interval set.
[0070] In the embodiment provided in step S41 above, the set of sub-intervals may be, but is not limited to, a set composed of multiple corresponding sub-intervals. A corresponding sub-interval is a reference sub-interval located at the same position in each of the at least one second time interval. That is, if multiple second time intervals are divided into multiple reference sub-intervals according to the same reference time, then reference sub-intervals located at the same division position in different second time intervals can be determined as corresponding sub-intervals. For example, if the target duration is one day, and the multiple second time intervals are multiple natural days prior to the reference update time, and each second time interval includes reference sub-intervals such as 0:00 to 8:00, 0:00 to 9:00, 0:00 to 10:00, and 0:00 to 24:00, then 0:00 to 8:00 in the first position of each natural day can be considered as one group of corresponding sub-intervals, 0:00 to 9:00 in the second position of each natural day can be considered as another group of corresponding sub-intervals, and 0:00 to 10:00 in the third position of each natural day can be considered as yet another group of corresponding sub-intervals.
[0071] Optionally, in this embodiment, the multiple sub-interval sets may each correspond to different target positions within the second time interval. The target position may be, but is not limited to, the arrangement of corresponding sub-intervals within the second time interval. For example, the sub-interval set corresponding to the first position may include multiple reference sub-intervals from 0:00 to 8:00 within the second time interval; the sub-interval set corresponding to the second position may include multiple reference sub-intervals from 0:00 to 9:00 within the second time interval; and the sub-interval set corresponding to the third position may include multiple reference sub-intervals from 0:00 to 10:00 within the second time interval.
[0072] Optionally, in this embodiment, the access parameter is used to indicate the probability that resource data cached in the cache space will be accessed within a target sub-interval located at a target position within a target interval with a target duration after the reference update time. A target sub-interval can be understood as a sub-interval within the target interval that shares the same position as its corresponding sub-interval. For example, if the corresponding sub-intervals of a certain set of sub-intervals are all reference sub-intervals calculated from the start time of the corresponding second time interval to one hour later, then the target sub-interval corresponding to this set of sub-intervals can be a time interval calculated from the reference update time to one hour later. The access parameter corresponding to this set of sub-intervals can be used to indicate the probability that resource data cached in the cache space will be accessed within one hour after the reference update time.
[0073] Optionally, in this embodiment, the update control module can calculate the access parameters of the corresponding sub-interval set based on the historical access status of the corresponding sub-intervals and the target time interval. The historical access status reflects whether there is a historical access time or the number of historical accesses in the corresponding sub-intervals, and the target time interval reflects the distance of the corresponding sub-intervals from the reference update time. Therefore, when calculating the access parameters, corresponding sub-intervals with historical access can have a positive impact on the access parameters, and corresponding sub-intervals closer to the reference update time can have a greater impact on the access parameters.
[0074] In the embodiment provided in step S42 above, the target sub-interval set can be a sub-interval set selected from multiple sub-interval sets based on access parameters. The update control module can, but is not limited to, determine the sub-interval set with access parameters greater than a parameter threshold as a candidate sub-interval set, and then select the target sub-interval set from the candidate sub-interval set. By selecting the target sub-interval set based on access parameters, the location where resource data is more likely to be accessed within the target interval can be determined from multiple different target locations.
[0075] In the embodiment provided in step S43 above, the sub-interval length can be the time length between the start time and the end time of the sub-intervals included in the target sub-interval set. Since each sub-interval is a time interval between the start time of the second time interval and each of the other reference times among the multiple reference times excluding the start time, the sub-interval length can be used to represent the time span of the target position relative to the start time of the second time interval. For example, if the sub-intervals included in the target sub-interval set are from 0:00 to 9:00, then the sub-interval length can be 9 hours; if the sub-intervals included in the target sub-interval set are from 0:00 to 10:00, then the sub-interval length can be 10 hours.
[0076] Optionally, in this embodiment, determining the target access time based on the sub-interval lengths of the sub-intervals included in the target sub-interval set and the reference update time may include, but is not limited to, determining the time interval between the reference update time and the reference update time, which is equal to the length of the sub-interval, as the target access time. For example, if the reference update time is 8:00 and the length of the sub-intervals included in the target sub-interval set is 1 hour, then 9:00 can be determined as the target access time; if the reference update time is 8:00 and the length of the sub-intervals included in the target sub-interval set is 30 minutes, then 8:30 can be determined as the target access time.
[0077] Through the above embodiments, reference sub-intervals located at the same position in each second time interval are determined as corresponding sub-intervals. Access parameters for each sub-interval set are calculated based on the historical access status and target time interval of these corresponding sub-intervals. This ensures that the access parameters reflect the probability of resource data being accessed at the corresponding target position within the target interval. Furthermore, by filtering the target sub-interval set based on the access parameters, target positions more likely to be accessed can be identified from multiple different target positions. Even further, by determining the target access time based on the sub-interval lengths and reference update times of the sub-intervals included in the target sub-interval set, the temporal distribution pattern of historical accesses can be converted into a predicted access time after the reference update time. This helps to make the target access time more consistent with the historical access patterns of resource data in the cache space, and allows the target update time to be determined based on this target access time, thereby improving the flexibility and accuracy of resource data update timing.
[0078] As an optional approach, the access parameters for each sub-interval set are calculated based on the historical access status and target time interval of the corresponding sub-intervals included in each sub-interval set, including:
[0079] S51, when multiple sub-interval sets include N sub-interval sets, and each sub-interval set includes M corresponding sub-intervals, the access parameters of the nth sub-interval set are calculated through the following steps, where N and M are integers greater than 1, n is an integer greater than or equal to 1 and less than or equal to N, and m is an integer greater than or equal to 1 and less than or equal to M:
[0080] S52, calculate the reference access parameters of the mth peer sub-interval based on the historical access status of the mth peer sub-interval and the time weight parameter of the mth peer sub-interval. The time weight parameter is determined based on the target time interval. The smaller the target time interval, the larger the corresponding time weight parameter.
[0081] S53, calculate the access parameters of the nth sub-interval set based on the reference access parameters corresponding to each corresponding sub-interval in the nth sub-interval set.
[0082] In the embodiment provided in step S51 above, the N sub-interval sets can each correspond to N different target locations in the second time interval. Each sub-interval set includes M corresponding sub-intervals, and the M corresponding sub-intervals can each come from M second time intervals. That is, if there are M second time intervals before the reference update time, and each second time interval is divided into multiple reference sub-intervals according to the same reference time, the reference sub-intervals located at the same position in each second time interval can be combined into a sub-interval set.
[0083] Optionally, in this embodiment, the nth sub-interval set can be any one of the N sub-interval sets. The mth co-position sub-interval can be any co-position sub-interval in the nth sub-interval set.
[0084] In the embodiment provided in step S52 above, the historical access status can be, but is not limited to, a status value indicating whether a historical access time exists in the m-th corresponding sub-interval, or a status value indicating the number of historical accesses in the m-th corresponding sub-interval. For example, if at least one historical access time exists in the m-th corresponding sub-interval, the historical access status can take a first status value; if no historical access time exists in the m-th corresponding sub-interval, the historical access status can take a second status value. Alternatively, the historical access status can also be directly represented by the number of historical accesses in the m-th corresponding sub-interval.
[0085] Optionally, in this embodiment, the time weight parameter is determined based on the target time interval corresponding to the m-th peer sub-interval. The target time interval represents the time interval from the m-th peer sub-interval to the reference update time. The smaller the target time interval, the closer the m-th peer sub-interval is to the reference update time. The historical access information reflected by this peer sub-interval usually has higher reference value for predicting subsequent access times, and therefore the corresponding time weight parameter is larger. Conversely, the larger the target time interval, the farther the m-th peer sub-interval is from the reference update time. The historical access information reflected by this peer sub-interval has relatively lower reference value for predicting subsequent access times, and therefore the corresponding time weight parameter is smaller.
[0086] Optionally, in this embodiment, the reference access parameters for the m-th co-located sub-interval can be obtained by multiplying the state value corresponding to the historical access state of the m-th co-located sub-interval with the time weight parameter of the m-th co-located sub-interval. The time weight parameter can be determined based on the target time interval, as long as the relationship that the smaller the target time interval, the larger the corresponding time weight parameter is is satisfied.
[0087] In the embodiment provided in step S53 above, the update control module can calculate the access parameters of the nth sub-interval set based on the reference access parameters corresponding to each corresponding sub-interval in the nth sub-interval set. Optionally, the sum of the reference access parameters corresponding to each corresponding sub-interval in the nth sub-interval set can be determined as the access parameters of the nth sub-interval set; alternatively, the average value of the reference access parameters corresponding to each corresponding sub-interval can be determined as the access parameters of the nth sub-interval set; or, normalization processing can be performed based on the reference access parameters corresponding to each corresponding sub-interval to obtain the access parameters of the nth sub-interval set.
[0088] Let's take volume resource data in storage management software as an example. Assume there are three second time intervals before the reference update time. Each second time interval is divided into four reference sub-intervals according to the same reference time: 0:00 to 8:00, 0:00 to 9:00, 0:00 to 10:00, and 0:00 to 24:00. Then N can be 4, and M can be 3. Also, assume the first state value is 1 and the second state value is 0. For the second sub-interval set corresponding to 0:00 to 9:00, this sub-interval set includes three corresponding sub-intervals, each corresponding to 0:00 to 9:00 in one of the three second time intervals before the reference update time. If, among the three corresponding sub-intervals mentioned above, the sub-interval closest to the reference update time has a historical access time with a corresponding time weight parameter of 0.5; the sub-interval second closest to the reference update time has a historical access time with a corresponding time weight parameter of 0.3; and the sub-interval furthest from the reference update time has no historical access time with a corresponding time weight parameter of 0.2, then the reference access parameters 0.5, 0.3, and 0 can be calculated respectively. Then, the access parameter for this sub-interval set can be calculated based on the above reference access parameters, for example, obtaining an access parameter of 0.8. This access parameter can be used to represent the probability of volume resource data being accessed within the target sub-interval located at the target position between 0:00 and 9:00 within a target interval with a target duration after the reference update time.
[0089] Through the above embodiments, when calculating the access parameters of each sub-interval set, the update control module not only considers the existence of historical access statuses such as historical access times or historical access counts in the corresponding sub-intervals, but also determines the time weight parameters by combining the target time interval from each corresponding sub-interval to the reference update time. The smaller the target time interval, the larger the corresponding time weight parameter. Therefore, historical access situations closer to the reference update time have a greater impact on the access parameter calculation, while historical access situations farther from the reference update time have a relatively smaller impact. This allows the access parameters to more accurately reflect the probability of resource data being accessed at the corresponding target location after the reference update time. Furthermore, calculating the access parameters of the sub-interval set based on the reference access parameters corresponding to each corresponding sub-interval allows the access situations in multiple historical time intervals to be summarized into quantitative parameters for predicting the target access time. This helps improve the accuracy of target access time prediction and further enhances the flexibility of resource data update timing.
[0090] As an optional approach, the access parameters of the nth sub-interval set are calculated based on the reference access parameters corresponding to each corresponding sub-interval in the nth sub-interval set, including:
[0091] S61, select the target corresponding sub-interval from each corresponding sub-interval included in the nth sub-interval set, wherein the target corresponding sub-interval is a historical access status used to indicate that there is a corresponding sub-interval with at least one historical access time in the corresponding corresponding sub-interval.
[0092] S62, calculate the access parameters of the nth sub-interval set based on the reference access parameters corresponding to each target co-position sub-interval.
[0093] In the embodiment provided in step S61 above, each of the corresponding sub-intervals included in the nth sub-interval set has a corresponding historical access status. The historical access status is used to indicate whether there is at least one historical access time in the corresponding corresponding sub-interval, or to indicate the distribution of historical access times in the corresponding corresponding sub-interval.
[0094] Optionally, in this embodiment, the target corresponding sub-interval is a corresponding sub-interval in the nth sub-interval set that has at least one historical access time. That is, when the update control module calculates the access parameters of the nth sub-interval set, it can first exclude corresponding sub-intervals that have not been accessed in the past based on the historical access status of each corresponding sub-interval, and only retain the corresponding sub-intervals that have been accessed in the past as the target corresponding sub-intervals. For example, if the nth sub-interval set includes 5 corresponding sub-intervals, where the historical access status of the 1st, 3rd, and 5th corresponding sub-intervals is used to indicate that there is at least one historical access time in the corresponding corresponding sub-interval, and the historical access status of the 2nd and 4th corresponding sub-intervals is used to indicate that there is no historical access time in the corresponding corresponding sub-interval, then the 1st, 3rd, and 5th corresponding sub-intervals can be determined as the target corresponding sub-intervals.
[0095] In the embodiment provided in step S62 above, since all target co-location sub-intervals are co-location sub-intervals with at least one historical access time, the reference access parameters corresponding to each target co-location sub-interval can reflect the contribution of the historical time intervals that have been accessed at the target location to the probability of subsequent access.
[0096] Optionally, in this embodiment, calculating the access parameters of the nth sub-interval set based on the reference access parameters corresponding to each target co-location sub-interval may include, but is not limited to: directly summing the reference access parameters corresponding to each target co-location sub-interval to obtain the access parameters of the nth sub-interval set; or, performing normalization processing after summation to obtain the access parameters of the nth sub-interval set. Through the above embodiments, the access parameters of the nth sub-interval set can more comprehensively reflect the impact of co-location sub-intervals that have been historically accessed at the corresponding target location on the probability of subsequent access, thereby improving the reference value of the access parameters for predicting target access time, and helping to improve the accuracy of target update time determination and the flexibility of resource data update timing.
[0097] As an optional approach, the target sub-interval set is selected from multiple sub-interval sets based on access parameters, including:
[0098] S71, Search for a set of candidate sub-intervals whose access parameters are greater than the parameter threshold from multiple sub-interval sets;
[0099] S72, if a set of candidate sub-intervals is found, the set of sub-intervals whose corresponding sub-intervals are located at the beginning of the second time interval is determined as the target sub-interval set.
[0100] S73, if no candidate sub-interval set is found, the sub-interval set whose co-position sub-interval is the latest in the second time interval among the multiple sub-interval sets is determined as the target sub-interval set.
[0101] In the embodiment provided in step S71 above, the parameter threshold can be, but is not limited to, a threshold used to determine whether the access probability corresponding to the sub-interval set meets the prediction requirements. The parameter threshold can be a pre-set fixed threshold, or a threshold dynamically determined based on the total number of historical accesses, historical access frequency, target duration, or the resource type corresponding to the resource data cached in the cache space. For example, for volume resource data with high access frequency, a higher parameter threshold can be set to avoid predicting the target access time too early; for storage pool resource data with low access frequency but long update time, a lower parameter threshold can be set to determine the target access time more promptly.
[0102] Optionally, in this embodiment, the access parameter is used to indicate the likelihood that resource data cached in the cache space of the target sub-interval located at the target position within the target interval with a target duration after the reference update time will be accessed. Therefore, a set of sub-intervals with access parameters greater than a parameter threshold can be understood as having a high probability of accessing the target position corresponding to that sub-interval set within the target interval. The update control module can search for a set of sub-intervals with access parameters greater than a parameter threshold from multiple sub-interval sets and determine the found sub-interval sets as candidate sub-interval sets.
[0103] In the embodiment provided in step S72 above, finding a set of candidate sub-intervals indicates that at least one target location has an access probability that meets the parameter threshold requirement. Since the target locations corresponding to each set of sub-intervals can be arranged in chronological order, selecting the candidate sub-interval set with the earliest position as the target sub-interval set when the access parameters meet the parameter threshold can predict the earliest possible access time of the resource data. For example, if multiple candidate sub-interval sets correspond to target locations 30 minutes, 1 hour, and 2 hours after the reference update time, respectively, and the access parameters of these candidate sub-interval sets are all greater than the parameter threshold, the candidate sub-interval set corresponding to 30 minutes after the reference update time can be determined as the target sub-interval set, thereby determining the target access time as early as possible.
[0104] In the embodiment provided in step S73 above, if no candidate sub-interval set is found, it means that the access parameters corresponding to multiple sub-interval sets are not greater than the parameter threshold, indicating that the target positions corresponding to multiple sub-interval sets have a low access probability within the target interval. In this case, the sub-interval set whose corresponding sub-interval is the latest position in the second time interval can be determined as the target sub-interval set. "Last position" can be understood as a relatively later position in the second time interval. For example, if each second time interval is divided into reference sub-intervals such as 0:00 to 8:00, 0:00 to 9:00, 0:00 to 10:00, and 0:00 to 24:00, the corresponding sub-interval corresponding to 0:00 to 24:00 can be the latest position.
[0105] As an optional approach, the target access time is determined based on the sub-interval lengths and reference update times included in the target sub-interval set, including:
[0106] S81, the time interval between the reference update time and the reference update time, which is the length of the sub-interval, is determined as the target access time.
[0107] In the embodiment provided in step S81 above, the update control module can determine the target access time as the time interval between the reference update time and the reference update time, which is equal to the length of the sub-interval. For example, if the reference update time is 8:00, and the sub-interval corresponding to the target sub-interval set is the reference sub-interval counted from the start time of the corresponding second time interval to 1 hour later, then the length of this sub-interval is 1 hour. The update control module can determine 9:00, which is 1 hour after the reference update time of 8:00, as the target access time. In this way, the access distribution pattern reflected by the corresponding sub-intervals in historical time can be mapped to the target interval after the reference update time, thereby predicting the target access time for the next access to the resource data.
[0108] As an alternative approach, the method also includes:
[0109] S91, predict the current access status of the cache space based on historical access information;
[0110] S92, if the access status is active, the target duration is set as the first duration;
[0111] S93, if the access status is not active, the target duration is determined as the second duration; wherein the first duration is less than the second duration.
[0112] In the embodiment provided in step S91 above, the access state is used to indicate the activity level of the resource data cached in the cache space at the current stage. The access state can include an active state and an inactive state. An active state can be used to indicate that the resource data cached in the cache space is more likely to be accessed at the current stage, and an inactive state can be used to indicate that the resource data cached in the cache space is less likely to be accessed at the current stage.
[0113] Optionally, in this embodiment, the update control module can predict the current access status of the cache space based on, but is not limited to, the historical access time, historical access count, or historical access frequency included in the historical access information. For example, if the historical access information indicates that the resource data cached in the cache space is frequently accessed during the historical time period corresponding to the current time period, it can be predicted that the cache space is currently in an active state; if the historical access information indicates that the resource data cached in the cache space is rarely accessed or not accessed during the historical time period corresponding to the current time period, it can be predicted that the cache space is currently in an inactive state. As another example, if the current time falls within a high-frequency access period determined based on the historical access information, it can be predicted that the cache space is currently in an active state; if the current time does not fall within a high-frequency access period, it can be predicted that the cache space is currently in an inactive state.
[0114] In the embodiments provided in steps S92 and S93 above, the target duration is used to divide the historical time before the reference update time to obtain at least one second time interval. When the access state is active, the resource data cached in the cache space is more likely to be accessed; therefore, the target duration can be determined as a shorter first duration, allowing the update control module to detect the historical access distribution with finer time granularity. When the access state is inactive, the resource data cached in the cache space is less likely to be accessed; therefore, the target duration can be determined as a longer second duration, allowing the update control module to detect the historical access distribution with coarser time granularity, thereby reducing the data processing volume of the historical access analysis process. For example, the first duration can be, but is not limited to, 5 minutes, 10 minutes, or 15 minutes, and the second duration can be, but is not limited to, 60 minutes, 120 minutes, or 360 minutes, etc. Through the above embodiments, the update control module can adjust the target duration according to the current access status of the cache space. When the access probability is high, a shorter target duration is used to improve the accuracy of update time prediction, and when the access probability is low, a longer target duration is used to reduce computational overhead, thereby improving the flexibility of resource data update control.
[0115] Let's take volume resource data in storage management software as an example. If historical access information indicates that users frequently access the volume resource page between 9:00 and 18:00 on weekdays, then when the current time is between 9:00 and 18:00 on a weekday, the update control module can predict that the cache space is currently active and set the target duration as the first duration, such as 30 minutes; when the current time is at night on a weekday or on a non-weekday, the update control module can predict that the cache space is currently inactive and set the target duration as the second duration, such as 120 minutes.
[0116] As an optional approach, the target update time of the cache space is determined based on the historical access information of the cache space before the reference update time, including:
[0117] S101, predict the current access status of the cache space based on historical access information;
[0118] S102, when the access status is active, determine the target update time of the cache space based on the historical access information of the cache space before the reference update time.
[0119] S103, when the access status is not active, generate the target update time based on the reference update time and the preset update cycle.
[0120] In the embodiment provided in step S102 above, when the access status is active, it indicates that the resource data cached in the cache space is highly likely to be accessed at the current stage. At this time, the update control module can predict the target access time based on the historical access information of the cache space before the reference update time, and determine the target update time from the time interval between the reference update time and the target access time, so as to complete the update before the resource data is accessed next.
[0121] In the embodiment provided in step S103 above, if the access state is not active, it indicates that the resource data cached in the cache space is less likely to be accessed at the current stage. In this case, the update control module can generate a target update time based on the reference update time and the preset update cycle. For example, if the reference update time is 8:00 and the preset update cycle is 60 minutes, then 9:00 can be determined as the target update time.
[0122] By using the above methods, during periods of high access activity, the target update time can be predicted based on historical access patterns; during periods of low access activity, the target update time can be generated according to a preset update cycle. This ensures that cached data can be updated periodically while avoiding overly fine-grained access predictions and frequent updates during periods of low access activity.
[0123] As an optional approach, the target update time of the cache space is determined based on the historical access information of the cache space before the reference update time, including:
[0124] S111, extract the target access information corresponding to the target resource type from the historical access information, wherein at least one storage resource is divided into multiple resource types;
[0125] S112, determine the target update time of the target resource data corresponding to the storage resource of the target resource type in the cache space based on the target access information.
[0126] In the embodiment provided in step S111 above, the various resource types may include, but are not limited to, volume types, storage pool types, port types, file system types, snapshot task types, or remote replication task types. The target resource type can be any of the various resource types. For example, when volume resource data, storage pool resource data, and disk resource data are cached simultaneously in the cache space, the volume type can be used as the target resource type, and volumes A, B, and C can be used as storage resources belonging to the target resource type. The resource data corresponding to volumes A, B, and C in the cache space can be used as the target resource data. In the storage array management software caching scenario, different resource types can correspond to different command-line interfaces. For example, the volume type corresponds to listvolume (a command-line interface for querying volume type resources), the storage pool type corresponds to listpool (a command-line interface for querying storage pool type resources), and the disk type corresponds to listdisk (a command-line interface for querying disk type resources). The resource data corresponding to different resource types may have different access patterns. Therefore, the target access information corresponding to the target resource type can be extracted from the historical access information, and the target update time of the target resource data corresponding to the target resource type can be determined based on the target access information.
[0127] Optionally, in this embodiment, historical access information can be recorded according to resource type, or the resource type corresponding to each historical access can be recorded in the historical access information. The update control module can extract the target access information corresponding to the target resource type from the historical access information. The target access information may include, but is not limited to, information such as the historical access time, historical access count, historical access frequency, historical access interval, or historical access source of resource data belonging to the target resource type before the reference update time. For example, if the target resource type is a volume type, the target access information may include the time when the user historically accessed the volume resource page, the time when the business module called the volume resource data, or the time when the monitoring module read the volume resource data.
[0128] In the embodiment provided in step S112 above, the update control module determines the target update time of the target resource data corresponding to the storage resource of the target resource type in the cache space based on the target access information. That is, different resource types can determine their target update times separately based on their respective target access information, without needing to update resource data of all resource types in the cache space according to the same update time. For example, if volume resource data is typically accessed around 9:00 AM daily, and storage pool resource data is typically accessed around 10:00 AM daily, the target update time of the volume resource data can be determined based on the target access information corresponding to the volume type, and the target update time of the storage pool resource data can be determined based on the target access information corresponding to the storage pool type.
[0129] Through the above embodiments, the update control module can extract the target access information corresponding to the target resource type from historical access information, and determine the target update time of the target resource data based on the target access information. This allows resource data of different resource types to determine the update timing according to the historical access situation of the corresponding resource type. Therefore, the update timing of resource data can be more closely aligned with the access situation of specific resource types, thereby further improving the flexibility of resource data update timing.
[0130] As an optional approach, at the target update time, the resource data cached in the cache space is updated based on the reference change information received within the first time interval, including:
[0131] S121, at the target update time, update the target resource data according to the resource change information corresponding to the target resource type in the resource type and change information with corresponding relationship, wherein the reference change information includes the resource type and change information with corresponding relationship.
[0132] In the embodiment provided in step S121 above, the reference change information may include resource types and change information corresponding to the resource types. For example, the reference change information may include resource types and change information with corresponding relationships, such as "volume type - volume A capacity change", "disk type - disk D health status change", and "storage pool type - storage pool P available capacity change".
[0133] Optionally, in this embodiment, the target resource type is the resource type that needs to be updated at the target update time, and the target resource data is the resource data corresponding to the storage resource of the target resource type in the cache space. The update control module can extract the resource change information corresponding to the target resource type from the resource types and change information with corresponding relationships included in the reference change information, and update the target resource data according to the resource change information. For example, if the target resource type is a volume type, the update control module can extract the resource change information corresponding to the volume type from the reference change information, and update the volume resource data in the cache space according to the resource change information corresponding to the volume type, without having to update the disk resource data or storage pool resource data at the same time.
[0134] Through the above embodiments, the update control module updates the target resource data according to the resource change information corresponding to the target resource type at the target update time, so that the resource data update in the cache space can match the resource type. This avoids triggering resource data updates for other resource types due to a change in one resource type, reduces unnecessary data acquisition, processing, and writing operations, and improves the targeting of resource data updates and cache management efficiency.
[0135] As an optional approach, at the target update time, the target resource data is updated based on the resource change information corresponding to the target resource type in the corresponding resource type and change information, including:
[0136] S131, at the target update time, search for the target information queue corresponding to the target resource type from the resource type and information queue with corresponding relationship. The target information queue records the changed storage resources that have changed within the first time interval in the storage resources belonging to the target resource type according to the order of receiving the change information without repetition.
[0137] S132, Update target resource data according to target information queue.
[0138] In the embodiment provided in step S131 above, the update control module can find the target information queue corresponding to the target resource type based on the correspondence between resource types and information queues. The information queue can be, but is not limited to, a queue, list, set, or cache record used to record changes to storage resources. Different resource types can each have their own corresponding information queue. For example, a volume type can correspond to a volume information queue, a disk type can correspond to a disk information queue, and a storage pool type can correspond to a storage pool information queue. The target information queue is the information queue corresponding to the target resource type.
[0139] Optionally, in this embodiment, the target information queue records changed storage resources belonging to the target resource type without repetition, according to the order in which the change information is received. Receiving change information according to the order can be understood as follows: if the update control module first receives change information indicating a change in volume A, and then receives change information indicating a change in volume B, the target information queue can record the changed storage resources in the order of volume A and volume B. Recording without repetition can be understood as follows: for the same storage resource that changes multiple times within the first time interval, the target information queue can retain only one record for that storage resource, or update its corresponding change information while retaining the queue position of that storage resource. For example, if change information indicating a change in volume A's capacity, a change in volume B's health status, and another change in volume A's capacity are received sequentially within the first time interval, the target information queue can record volume A and volume B without repetition, instead of repeatedly recording two volumes A.
[0140] In the embodiment provided in step S132 above, the update control module can update the target resource data according to the target information queue. Optionally, the update control module can determine the changed storage resources that have changed within the first time interval according to the record order in the target information queue, obtain the updated resource data corresponding to each changed storage resource, and then write the updated resource data into the cache space to update the target resource data. For example, if volume A and volume B are recorded in the target information queue, the update control module can obtain the updated resource data of volume A and volume B respectively, and write them into the cache locations corresponding to volume A and volume B in the cache space.
[0141] Through the above embodiments, the update control module records changed storage resources of the target resource type that have changed within the first time interval through the target information queue. Furthermore, the target information queue records changed storage resources non-repeatedly according to the order in which the change information is received, ensuring that the same storage resource does not need to be processed repeatedly when it changes multiple times within the first time interval. This reduces the likelihood of repeatedly updating the resource data corresponding to the same storage resource, decreases the number of data acquisition and writing operations, and improves the efficiency of target resource data updates.
[0142] As an optional approach, at the target update time, the resource data cached in the cache space is updated based on the reference change information received within the first time interval, including:
[0143] S141, Detect access request, wherein the access request is used to request access to resource data cached in the cache space;
[0144] S142, upon detecting an access request, update the cached resource data in the cache space according to the target change information received within the third time interval, wherein the third time interval is the time interval between the reference update time and the current time; execute the access request;
[0145] S143, if no access request is detected, update the resource data cached in the cache space at the target update time based on the reference change information received within the first time interval.
[0146] In the embodiment provided in step S141 above, the access request is used to request access to resource data cached in the cache space. The access request can be, but is not limited to, a resource page display request initiated by a user through storage management software, or a data access request initiated by a business module, operation and maintenance module, or monitoring module. The access request can request access to all resource data in the cache space, or it can request access to resource data corresponding to a specific resource type, or it can request access to resource data corresponding to a specific storage resource. For example, a request generated when a user opens a volume resource page can be used as an access request to access volume resource data.
[0147] In the embodiment provided in step S142 above, the current time can be the time when the access request is detected, or it can be the execution time for updating the resource data cached in the cache space based on the target change information received within the third time interval. The third time interval is the time interval between the reference update time and the current time. The target change information can be information received within the third time interval indicating changes to at least one storage resource. Since the current time may be earlier than the target update time, if an access request has been detected before the target update time has arrived, the update control module can update the resource data cached in the cache space based on the target change information received within the third time interval before executing the access request.
[0148] Optionally, the target change information can be a change record in the information queue corresponding to the resource data requested by the access request that has not yet been processed. After updating the resource data in the cache space based on the target change information, the update control module can delete the target change information from the information queue to avoid repeatedly processing the target change information after the target update time arrives. Executing the access request may include, but is not limited to, reading the resource data requested by the access request from the cache space and returning the read resource data to the initiator of the access request or for page display.
[0149] Optionally, in this embodiment, updating the resource data cached in the cache space based on the target change information received within the third time interval may include, but is not limited to: determining the changed storage resource based on the target change information received within the third time interval; obtaining the updated resource data corresponding to the changed storage resource; and writing the updated resource data into the cache space.
[0150] In the embodiment provided in step S143 above, if no access request is detected, it indicates that there is currently no need to access the resource data cached in the cache space. At this time, the update control module can continue to update the resource data according to the target update time, that is, update the resource data cached in the cache space based on the reference change information received within the first time interval at the target update time. Therefore, when no access request occurs, it is still possible to avoid updating the cache space immediately every time reference change information is received; and when an access request occurs, the cache space can be updated based on the target change information before executing the access request, thereby ensuring that the accessed resource data can be updated in a timely manner.
[0151] Let's take volume resource data in storage management software as an example. Assume the reference update time is 8:00 and the target update time is 8:55. Between 8:00 and 8:40, the update control module receives target change information indicating changes in the capacity of volume A and the health status of volume B. If a user's access request to open the volume resource page is detected at 8:40, the update control module can use 8:00 to 8:40 as a third time interval, update the volume A and volume B resource data in the cache space according to the target change information received within this third time interval, and then execute the access request to display the updated volume resource data to the user. If no access request is detected between 8:00 and 8:55, the update control module can update the resource data in the cache space at 8:55 based on the reference change information received between 8:00 and 8:55.
[0152] To better understand the resource data update control process described above, the following explanation uses a storage management software caching scenario as an example. This example is only used to explain the embodiments of this application and is not intended to limit the scope of protection of this application.
[0153] First, the update control module can obtain the time when the resource data in the cache space was last updated as a reference update time.
[0154] Then, in an optional implementation, the update control module can predict the current access state of the cache space based on historical access information. Specifically, the historical access states of each reference time unit in the D historical periods closest to the reference update time can be recorded, where D is an integer greater than 1, for example, D can be 7. The i-th historical period is the i-th historical period obtained by sorting it in ascending order of the time interval with the reference update time. That is, i=1 represents the historical period closest to the reference update time, and the larger the value of i, the farther the corresponding historical period is from the reference update time. i is an integer greater than or equal to 1 and less than or equal to D. This represents the historical access status of the j-th reference time unit within the i-th historical period; if the resource data cached in the cache space is accessed within the j-th reference time unit, then... The value is 1; if the resource data cached in the cache space is not accessed within the j-th reference time unit, then... The value is 0. Here, j can be the reference time unit number in a historical period, and the reference time unit can be, but is not limited to, 1 minute, 5 minutes, 10 minutes, or other preset durations. The update control module can calculate the access probability corresponding to the current time unit according to the following formula:
[0155] ;
[0156] in, This indicates the access probability corresponding to the current time unit. This represents the time weight parameter corresponding to the i-th historical period. This is used to ensure that historical access status closer to the reference update time has a greater impact on the access probability. Optionally, It can be obtained through the following formula: ,in, This represents the decay parameter at the first time. The value of is greater than 0 and less than 1. It is possible, but not limited to, taking 0.7. If the access probability threshold is greater than or equal to the access probability threshold, the update control module can determine that the cache space is currently in an active state; If the access probability is below the threshold, the update control module can determine that the cache space is currently inactive. The access probability threshold can be, but is not limited to, 0.618.
[0157] After determining the access status, if the cache space is currently active, the update control module can determine the target update time based on the historical access information of the cache space before the reference update time. Specifically, the update control module can divide the historical time before the reference update time into at least one second time interval, and set multiple reference times in each second time interval to obtain multiple reference sub-intervals. Reference sub-intervals located at the same position in different second time intervals can be regarded as corresponding sub-intervals, and a set of multiple corresponding sub-intervals can be regarded as a sub-interval set.
[0158] Furthermore, in one optional implementation, the update control module can define a minimum candidate duration of... The maximum candidate duration is ,and ,in, It is an integer greater than 1. This is the time interval between adjacent candidate reference times. For example, It can be 20 seconds. It can be 5 seconds. It can be 6, then It can be 50 seconds. The update control module can divide the time interval corresponding to a target duration into multiple reference sub-intervals, for example... ,in, After completing the reference subinterval partitioning, for the ... The update control module can calculate access parameters based on the historical access status and target time interval of each corresponding sub-interval in the set of sub-intervals. Indicates the first In the second time interval, the first The historical access status of each corresponding sub-interval; if there is at least one historical access time within that corresponding sub-interval, then The value is 1; if there is no historical access time within the corresponding sub-interval, then... The value is 0. The m-th second time interval can be the m-th second time interval obtained by sorting the target time intervals from the reference update time in ascending order. That is, m=1 represents the second time interval closest to the reference update time, and the larger the value of m, the farther the corresponding second time interval is from the reference update time. The update control module can calculate the access parameters corresponding to the n-th sub-interval set according to the following formula:
[0159] ;
[0160] in, Indicates the first Access parameters corresponding to each sub-interval set. This represents the time weight parameter of the m-th co-located sub-interval, determined based on the target time interval of the m-th co-located sub-interval. It is used to adjust the access parameters based on the historical access status in the second time interval that is closer to the reference update time. The greater the impact, the better. Alternatively, It can be obtained through the following formula: ,in, This represents the second time decay parameter. The value of is greater than 0 and less than 1. It can be, but is not limited to, 0.7. The smaller the target time interval, the smaller the corresponding m value, and the larger the corresponding time weight parameter.
[0161] Subsequently, after calculating the access parameters corresponding to multiple sub-interval sets, the update control module can search for candidate sub-interval sets whose access parameters are greater than the parameter threshold. If a candidate sub-interval set is found, the first sub-interval set in the candidate set can be determined as the target sub-interval set; if no candidate sub-interval set is found, the last sub-interval set in the candidate set can be determined as the target sub-interval set. Then, the update control module can determine the target access time based on the sub-interval lengths of the sub-intervals included in the target sub-interval set and the reference update time, and determine the target update time from the time interval between the reference update time and the target access time.
[0162] On the other hand, if the cache space is not currently active, the update control module can generate a target update time based on the reference update time and the preset update cycle. For example, if the reference update time is 8:00 and the preset update cycle is 1 hour, then 9:00 can be determined as the target update time.
[0163] After determining the target update time, the update control module can proceed to the stage of receiving and recording reference change information. Figure 4 This is a schematic diagram of a resource change record processing flow according to an embodiment of this application. Figure 4 As shown, after the target update time is determined, the update control module can receive reference change information within the first time interval. Upon receiving the reference change information within the first time interval, the update control module can determine whether a similar resource change record already exists in the information queue (relative to the target information queue). If a similar resource change record already exists in the information queue, the changed storage resource indicated by the reference change information is merged into the existing similar resource change record; if no similar resource change record exists in the information queue, a corresponding changed storage resource record is added to the information queue.
[0164] When the target update time is reached, the update control module can retrieve all resource change records to be updated (relative to the reference change information received within the first time interval) from the information queue, place the retrieved resource change records into the pending queue Q, and simultaneously clear the information queue. Subsequently, the update control module can iterate through each resource change record in the pending queue Q and update the cached resource data in the cache space according to each resource change record. Figure 5 This is a schematic diagram of a cached resource data update process according to an embodiment of this application, such as... Figure 5 As shown, when processing a resource change record, the update control module can first estimate the time required to acquire resource data and determine the specific data acquisition method accordingly. In this embodiment, the data acquisition method can include a collection acquisition method and a single object acquisition method. A collection acquisition method can represent acquiring resource data of all or multiple storage resources belonging to the same resource type at once, such as executing a collection view command once to output the data of all volume objects under the volume type; a single object acquisition method can represent acquiring resource data of a single storage resource belonging to the same resource type separately, such as executing multiple single object view commands separately to output the data of each volume object. Specifically, the update control module can record the historical execution time of the data acquisition method corresponding to each resource type. For example, the execution time of the collection view of a certain command-line interface for the last two times is... and The execution times for the two most recent single-object views were respectively and The estimated execution time of the collection view. It can be: Estimated execution time for a single object view It can be: The weights of 0.6 and 0.4 mentioned above are merely examples; in practical applications, as long as the weight corresponding to the historical execution time more recent than the current execution time is greater than the weight corresponding to the historical execution time further from the current execution time, it can be demonstrated that the recent execution time has higher reference value for the estimated execution time. If the number of storage resources changed in this resource change record is... ,and Less than or equal to This indicates that the collection retrieval method is less time-consuming, and the update control module can use the collection retrieval method to obtain the updated resource data; if Greater than This indicates that the total time consumed by the single object retrieval method is relatively short, and the update control module can use the single object retrieval method to retrieve objects separately. The updated resource data for each changed storage resource. The execution result of the above command-line interface can be used as an optional form of the updated resource data corresponding to at least one changed storage resource.
[0165] After acquiring the latest data on the changed storage resources, the update control module can extract the resource identifier and data content. Optionally, the update control module can perform shallow parsing on the acquired resource data. Shallow parsing is used to extract the resource identifier field and the corresponding data content from the resource data according to preset field positions, field names, or delimiters, without performing a complete semantic analysis of the entire resource data. For example, for command-line interface output results, the update control module can parse only the object identifier field in the command-line interface output results and extract the command-line interface output string corresponding to each object identifier. This command-line interface output string can be used as an optional form of resource data string.
[0166] In one optional form, the update control module can establish a mapping structure `map0`, which stores the correspondence between object identifiers and command-line interface (CLI) output strings. This mapping structure can be a data structure composed of multiple key-value pairs, such as a hash table, dictionary, or set of key-value pairs. The keys in `map0` are object identifiers, indicating the storage resource to be updated. The values in `map0` are the corresponding CLI output strings, representing the resource status, change results, or other resource content output by the CLI for that object. Therefore, the update control module can search for the corresponding CLI output string in `map0` based on the object identifier and use the found CLI output string as the latest resource data corresponding to that object identifier. If the latest CLI output does not contain an object identifier carried by a resource change record, it means that the latest acquired resource data does not contain the resource content corresponding to that object identifier, and the update control module can mark the storage resource corresponding to that object identifier as deleted.
[0167] Then, the update control module can update the snapshot corresponding to this resource type in the cache space based on map0. The snapshot snapshot represents the resource data already cached for this resource type in the cache space; it can be understood as a copy of the resource data saved in the cache space at a certain point in time. The snapshot snapshot can include multiple object identifiers and the cached data corresponding to each object identifier.
[0168] In this embodiment, `map0` can represent the latest resource data obtained this time, and `snap` can represent the resource data already saved in the cache space. The update control module can determine whether the corresponding storage resource is a newly added object, a modified object, or a deleted object by comparing the existence of object identifiers in `map0` and `snap`. If object identifier `id0` exists in `map0` but not in `snap`, it means that the storage resource corresponding to object identifier `id0` is a newly created object, and the update control module can add object identifier `id0` and its corresponding command-line interface output string to `snap`. If object identifier `id0` exists in both `map0` and `snap`, it means that the storage resource corresponding to object identifier `id0` is a modified object, and the update control module can replace the cached data corresponding to object identifier `id0` in `snap` with the command-line interface output string corresponding to object identifier `id0` in `map0`. If the storage resource corresponding to object identifier `id0` recorded in `map0` has been deleted, the update control module can delete the cached data corresponding to object identifier `id0` from `snap`.
[0169] Furthermore, after the update control module updates the snapshot, it can delete the parsed resource objects in the cache space corresponding to the object identifiers in the resource change records. In other words, after obtaining the latest data based on the resource change records, the update control module can first save the snapshot corresponding to the command-line interface output string, without immediately converting the command-line interface output string into a fully parsed resource object. Only when the storage management software subsequently requests access to the corresponding resource data can the update control module perform deep parsing of the command-line interface output string in the snapshot into a parsed resource object and return the parsed resource object to the caller. The parsed resource object represents a structured data object generated from the resource data string. This structured data object can include one or more resource attributes and their corresponding attribute values, allowing the caller to read or display the resource attributes of the corresponding storage resource through the parsed resource object. By first performing shallow parsing and saving the data content, and then performing deep parsing as needed during access, unnecessary object conversion operations can be avoided when the resource data is not accessed.
[0170] It should be noted that if the cache space does not contain a snapshot for the resource type, the update control module can retrieve the resource data of all storage resources under that resource type using a set acquisition method. It then performs a shallow parsing of the resource data to obtain the resource identifiers and corresponding data content of all storage resources. Finally, it saves the parsed mapping structure as the snapshot for that resource type to the cache space. This allows for the initialization of cache data for that resource type even before a corresponding snapshot has been created in the cache space.
[0171] In another case, Figure 6 This is a schematic diagram of a cached resource data access process according to an embodiment of this application. For example... Figure 6 As shown, within the first time interval and before the target update time arrives, if the update control module detects an access request, it can first determine whether the data requested by the access request has any pending changes. If pending changes exist, the update control module can extract the corresponding target change information from the information queue, update the resource data in the cache space according to the target change information, and then continue to execute the access request. After the resource data in the cache space is updated, the update control module can determine whether the resource object required by the access request already exists in the cache space. If the resource object already exists, it can be directly extracted and returned to the initiator of the access request; if the resource object does not exist, it can parse the resource object from the resource data string stored in the cache space, save the parsed resource object in the cache space, and then return it to the initiator of the access request.
[0172] Optionally, when executing an access request, if the cache space does not contain a snapshot corresponding to the resource data required for the access request, the update control module can delete the resource change record corresponding to the resource type in the information queue, obtain the resource data of all stored resources under the resource type using a set acquisition method, and perform shallow parsing on the resource data of all stored resources to generate a snapshot corresponding to the resource type; subsequently, the resource data string required for the access request in the snapshot snapshot is deeply parsed into a resource object, and the resource object is returned to the initiator of the access request.
[0173] Finally, let's take volume resource data updates as an example. Assume the cache space contains capacity and health status data for multiple volumes, and the resource data in the cache space was last updated at 8:00 AM. In this case, 8:00 AM can be used as a reference update time. The update control module determines, based on historical access information before 8:00 AM, that the volume resource data is likely to be accessed again at 9:00 AM, and sets 8:55 AM as the target update time. Therefore, the time interval between 8:00 AM and 8:55 AM can be considered the first time interval.
[0174] Within the first time interval, if the storage system detects capacity changes in volumes 1, 3, and 8 and sends resource change information (listvolume: [1, 3, 8]) to the update control module, the update control module can record volumes 1, 3, and 8 in the information queue corresponding to the volume type, without immediately updating the volume resource data in the cache space. If a resource change information (listvolume: [3, 10]) is subsequently received, the update control module can determine that a change record corresponding to the volume type already exists in the information queue, and merge volume 10 into that change record, obtaining the change storage resource record [1, 3, 8, 10] corresponding to the volume type. When 8:55 arrives, the update control module can retrieve the change storage resource record corresponding to the volume type from the information queue and place it into the pending queue Q, then clear the information queue. Subsequently, the update control module traverses the pending queue Q, obtains the latest data of volumes 1, 3, 8, and 10 based on the change storage resource record corresponding to the volume type, and updates the volume resource data in the cache space.
[0175] When retrieving the latest data for Volumes 1, 3, 8, and 10, the update control module can choose to execute the `listvolume` collection view once, or execute the corresponding single-object views for Volumes 1, 3, 8, and 10 separately, based on the historical execution time of the collection view and single-object view. After retrieving the latest data, the update control module can extract only the volume identifier and its corresponding data content, generate `map0`, and use `map0` to update the snapshot corresponding to the volume type. After updating the snapshot, the update control module can clear the old parsed resource objects corresponding to Volumes 1, 3, 8, and 10 from the cache space. Subsequently, the data content in the snapshot will only be deeply parsed into parsed resource objects when a user accesses the corresponding volume resource data.
[0176] If a user opens the volume resource page and generates an access request before 8:55, for example at 8:40, the update control module can first check whether there are any pending changes to the volume resource data requested by the access request. If the target change information corresponding to `listvolume` still exists in the information queue, the update control module can first update the volume resource data in the cache space according to the target change information, delete the target change information from the information queue, and then generate a resource object based on the updated volume resource data and return it to the initiator of the access request. Thus, when no access request occurs, reference change information can be merged and recorded and processed until the target update time; when an access request occurs, the pending changes corresponding to the access request can be processed first, and then the resource object can be returned.
[0177] In the preferred embodiment described above, the update control module first uses the last update time of the resource data in the cache space as a reference update time, and determines the target update time based on historical access information. Then, within the first time interval between the reference update time and the target update time, it receives and merges reference change information. After the target update time arrives, it retrieves the resource change record to be updated from the information queue and places it into the processing queue Q. The resource data in the cache space is then updated by traversing the processing queue Q. Simultaneously, when updating resource data, either a collection acquisition method or a single object acquisition method can be selected based on historical time consumption. After obtaining the latest resource data, a shallow parsing is performed first to update the snapshot, without immediately generating the resource object. When an access request arrives, a deep parsing is performed as needed to obtain the resource object and return it. Therefore, the timing of resource data updates can be controlled by combining historical access patterns, access probabilities, and actual access requests. This avoids resource waste caused by frequent updates and frequent object parsing when resource data is not accessed, while ensuring the timeliness and accuracy of returned data when resource data is accessed.
[0178] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0179] This embodiment also provides a resource data update control device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0180] Figure 7 This is a structural block diagram of a resource data update control device according to an embodiment of this application; as shown below. Figure 7 As shown, it includes:
[0181] The acquisition module 702 is used to acquire the reference update time of the cache space, wherein the cache space caches resource data of at least one storage resource, the resource data of the at least one storage resource is used to display the resource attributes of the at least one storage resource, and the reference update time is the time when the resource data cached in the cache space was last updated.
[0182] The determining module 704 is used to determine the target update time of the cache space based on the historical access information of the cache space before the reference update time, wherein the historical access information is used to indicate the historical access status of the resource data cached in the cache space, and the target update time is before the target access time of the next access to the resource data cached in the cache space;
[0183] The update module 706 is used to update the resource data cached in the cache space at the target update time according to the reference change information received within a first time interval, wherein the reference change information is used to indicate the change status of the at least one storage resource, and the first time interval is the time interval between the reference update time and the target update time.
[0184] The update control device provided in the embodiments of this application is also configured to execute the steps in any of the above-described resource data update control method embodiments, which will not be repeated here. For a description of the features corresponding to the resource data update control device embodiments, please refer to the relevant descriptions of the resource data update control method embodiments, which will not be repeated here.
[0185] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above-described resource data update control method embodiments.
[0186] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described resource data update control method embodiments when running.
[0187] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0188] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described resource data update control method embodiments.
[0189] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described resource data update control method embodiments.
[0190] Any of the components, modules, units, parts, methods, and operations described herein can be implemented using software, firmware, hardware (e.g., fixed logic circuitry), manual processing, or any combination thereof. Alternatively or additionally, any functionality described herein can be performed at least in part by one or more hardware logic components, such as, but not limited to, CPUs, FPGAs, Application-Specific Integrated Circuits (ASICs), Application-Specific Standard Products (ASSPs), Systems on Chips (SoCs), Complex Programmable Logic Devices (CPLDs), Microcontroller Units (MCUs), etc. The terms "system," "computing device," or "apparatus" used herein encompass various means, devices, and machines for processing data, including, for example, one or more programmable processors, computers, SoCs, or combinations thereof. The apparatus may also include code that creates an execution environment for the computer program in question, such as code constituting processor firmware, protocol stacks, database management systems, operating systems, cross-platform runtime environments, virtual machines, or combinations thereof. The aforementioned computer program (also known as a program, software, software application, application (APP), script, or code) can be written in any form of programming language, including compiled or interpreted languages, declarative or procedural languages, and can be deployed in any form, including as a standalone program or as a module, component, subroutine, object, or other unit suitable for a computing environment.
[0191] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0192] The above provides a detailed description of a resource data update control method provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A method for controlling the update of resource data, characterized in that, include: Obtain the reference update time of the cache space, wherein the cache space caches resource data of at least one storage resource, the resource data of the at least one storage resource is used to display the resource attributes of the at least one storage resource, and the reference update time is the time when the resource data cached in the cache space was last updated; The target update time of the cache space is determined based on the historical access information of the cache space before the reference update time, wherein the historical access information is used to indicate the historical access status of the resource data cached in the cache space, and the target update time is before the target access time of the next access to the resource data cached in the cache space; At the target update time, the resource data cached in the cache space is updated according to the reference change information received within the first time interval, wherein the reference change information is used to indicate the change status of the at least one storage resource, and the first time interval is the time interval between the reference update time and the target update time. The step of determining the target update time of the cache space based on the historical access information of the cache space before the reference update time includes: Based on at least one historical access time prior to the reference update time, the access distribution information of the resource data cached in the cache space is detected, wherein the historical access information includes the at least one historical access time, and the access distribution information is used to indicate the temporal distribution pattern of the historical access of the resource data cached in the cache space. Predict the target access time based on the access distribution information; The target update time is determined from the time interval between the reference update time and the target access time; The step of detecting access distribution information of resource data cached in the cache space based on at least one historical access time prior to the reference update time includes: The historical access status and target time interval of each reference sub-interval before the reference update time are detected as the access distribution information. The historical time before the reference update time is divided into at least one second time interval according to the target duration. Each second time interval includes multiple reference times, which include the start and end times of the second time interval. Each second time interval is divided into multiple reference sub-intervals. Each reference sub-interval is a time interval between the start time and each of the other reference times among the multiple reference times excluding the start time. The historical access status is used to indicate the distribution of the at least one historical access time in the corresponding reference sub-interval. The target time interval is the time interval from the corresponding reference sub-interval to the reference update time.
2. The method according to claim 1, characterized in that, The step of predicting the target access time based on the access distribution information includes: The access parameters of each sub-interval set are calculated based on the historical access status of the corresponding sub-intervals included in each sub-interval set and the target time interval. The corresponding sub-intervals are sub-intervals located at the same position in each of the at least one second time interval. The access parameters are used to indicate the probability that the resource data cached in the cache space within the target sub-interval located at the target position in the target interval with a target duration after the reference update time is accessed. The target position is the position of the corresponding sub-interval in the second time interval. The target sub-interval set is selected from the plurality of sub-interval sets based on the access parameters; The target access time is determined based on the sub-interval lengths of the sub-intervals included in the target sub-interval set and the reference update time.
3. The method according to claim 2, characterized in that, The step of calculating the access parameters of each sub-interval set based on the historical access status of the corresponding sub-intervals included in each sub-interval set and the target time interval includes: When the plurality of sub-interval sets includes N sub-interval sets, and each sub-interval set includes M corresponding sub-intervals, the access parameters of the nth sub-interval set are calculated through the following steps, where N and M are integers greater than 1, n is an integer greater than or equal to 1 and less than or equal to N, and m is an integer greater than or equal to 1 and less than or equal to M: The reference access parameters of the mth co-position sub-interval are calculated based on the historical access status of the mth co-position sub-interval and the time weight parameter of the mth co-position sub-interval. The time weight parameter is determined based on the target time interval. The smaller the target time interval, the larger the corresponding time weight parameter. The access parameters of the nth sub-interval set are calculated based on the reference access parameters corresponding to each corresponding sub-interval in the nth sub-interval set.
4. The method according to claim 3, characterized in that, The step of calculating the access parameters of the nth sub-interval set based on the reference access parameters corresponding to each corresponding sub-interval in the nth sub-interval set includes: Select a target corresponding sub-interval from each corresponding sub-interval included in the nth sub-interval set, wherein the target corresponding sub-interval is a corresponding sub-interval whose historical access status indicates that there is at least one historical access time within the corresponding corresponding sub-interval. The access parameters of the nth sub-interval set are calculated based on the reference access parameters corresponding to each of the target co-position sub-intervals.
5. The method according to claim 2, characterized in that, The step of filtering the target sub-interval set from the plurality of sub-interval sets according to the access parameters includes: Search for a set of candidate sub-intervals from the plurality of sub-interval sets whose access parameters are greater than the parameter threshold; If the candidate sub-interval set is found, the set of sub-intervals whose corresponding sub-intervals are located at the beginning of the second time interval is determined as the target sub-interval set. If the candidate sub-interval set is not found, the set of sub-intervals whose co-position sub-intervals are located latest in the second time interval among the multiple sub-interval sets is determined as the target sub-interval set.
6. The method according to claim 2, characterized in that, The step of determining the target access time based on the sub-interval lengths of the sub-intervals included in the target sub-interval set and the reference update time includes: The time interval between the reference update time and the reference update time, which is equal to the length of the sub-interval, is determined as the target access time.
7. The method according to claim 1, characterized in that, The method further includes: Predict the current access status of the cache space based on the historical access information; If the access status is active, the target duration is determined as the first duration; If the access status is not the active status, the target duration is determined as the second duration; Wherein, the first duration is shorter than the second duration.
8. The method according to claim 1, characterized in that, Determining the target update time of the cache space based on its historical access information prior to the reference update time includes: Predict the current access status of the cache space based on the historical access information; When the access status is active, the target update time of the cache space is determined based on the historical access information of the cache space before the reference update time; If the access status is not the active status, the target update time is generated based on the reference update time and the preset update cycle.
9. The method according to claim 1, characterized in that, Determining the target update time of the cache space based on its historical access information prior to the reference update time includes: Extract the target access information corresponding to the target resource type from the multiple resource types from the historical access information, wherein the at least one storage resource is divided into the multiple resource types; The target update time is determined based on the target access information, which corresponds to the target resource data in the cache space.
10. The method according to claim 9, characterized in that, The step of updating the resource data cached in the cache space at the target update time based on the reference change information received within the first time interval includes: At the target update time, the target resource data is updated according to the resource change information corresponding to the target resource type in the resource type and change information with corresponding relationships. The reference change information includes the resource type and change information with corresponding relationships.
11. The method according to claim 10, characterized in that, The step of updating the target resource data at the target update time based on the resource change information corresponding to the target resource type in the resource type and change information with corresponding relationships includes: At the target update time, the target information queue corresponding to the target resource type is searched from the resource types and information queues with corresponding relationships. The target information queue records, without repetition, the changed storage resources belonging to the target resource type that have changed within the first time interval, according to the order in which the change information is received. Update the target resource data according to the target information queue.
12. The method according to claim 1, characterized in that, The step of updating the resource data cached in the cache space at the target update time based on the reference change information received within the first time interval includes: Detect access requests, wherein the access requests are used to request access to resource data cached in the cache space; Upon detecting the access request, update the cached resource data in the cache space according to the target change information received within the third time interval, wherein the third time interval is the time interval between the reference update time and the current time; execute the access request; If no access request is detected, the resource data cached in the cache space is updated at the target update time based on the reference change information received within the first time interval.
13. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the resource data update control method as described in any one of claims 1 to 12 when executing the computer program.
Citation Information
Patent Citations
Storage device, control program and control method
JP2018194947A