A data processing method, related apparatus and device

CN115686816BActive Publication Date: 2026-10-09TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110875144.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-30
Publication Date
2026-10-09
Estimated Expiration
2041-07-30

AI Technical Summary

Technical Problem

但是,当业务数据量较大时,就需要Cache中的数据频繁完成置换,而传统的Cache置换技术,难以对有效识别出周期性需要被访问的数据,容易造成这些周期性需要被访问的数据被Cache置换出去了,使得在业务访问进程再次对这些数据进行访问时候,因为无法在Cache中获取到,则必须要从硬盘中重新读取这些数据,容易增加读取数据的时延,从而导致业务运行效率降低

Benefits of technology

[0048]By acquiring a data list and retrieving the access status and periodic access interval corresponding to the data block identifier from the data list, when the access status and periodic access interval meet the preset periodic access conditions, the data block corresponding to the data block identifier is identified as the target data block. Then, when a data read instruction is received from an application task, the data in the target data block is provided to the application task. Through this method, by identifying target data blocks that will be accessed periodically and retaining the data in the target data blocks to prevent them from being replaced, the data can be directly provided to the application task when the target data block is accessed periodically, without having to reread the data from the hard drive. This reduces data read latency and improves operating efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115686816B_ABST
    Figure CN115686816B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a data processing method, related device and equipment, which are used for reducing the time delay of reading data and improving the operation efficiency of data processing. The method comprises the following steps: obtaining a data block identifier of a data block to be processed; obtaining a visited state corresponding to the data block identifier and a periodic access interval corresponding to the data block identifier from a data list according to the data block identifier, the data list being used for recording a mapping relationship between the data block identifier of each data block, the visited state of each data block and the periodic access interval of each data block, the data block being used for caching data of an application, the periodic access interval being an average time interval calculated according to any two adjacent visited time points; if the visited state and the periodic access interval satisfy a preset periodic access condition, determining the data block corresponding to the data block identifier as a target data block; and when a data reading instruction of an application task is received, providing data in the target data block to the application task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a data processing method, related apparatus and equipment. Background Technology

[0002] With the rapid development of information technology, the scale of website development is constantly increasing, and the number of website visits is also increasing day by day. This can easily lead to increased website pressure and reduced efficiency in handling access due to high-frequency access. The use of caching can alleviate the pressure brought by high-frequency access. However, the capacity of the cache is limited. When the cache capacity is exhausted, if new content needs to be added to the cache, some of the existing content needs to be selected and discarded from the cache to free up space for the new content.

[0003] Traditional cache replacement techniques typically move data to the head of the cache list whenever a cache hit occurs (i.e., cached data is accessed), and discard data at the tail of the list when the cache list is full. However, when dealing with large volumes of business data, frequent cache replacements are required. Traditional cache replacement techniques struggle to effectively identify periodically accessed data, often resulting in this data being replaced by the cache. Consequently, when business processes access this data again, it cannot be retrieved from the cache and must be read from the hard drive, increasing latency and reducing operational efficiency. Summary of the Invention

[0004] This application provides a data processing method, related apparatus, and device for identifying target data blocks that will be accessed periodically and retaining the data in the target data blocks to prevent them from being replaced. This allows the data to be directly provided to application tasks when the target data blocks are accessed periodically, without having to reread the data from the hard disk, thereby reducing the latency of reading data and improving operating efficiency.

[0005] In view of this, this application provides a data processing method, comprising:

[0006] Obtain the data block identifier of the data block to be processed;

[0007] Based on the data block identifier, the access status and periodic access interval corresponding to the data block identifier are obtained from the data list. The data list is used to record the mapping relationship between the data block identifier of each data block, the access status of each data block, and the periodic access interval of each data block. The data block is used to cache the application's data. The periodic access interval is the average time interval calculated based on any two adjacent access time points.

[0008] If the accessed status and the periodic access interval meet the preset periodic access conditions, then the data block to be processed corresponding to the data block identifier will be identified as the target data block.

[0009] When a data read instruction is received from an application task, the data in the target data block is provided to the application task.

[0010] Another aspect of this application provides a data processing apparatus, comprising:

[0011] The acquisition unit is used to acquire the data block identifier of the data block to be processed.

[0012] The acquisition unit is also used to obtain the access status and periodic access interval corresponding to the data block identifier from the data list according to the data block identifier. The data list is used to record the mapping relationship between the data block identifier of each data block, the access status of each data block and the periodic access interval of each data block. The data block is used to cache the application's data. The periodic access interval is the average time interval calculated based on any two adjacent access time points.

[0013] The determining unit is used to determine the data block to be processed corresponding to the data block identifier as the target data block if the accessed state and the periodic access interval meet the preset periodic access conditions.

[0014] The processing unit is used to provide the data in the target data block to the application task when it receives a data read instruction from the application task.

[0015] In one possible design, in another implementation of the embodiments of this application,

[0016] The processing unit is also used to mark the cached data in the data block corresponding to the block identifier as replaceable data if the accessed state or periodic access interval does not meet the preset periodic access conditions.

[0017] The processing unit is also used to delete replaceable data in the data block when it receives a data read instruction from an application task;

[0018] The acquisition unit is also used to acquire data for the corresponding application task from the data storage medium according to the data reading instruction;

[0019] The processing unit is also used to store the acquired application task data into a data block and to provide the application task data to the application task.

[0020] In one possible design, in another implementation of the embodiments of this application, the processing unit may specifically be used for:

[0021] Receive data read instructions from application tasks, wherein the data read instructions carry data block identifiers;

[0022] Based on the data block identifier, retrieve the task name corresponding to the data block identifier from the data list;

[0023] If the task name matches the application task name, then obtain the access status corresponding to the data block identifier;

[0024] If the accessed state is a periodic access state, then the data in the target data block corresponding to the periodic access state will be provided to the application task.

[0025] In one possible design, in another implementation of the embodiments of this application,

[0026] The acquisition unit is also used to acquire the current access time point, which is the time point when the data read instruction of the application task is received;

[0027] The processing unit is also used to calculate the access interval based on the current access time and the periodic access interval;

[0028] The processing unit is also used to update the data list based on the current access time and the access interval if the access interval is greater than a preset time interval.

[0029] In one possible design, in another implementation of the embodiments of this application,

[0030] The acquisition unit is also used to retrieve the historical access time point corresponding to the data block identifier from the data list based on the data block identifier;

[0031] The processing unit is also used to calculate the time interval based on the current access time and historical access time.

[0032] The processing unit is also used to update the data list based on the current access time and the time interval if the time interval is greater than the preset period interval.

[0033] In one possible design, in another implementation of the embodiments of this application,

[0034] The acquisition unit is also used to acquire the number of accessed time points corresponding to the data block identifier if the accessed state is a non-periodic access state.

[0035] The processing unit is also used to update the data list based on the current access time and time interval if the number of accessed time points is less than the preset number of time points;

[0036] The processing unit is also used to delete data in the data block corresponding to the data block identifier based on the current access time.

[0037] In one possible design, in another implementation of the embodiments of this application, the processing unit may specifically be used for:

[0038] If the cached data in the target data block has been replaced, the data identifier of the data to be accessed is determined from the data list based on the data block identifier of the target data block.

[0039] The data to be accessed is retrieved from the data storage medium based on the data identifier and stored in the target data block.

[0040] When a data read instruction is received from an application task, the data to be accessed is provided to the application task.

[0041] Another aspect of this application provides a computer device, including: a memory, a transceiver, a processor, and a bus system;

[0042] The memory is used to store programs;

[0043] The processor implements the methods described above when executing a program in memory;

[0044] Bus systems are used to connect memory and processor to enable communication between them.

[0045] Another aspect of this application provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the methods described above.

[0046] Another aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a network device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the network device to perform the methods provided in the above aspects.

[0047] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0048] By acquiring a data list and retrieving the access status and periodic access interval corresponding to the data block identifier from the data list, when the access status and periodic access interval meet the preset periodic access conditions, the data block corresponding to the data block identifier is identified as the target data block. Then, when a data read instruction is received from an application task, the data in the target data block is provided to the application task. Through this method, by identifying target data blocks that will be accessed periodically and retaining the data in the target data blocks to prevent them from being replaced, the data can be directly provided to the application task when the target data block is accessed periodically, without having to reread the data from the hard drive. This reduces data read latency and improves operating efficiency. Attached Figure Description

[0049] Figure 1 This is a schematic diagram of the architecture of a data control system in an embodiment of this application;

[0050] Figure 2 This is a schematic diagram of one embodiment of the data processing method in this application;

[0051] Figure 3 This is a schematic diagram of another embodiment of the data processing method in this application;

[0052] Figure 4 This is a schematic diagram of another embodiment of the data processing method in this application;

[0053] Figure 5 This is a schematic diagram of another embodiment of the data processing method in this application;

[0054] Figure 6 This is a schematic diagram of another embodiment of the data processing method in this application;

[0055] Figure 7 This is a schematic diagram of another embodiment of the data processing method in this application;

[0056] Figure 8 This is a schematic diagram of another embodiment of the data processing method in this application;

[0057] Figure 9 This is a schematic diagram illustrating the principle of the data processing method in the embodiments of this application;

[0058] Figure 10 This is another schematic diagram illustrating the principle of the data processing method in the embodiments of this application;

[0059] Figure 11 This is a schematic diagram of one embodiment of the data processing apparatus in this application;

[0060] Figure 12 This is a schematic diagram of one embodiment of the computer device described in this application. Detailed Implementation

[0061] This application provides a data processing method, related apparatus, and device for identifying target data blocks that will be accessed periodically and retaining the data in the target data blocks to prevent them from being replaced. This allows the data to be directly provided to application tasks when the target data blocks are accessed periodically, without having to reread the data from the hard disk, thereby reducing the latency of reading data and improving operating efficiency.

[0062] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “corresponding to,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0063] It should be understood that the data processing method provided in this application can be applied to scenarios where application business data is read by replacing application data in the cache. For example, replacing playback data in the cache can be used to read the most recently played video data of a video website. Another example is replacing display data in the cache to read the latest sales data of a product on a shopping website. Yet another example is replacing display data in the cache to read the most recently downloaded textbook data of an educational website. In these scenarios, to replace application data, the existing solution is to move the data to the head of the cache's linked list, so that when the cache's linked list is full, the data at the tail of the linked list is discarded. However, because it is difficult to effectively identify periodically accessed data, this periodically accessed data is easily replaced by the cache. When the business access process accesses this data again, it cannot retrieve it from the cache, and therefore must reread the data from the hard drive. Furthermore, sometimes there is a lot of random data, which increases the data reading latency, thus reducing business execution efficiency.

[0064] To address the aforementioned problems, this application proposes a data processing method, which is applied to... Figure 1 Please refer to the data control system shown. Figure 1 , Figure 1 This is a schematic diagram of the architecture of the data control system in an embodiment of this application, such as... Figure 1 As shown, the server obtains a data list and, based on the data block identifier, retrieves the access status and periodic access interval corresponding to the data block identifier from the data list. When the access status and periodic access interval meet preset periodic access conditions, the data block corresponding to the data block identifier is identified as the target data block. Then, when a data read instruction from the application task sent by the terminal device is received, the data in the target data block is provided to the application task. Through this method, by identifying target data blocks that will be accessed periodically and retaining the data in the target data blocks to prevent them from being replaced, the server can directly provide the data to the application task when the target data block is accessed periodically, without having to reread the data from the hard drive. This reduces data read latency and improves operating efficiency.

[0065] Understandable Figure 1 Only one type of terminal device is shown in the diagram. In real-world scenarios, many more types of terminal devices can participate in the data processing, such as personal computers (PCs). The specific number and types depend on the actual scenario and are not limited here. Additionally, Figure 1 The diagram shows one server, but in real-world scenarios, multiple servers can be involved, especially in scenarios involving multi-model training and interaction. The number of servers depends on the specific scenario and is not limited here.

[0066] It should be noted that in this embodiment, the server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal device can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, and the terminal device and the server can be connected to form a blockchain network; this application does not impose any restrictions.

[0067] To address the aforementioned issues, this application proposes a data processing method, which is generally executed by a server or terminal device. Accordingly, the apparatus used for data processing is generally located within the server or terminal device.

[0068] It is understood that, as disclosed in this application, the data processing method, related equipment, and apparatus can comprise a blockchain, with multiple servers / terminal devices forming nodes on the blockchain. In practical applications, data sharing between nodes is required within the blockchain, and each node can store application data.

[0069] The data processing methods used in this application will be described below. Please refer to [link / reference]. Figure 2 as well as Figure 9 One embodiment of the data processing method in this application includes:

[0070] In step S101, the data block identifier of the data block to be processed is obtained;

[0071] In step S102, the access status and periodic access interval corresponding to the data block identifier are obtained from the data list according to the data block identifier. The data list is used to record the mapping relationship between the data block identifier of each data block, the access status of each data block, and the periodic access interval of each data block. The data block is used to cache the application's data. The periodic access interval is the average time interval calculated based on any two adjacent access time points.

[0072] In this embodiment, after obtaining the data block identifier of the data block to be processed, in order to enable the application task to accurately and quickly read the application data from the cache when it needs to read and write the relevant application data, this embodiment can obtain a data list so that the corresponding data block can be quickly accessed and the application data cached in the data block can be read according to the mapping relationship between the data block identifier of each data block, the access status of each data block and the periodic access interval of each data block recorded in the data list.

[0073] Specifically, the data accessed periodically can be data in certain fixed locations, perhaps fixed database data, or other periodically accessed data, such as data in certain fixed file locations, or metadata in certain fixed physical locations, etc. No specific restrictions are made here.

[0074] Specifically, such as Figure 10As shown, this embodiment obtains multiple data blocks that can be used to cache application data by creating a bitmap table. The bitmap can include multiple bits, each bit representing a physical data block on disk. The data block identifier, also known as the block identity (blockID), indicates the physical space where application data can be cached. The data block identifier can be represented as an integer string, a string, or other forms; no specific limitations are imposed here.

[0075] Furthermore, since application tasks that require periodic reading and writing of related application data can contain multiple periodic sub-tasks, and the frequency of disk access for each sub-task can be different, each application task that requires periodic reading and writing of related application data can be configured with a corresponding configuration file. The configuration file is the file that drives the application task to periodically read application data. The configuration file can specifically include configuration information such as the task name of each sub-task in the application task, the interval time for each sub-task to access data, and the error range of the periodic data access interval. The configuration file can be in the form of a configuration table (configure_table), or other forms, without specific restrictions here.

[0076] For example, the configuration file for application task 'a', which requires periodically reading and writing data related to other applications, would look like this:

[0077] {Process_a,

[0078] {Process_a_task_1, Process_a_task_1_Interval_time, Process_a_task_1_offset_time}

[0079] {Process_a_task_2, Process_a_task_2_Interval_time, Process_a_task_2_offset_time},

[0080] ...}

[0081] }

[0082] Where Process_a represents the name of application task a, Process_a_task_1 represents the name of a subtask within application task a, namely task_1, Process_a_task_1_Interval_time represents the interval between periodic data accesses by task_1 within application task a, and Process_a_task_1_offset_time represents the error range of the periodic data access interval for task_1 within application task a.

[0083] Similarly, Process_a_task_2 represents the name of a subtask in application task a, namely task_2, Process_a_task_2_Interval_time represents the interval between periodic data accesses by task_2 in application task a, and Process_a_task_2_offset_time represents the error range of the periodic data access interval of task_2 in application task a.

[0084] For example, the configuration file for another application task, b, which requires periodic reading and writing of data from related applications, contains the following:

[0085] {Process_b,

[0086] {Process_b_task_1, the interval for periodic data access, and the interval error range},

[0087] {Process_b_task_2, the interval for periodic data access, and the interval error range},

[0088] ...

[0089] }

[0090] The meaning of Process_b is similar to that of Process_a, and the meanings of Process_b_task_1 and Process_b_task_2 are similar to those of Process_a_task_1 and Process_a_task_2, respectively. These will not be elaborated upon here.

[0091] Furthermore, after obtaining the configuration file of the application task that needs to periodically read and write related application data, this embodiment can use the block_table structure information to construct the mapping relationship between the data block identifier of each data block, the access status of each data block, and the periodic access interval of each data block to obtain a data list. Other structures are also possible; no specific limitations are imposed here. Furthermore, as... Figure 9As shown, this embodiment can determine whether the application data in the data block recorded in the data list is periodically accessed by performing timed or real-time detection on the data list. This allows for subsequent operations on the data in the data block based on the determined results, thereby preventing the periodically accessed application data from being replaced.

[0092] Furthermore, after obtaining the data block identifier of the data block to be processed, the field information of the accessed status and periodic access interval corresponding to the data block identifier can be quickly indexed in the data list based on the mapping relationship between the data block identifier and the accessed status and periodic access interval. This allows the data block to be quickly determined as to be a data block that is periodically accessed based on the field information of the accessed status and periodic access interval.

[0093] Furthermore, the access status of a data block can be either periodic or non-periodic, which can be represented by fields such as `periodicity_block` in the data list, or other fields, without specific restrictions here. For example, if the access status field `periodicity_block == 0`, it can be understood as the data block being accessed 0 times recently, meaning it has not been periodically accessed by application tasks, indicating a non-periodic access status. Conversely, if the access status field `periodicity_block == ! 0`, it can be understood as the data block being accessed not 0 times recently, possibly through continuous or periodic access by application tasks, indicating a periodic access status.

[0094] Furthermore, the periodic access interval of the data block can be calculated from the access time point when the data block is periodically accessed by the application task. It can be used to compare with the time interval of periodic access data configured in the configuration file to determine whether the application data cached in the data block is periodically accessed. Each access time point can be represented by fields such as process_task_x_timelist[N], or other fields. No specific restrictions are made here.

[0095] In step S103, if the accessed state and the periodic access interval meet the preset periodic access conditions, the data block to be processed corresponding to the data block identifier is determined as the target data block.

[0096] In this embodiment, after obtaining the access status and periodic access interval corresponding to the data block identifier, it is possible to determine whether the data block is a data block that is periodically accessed by the application task, i.e., the target data block, by judging whether the access status and periodic access interval meet the preset periodic access conditions.

[0097] Specifically, such as Figure 9 As shown, the preset periodic access conditions are set according to actual application requirements. Specifically, this can be manifested as the data block being accessed periodically, and the error between the periodic access interval and the periodic access data interval configured for the application task in the configuration file falling within the error range configured for the application task in the configuration file. Other conditions can also be used, but no specific restrictions are imposed here. After obtaining the accessed state and periodic access interval corresponding to the data block identifier, if the accessed state and periodic access interval meet the preset periodic access conditions, it can be understood that the obtained accessed state field information shows that the accessed state is a periodic access state. Furthermore, by calculating the absolute value of the difference between the obtained periodic access interval and the configured periodic access data time interval, and if this absolute value falls within the error range of the configured periodic access data time interval, it can be understood that the application task periodically accesses the application data cached in the data block within the allowable access time error range. Therefore, this data block can be identified as the data block periodically accessed by the application task, i.e., the target data block.

[0098] For example, suppose that a data block identifier has a periodicity_block value of ! 0 or periodicity_block > 0, which indicates that the accessed state is a periodic access state. Suppose that the periodic access interval corresponding to the data block identifier is 10s, the configured periodic access data time interval is 8s, and the error range of the configured periodic access data time interval is between 1s and 3s. The difference between the periodic access interval and the configured periodic access data time interval is 2s, which is clearly within the error range of the configured periodic access data time interval. That is, the accessed state and the periodic access interval meet the preset periodic access conditions.

[0099] In step S104, when a data read instruction is received from the application task, the data in the target data block is provided to the application task.

[0100] In this embodiment, after receiving the data read instruction from the application task, the application data cached in the target data block can be directly provided to the application task. This allows the application task to quickly read the required application data directly from the target data block when it periodically accesses the target data block. This eliminates the need for the application task to read all the data stored on the hard drive to obtain the required application data, thereby reducing the latency of the application task reading the application data and improving the running efficiency of the application task.

[0101] Specifically, such as Figure 9As shown, after determining the target data block, this embodiment can set the retention settings for the application data cached in the target data block, so that the application data cached in the target data block can be retained in the cache and not replaced by the cache. Then, when the application task's data read instruction is received, the data block to be accessed by the application task can be determined first according to the data block identifier carried by the application task. If the application task wants to access the target data block, the application data cached in the target data block can be quickly provided to the application task.

[0102] Furthermore, it is understood that when the application data cached in the target data block is quickly provided to the application task, this embodiment can also record or update information such as the access time and access status generated when the application task accesses the target data block through a data list, so as to ensure the accuracy and effectiveness of the data list.

[0103] In this application embodiment, a data processing method is provided. By the above method, the target data block that will be accessed periodically is identified, and the data in the target data block is retained to avoid being replaced. When the target data block is accessed periodically, the data can be directly provided to the application task without having to read the data from the hard disk again, which can reduce the latency of reading data and thus improve the operating efficiency.

[0104] Optionally, in the above Figure 2 Based on the corresponding embodiments, in another optional embodiment of the data processing method provided in this application, such as... Figure 3 As shown, the method also includes:

[0105] In step S301, if the accessed state or periodic access interval does not meet the preset periodic access conditions, the cached data in the data block corresponding to the block identifier is marked as replaceable data.

[0106] In step S302, when a data read instruction from an application task is received, replaceable data in the data block is deleted;

[0107] In step S303, the data of the corresponding application task is obtained from the data storage medium according to the data reading instruction;

[0108] In step S304, the acquired application task data is stored in a data block, and the application task data is provided to the application task.

[0109] In this embodiment, after obtaining the access status and periodic access interval corresponding to the data block identifier, if the access status or periodic access interval does not meet the preset periodic access conditions, it can be understood that the data block is a data block that has not been periodically accessed by the application task. Figure 9 As shown, in this embodiment, cached data in a data block can be marked as replaceable data. This can be understood as data that can be preferentially released when the data block is accessed again by the application task, i.e., data that will be preferentially replaced by the cache. Then, the application data that has been read again can be stored in a data block with storage space, and then the stored application data can be provided to the application task.

[0110] Specifically, such as Figure 9 As shown, after obtaining the access status and periodic access interval corresponding to the data block identifier, if the access status or periodic access interval does not meet the preset periodic access conditions, it can be understood that the field information of the obtained access status shows that the access status is a non-periodic access status. This can be understood as the application task not periodically accessing the data block. Alternatively, if the absolute value of the difference between the obtained periodic access interval and the time interval of the configured periodic access data is not within the error range of the time interval of the configured periodic access data, it can be understood that the application task does not periodically access the data block within the allowable range of access time error. Therefore, the data block can be identified as a non-periodic access data block, and the cached data in the non-periodic access data block can be marked as replaceable data that can be preferentially released.

[0111] For example, suppose that periodicity_block == 0 for the accessed state corresponding to a data block identifier can indicate that the accessed state is a periodic access state. Or, suppose that the periodic access interval corresponding to the data block identifier is 10s, the configured periodic access data time interval is 5s, and the error range of the configured periodic access data time interval is between 1s and 3s. However, the difference between the periodic access interval and the configured periodic access data time interval is 5s, which is clearly not within the error range of the configured periodic access data time interval. That is, the accessed state or the periodic access interval does not meet the preset periodic access conditions.

[0112] Furthermore, when a data read instruction from an application task is received, if the data block to be accessed by the task is a non-periodic access data block, the replaceable data in the non-periodic access data block can be deleted or released first, so that the non-periodic access data block has free storage space. Then, according to the data read instruction from the application task, the data stored in the data storage medium can be traversed to read the application data required by the application task. The data storage medium can specifically be a fixed hard drive, a portable hard drive, or a disk, or other media, without specific limitations here. Then, the read application task data can be stored in the non-periodic access data block in a timely manner, so that the application task can accurately read the data, thereby improving the stability and reliability of the application task to a certain extent.

[0113] Optionally, in the above Figure 2 Based on the corresponding embodiments, in another optional embodiment of the data processing method provided in this application, such as... Figure 4 As shown, the data list is also used to record the mapping relationship between data block identifiers and task names. When a data read instruction is received from an application task, the data in the target data block is provided to the application task, including:

[0114] In step S401, a data read instruction from the application task is received, wherein the data read instruction carries a data block identifier;

[0115] In step S402, the task name corresponding to the data block identifier is obtained from the data list according to the data block identifier;

[0116] In step S403, if the task name is the same as the application task name, the access status corresponding to the data block identifier is obtained;

[0117] In step S404, if the accessed state is a periodic access state, the data in the target data block corresponding to the periodic access state is provided to the application task.

[0118] In this embodiment, after receiving the data read instruction from the application task, the task name corresponding to the data block identifier can be obtained from the data list based on the data block identifier carried by the data read instruction. By determining whether the task name of the application task belongs to the task recorded in the configure_table table of the configuration file corresponding to the data block identifier, it can be determined whether the application task is an application task that needs to periodically read and write the data of related applications. Then, if the application task is an application task that needs to periodically read and write the data of related applications, the corresponding target data block can be determined based on the data block identifier carried by the data read instruction, and the application data cached in the data block can be provided to the application task.

[0119] Specifically, such as Figure 10 As shown, after receiving the data read instruction from the application task, the task name corresponding to the data block identifier can be obtained from the data list based on the data block identifier carried by the data read instruction. If the task name is consistent with the name of the application task, it can be understood that the task name of the application task belongs to the task recorded in the configure_table table of the configuration file corresponding to the data block identifier. That is, it is an application task that needs to periodically access the target data block and read and write the relevant application data from the target data block.

[0120] For example, a cake shop needs to read the latest price data of all pastries before opening in the morning. A price application task can be generated to obtain the latest price data of all pastries. Let's assume that the task name created for the price application task is task c, and the data block identifier is 003.

[0121] For example, suppose the configure_table configuration file corresponding to data block identifier 003 is as follows:

[0122] {blockid,periodicity_block,

[0123] {periodicity_task_c,

[0124] periodicity_task_c_timelist[N],

[0125] periodicity_task_c_last_time,

[0126] }

[0127] ...

[0128] }

[0129] Among them, data block identifier 003, that is, the field information corresponding to blockid is 003, periodicity_task_c can be interpreted as task name is task c. It can be understood that in the data list, the task name corresponding to data block identifier 003 has the field information periodicity_task_c, indicating that the task name is consistent with the name of the application task. That is, task c is a periodic access task recorded in the configure_table table of the configuration file corresponding to data block identifier 003. Then, the latest price data of all the pastries required can be read from the target data block.

[0130] It should be noted that `process_task_c_timelist[N]` can be used to represent N time points when application task c accesses the target data block. `periodicity_task_c_last_time` represents the most recent time when task c periodically accesses the data block. The field information where `periodicity_task_c_last_time == 0` can be used to indicate that the data block is not yet periodically accessed by application task c. `periodicity_task_x_last_time! = 0` can be used to indicate that the data block is periodically accessed by application task c, and the most recent periodic access time of application task c is `periodicity_task_c_last_time`. The field information of `periodicity_block` can be set to 1 to indicate that the access status of the data block is periodically accessed.

[0131] Furthermore, to prevent the application data cached in the target data block from being replaced due to emergencies or network anomalies, thus failing to provide the corresponding application data to the application task in a timely manner, this embodiment can first obtain the corresponding access status based on the data block identifier carried by the data read instruction to determine whether there is an anomaly in the target data block. If the access status has not changed, that is, the target data block retains the application data that needs to be read periodically, then the application data cached in the target data block can be provided to the application task in a timely manner without having to read the data from the hard disk again, which can reduce the latency of the application task reading data, thereby improving the running efficiency of the application task to a certain extent.

[0132] Furthermore, it can be understood that if the task name is inconsistent with the application task name, it can be understood that the task name of the application task does not belong to the task recorded in the configure_table table of the configuration file corresponding to the data block identifier. That is, it does not need to periodically access the target data block, and the application data cached in the target data block corresponding to the data block identifier cannot be directly provided to the application task.

[0133] For example, suppose an application task is named task d, and the data read instruction corresponding to task d carries a data block identifier of 004. If there is no task name field information in the data list that is similar to or consistent with task d, that is, there is no name in the data table that matches the application task name, then task d does not belong to the periodic access task recorded in the configure_table table of the configuration file corresponding to data block identifier 004. Therefore, the cached data in the target data block corresponding to data block identifier 004 cannot be directly provided to task d.

[0134] Optionally, in the above Figure 4 Based on the corresponding embodiments, in another optional embodiment of the data processing method provided in this application, such as... Figure 5 As shown, the method also includes:

[0135] In step S501, the current access time point is obtained, which is the time point when the data read instruction of the application task is received;

[0136] In step S502, the access interval is calculated based on the current access time and the periodic access interval;

[0137] In step S503, if the access interval is greater than the preset time interval, the data list is updated according to the current access time and the access interval.

[0138] In this embodiment, while the application task reads the corresponding application data from the target data block, a corresponding access time can be generated to indicate the time point when the application task's data read instruction is received. This can be understood as the time point when the application task's data read instruction is received during periodic access, i.e., the current access time point. Then, the access interval can be calculated based on the current access time point and the periodic access interval. If the access interval is greater than a preset time interval, i.e., the access interval meets the preset time interval of the application task that needs to periodically read and write the relevant application data, it can be understood that the current access time point meets the periodic time configured in the configuration file corresponding to the application task. This can further indicate that the target data block is a data block that is periodically accessed by the application task. Therefore, the current access time point can be used as the access time of the application task's most recent access to the target data block to update the access time corresponding to the target data block recorded in the data list.

[0139] Specifically, after the application task reads the corresponding application data from the target data block, this embodiment can take the time point when the application task receives the data reading instruction as the current access time point of the application task accessing the target data block, and then calculate the access interval based on the current access time point and the periodic access interval obtained from the data table.

[0140] For example, let the current access time be represented as process_x_timelist[k], and let process_x_timelist[m] be the time of the most recent access to the target data block corresponding to the periodic access interval. Let process_x_Interval_time_tmp = |periodicity_task_x_timelist[k] - periodicity_task_x_timelist[m]|, m = [0, n), k = [m + 1, N) be used to represent the access interval. Then, if the current time point process_x_timelist[k] is 20:01:12 and the process_x_timelist[m] corresponding to the periodic access interval is 20:01:10, then according to the above expression, the access interval process_x_Interval_time_tmp can be calculated to be 2s.

[0141] Furthermore, the calculated access interval can be compared with a preset time interval, or the difference between the access interval and the preset time interval can be calculated. If the access interval is greater than the preset time interval, or the difference between the access interval and the preset time interval is within the error range of the periodic access data time interval configured in the configuration file, it can be understood that the access interval conforms to the periodic access data time interval configured in the configuration file. That is, the current access time point conforms to the periodic time configured in the configuration file corresponding to the application task. In this case, it can be further determined that the target data block is a data block that is periodically accessed by the application task. Then, the current access time point can be used as the access time of the target data block most recently periodically accessed by the application task, and the access time corresponding to the target data block recorded in the data list can be updated in a timely manner, thereby improving the accuracy of the data list.

[0142] For example, continue to take the above example where the current time point process_x_timelist[k] is 20:01:12 and process_x_timelist[m] corresponding to the periodic access interval is 20:01:10, the obtained access interval is 2s. Assume that the configured time interval for periodically accessing data, that is, the preset time interval process_x_Interval_time_tmp is 1s, and the error range of the time interval for periodically accessing data configured in the configuration file is 1s to 3s. Calculation shows that the difference between the access interval and the preset time interval is 1s, which can be expressed as process_x_Interval_time_tmp-process_a_task_1_Interval_time<Process_x_task_1_offset_time, that is, the difference between the access interval and the preset time interval falls within the error range of the time interval for periodically accessing data configured in the configuration file. It can be understood that the access interval between the two time points process_x_timelist[k] and process_x_timelist[m] conforms to the configured time interval for periodically accessing data, and the access time point periodicity_task_x_last_time of the latest periodic access to the target data block by the applied task recorded in the data list can be set to the current access time point periodicity_task_x_timelist[k], that is, the access time point of the latest periodic access to the target data block by the applied task corresponding to the target data block recorded in the data list is expressed as periodicity_task_x_last_time=periodicity_task_x_timelist[k].

[0143] For example, adding periodicity_task_x_timelist[k] to the data list may specifically include: first traversing N access time points of the target data block accessed by the applied task recorded in the data list, which can be expressed as periodicity_task_x_timelist[N], to obtain the last access time point accessed by the applied task, and then adding periodicity_task_x_timelist[k] after the last access time point to obtain a new periodicity_task_x_timelist[N], thereby updating the data list.

[0144] Optionally, in the above Figure 5 Based on the corresponding embodiment, in another optional embodiment of the data processing method provided by the embodiments of the present application, as Figure 6As shown, the method also includes:

[0145] In step S601, based on the data block identifier, the historical access time point corresponding to the last accessed data block identifier is obtained from the data list;

[0146] In step S602, the time interval is calculated based on the current access time and the historical access time.

[0147] In step S603, if the time interval is greater than the preset period interval, the data list is updated according to the current access time and the time interval.

[0148] In this embodiment, after obtaining the current access time, the historical access time corresponding to the last access of the data block can be obtained from the data list based on the data block identifier. That is, the access time when the target data block was last periodically accessed by the application task. Then, the time interval can be calculated based on the current access time and the historical access time. If the time interval is greater than the preset period interval, that is, the time interval meets the preset period interval of the application task that needs to periodically read and write the data of the related application, it can be understood that the current access time meets the period time configured in the configuration file corresponding to the application task. Then, it can be further confirmed that the target data block is still the data block that is periodically accessed by the application task. Therefore, the current access time can be used as the access time of the last access of the target data block by the application task to update the access time corresponding to the target data block recorded in the data list.

[0149] Specifically, after obtaining the current access time, the historical access time corresponding to the data block identifier can be retrieved from the data list based on the data block identifier. The time interval is calculated based on the current access time and the historical access time. Then, the calculated time interval can be compared with the preset periodic interval, or the difference between the time interval and the preset periodic interval can be calculated. If the time interval is greater than the preset periodic interval, or the difference between the time interval and the preset periodic interval falls within the difference range corresponding to the periodic access data time interval configured in the configuration file, it can be understood that the time interval conforms to the periodic access data time interval configured in the configuration file. That is, the current access time conforms to the periodic time configured in the configuration file corresponding to the application task. It can then be further determined that the target data block is a data block that is periodically accessed by the application task. Then, the current access time can be used as the access time of the target data block in the most recent periodic access by the application task to update the access time corresponding to the target data block recorded in the data list, thereby improving the accuracy of the data list.

[0150] For example, let the current access time be represented as `time_current`, the historical access time as `periodicity_task_x_last_time`, and `time_current - periodicity_task_x_last_time` as the time interval. Assuming the current time `time_current` is 20:02:15 and the corresponding periodicity_task_x_last_time is 20:02:11, then according to the above expression, the time interval can be calculated to be 4 seconds. Assuming the preset periodic interval is 3 seconds, the difference range corresponding to the time interval of the periodic access data configured in the configuration file is 3 times the configured periodic access data time interval, i.e., 9 seconds. Comparing the time interval with the preset periodic interval, we can find that the time interval is greater than the preset periodic interval, or the difference between the time interval and the preset periodic interval is less than 3 times the time interval of the periodic access data configured in the configuration file. In other words, the difference between the time interval and the preset periodic interval falls within the difference range corresponding to the time interval of the periodic access data configured in the configuration file.

[0151] Furthermore, it can be understood that if the time interval is less than the preset periodic interval, or the difference between the time interval and the preset periodic interval does not fall within the range of differences corresponding to the periodic access data time interval configured in the configuration file, it can be understood that the current time interval does not conform to the periodic access data time interval configured in the configuration file. That is, the current access time does not conform to the periodic time configured in the configuration file corresponding to the application task. This can be understood as the target data block not being periodically accessed by the application task recently. Then, the periodic access data time interval configured in the data list can be cleared and set to 0, indicating that the target data block has not been periodically accessed by the application task. The access status corresponding to the target data block is updated to a non-periodic access status, and the current access time is taken as the access time of the most recent access to the target data block by the application task, so as to update the access time corresponding to the target data block recorded in the data list, thereby improving the accuracy of the data list.

[0152] For example, assuming the periodic access time interval configured in the configuration file is 1 second, the current time point `time_current` is 20:02:18, and the corresponding `periodicity_task_x_last_time` is 20:02:13, the difference between the time interval and the preset periodic interval is 5 seconds. Assuming the difference range corresponding to the periodic access time interval configured in the configuration file is 3 times the time interval, it is clear that 5 seconds > 3 seconds, i.e., `time_current - periodicity_task_x_last_time` > 3 * `Process_a_task_1_Interval_time`. This can be understood as no application task accessing the target data block for three consecutive periods. Therefore, setting `Process_x_task_1_offset_time` to 0 (clearing and setting the periodic access time interval configured in the data list to 0) and setting `periodicity_block` to 0 (clearing and setting the access status field information of the target data block to 0) can update the access status of the target data block to a non-periodic access status, indicating that the target data block is no longer a periodically accessed data block.

[0153] Optionally, in the above Figure 4 Based on the corresponding embodiments, in another optional embodiment of the data processing method provided in this application, such as... Figure 7 As shown, the method also includes:

[0154] In step S701, if the accessed state is a non-periodic access state, then the number of accessed time points corresponding to the data block identifier is obtained;

[0155] In step S702, if the number of accessed time points is less than the preset number of time points, the data list is updated according to the current access time point and the time interval.

[0156] In step S703, based on the current access time, the data in the data block corresponding to the data block identifier is deleted.

[0157] In this embodiment, after the task name obtained from the data list matches the name of the application task, this embodiment can first obtain the corresponding accessed state according to the data block identifier carried by the data reading instruction. If the accessed state changes to a non-periodic access state, it can be understood that the application data cached in the target data block may no longer need to be read periodically, so the data in the target data block can be released. At the same time, the number of accessed time points corresponding to the data block identifier can also be obtained to update the data list.

[0158] Specifically, when the task name obtained from the data list matches the application task name, this embodiment can first obtain the corresponding access status based on the data block identifier carried by the data read instruction. If the access status is a non-periodic access status, it can be understood that the application data cached in the target data block may not need to be read periodically. In the non-periodic state, a corresponding access time will also be generated to indicate the time point when the application task's data read instruction is received, that is, the current access time point when the application task's data read instruction is received in the non-periodic state. Then, based on the current access time point, the application data cached in the target data block can be deleted or released, and new application data can be obtained and stored in the target data block to be provided to the application task in a timely manner. At the same time, the number of access time points corresponding to the data block identifier can be obtained. If the number of access time points in the data list is less than the preset number of time points, it can be understood that the number of access time points in the data list has not yet met the number of time points that the data list can accommodate. The current access time point can be directly added to the data list as the access time of the application task's most recent access to the target data block to update the access time corresponding to the target data block recorded in the data list, thereby improving the accuracy of the data list.

[0159] For example, continuing with the example of adding periodicity_task_x_timelist[k] to the data list, we iterate through the data list to obtain the N access time points of the target data block accessed by the application task. Assuming the data list is set to accommodate N time points, where N is an integer greater than 1, if the number of access time points in the data list already meets the number of time points that the data list can accommodate, that is, the number of access time points in the data list reaches N, then when we obtain the first access time point and the last access time point accessed by the application task, we can first delete the obtained first access time point from the data list, and then add periodicity_task_x_timelist[k] after the last access time point to obtain a new periodicity_task_x_timelist[N], thereby updating the data list.

[0160] Optionally, in the above Figure 2 Based on the corresponding embodiments, in another optional embodiment of the data processing method provided in this application, such as... Figure 8 As shown, when a data read instruction is received from an application task, the data in the target data block is provided to the application task, including:

[0161] In step S801, if the cached data in the target data block has been replaced, the data identifier of the data to be accessed is determined from the data list based on the data block identifier of the target data block.

[0162] In step S802, the data to be accessed is obtained from the data storage medium according to the data identifier, and the data to be accessed is stored in the target data block;

[0163] In step S803, when a data read instruction is received from the application task, the data to be accessed is provided to the application task.

[0164] In this embodiment, after obtaining the target data block, if the periodically accessed data cached in the target data block is replaced due to an emergency or network anomaly, in order not to increase the latency of the application task reading the application data, this embodiment can determine the data to be accessed from the data list by the data block identifier. The data to be accessed is the application data that needs to be read in the next access cycle configured in the configuration file corresponding to the data block identifier in the data list. Therefore, in this embodiment, the data to be accessed can be obtained from the data storage medium according to the data identifier and stored in the target data block, so that when the application task receives the data reading instruction, the data to be accessed in the target data block can be provided to the application task.

[0165] Specifically, when the cached data in the target data block has been replaced, this embodiment can determine the data to be accessed by the application task when it accesses the target data block again by using the data block identifier from the data list. This allows the data to be accessed to be pre-read into the target data block for storage before the application task accesses the target data block again. Then, when the application task receives the data read instruction, the data to be accessed in the target data block can be directly provided to the application task. This means that the application task does not need to read all the data stored on the hard drive to obtain the required application data, which can reduce the latency of the application task reading the application data and thus improve the running efficiency of the application task.

[0166] The data processing apparatus of this application is described in detail below. Please refer to [link / reference]. Figure 11 , Figure 11 This is a schematic diagram of one embodiment of a data processing apparatus in this application. The data processing apparatus 20 includes:

[0167] Acquisition unit 201 is used to acquire the data block identifier of the data block to be processed;

[0168] The acquisition unit 201 is also used to obtain the access status and periodic access interval corresponding to the data block identifier from the data list according to the data block identifier. The data list is used to record the mapping relationship between the data block identifier of each data block, the access status of each data block and the periodic access interval of each data block. The data block is used to cache the application's data. The periodic access interval is the average time interval calculated based on any two adjacent access time points.

[0169] The determining unit 202 is used to determine the data block to be processed corresponding to the data block identifier as the target data block if the accessed state and the periodic access interval meet the preset periodic access conditions.

[0170] The processing unit 203 is used to provide the data in the target data block to the application task when it receives a data read instruction from the application task.

[0171] Optionally, in the above Figure 11 Based on the corresponding embodiments, in another embodiment of the data processing apparatus provided in this application,

[0172] The processing unit 203 is also used to mark the cached data in the data block corresponding to the block identifier as replaceable data if the accessed state or periodic access interval does not meet the preset periodic access conditions.

[0173] The processing unit 203 is also configured to delete replaceable data in the data block when it receives a data read instruction from an application task;

[0174] The acquisition unit 201 is also used to acquire data for the corresponding application task from the data storage medium according to the data reading instruction;

[0175] The processing unit 203 is also used to store the acquired application task data into a data block and provide the application task data to the application task.

[0176] Optionally, in the above Figure 11 Based on the corresponding embodiments, in another embodiment of the data processing apparatus provided in this application, the processing unit 203 may specifically be used for:

[0177] Receive data read instructions from application tasks, wherein the data read instructions carry data block identifiers;

[0178] Based on the data block identifier, retrieve the task name corresponding to the data block identifier from the data list;

[0179] If the task name matches the application task name, then obtain the access status corresponding to the data block identifier;

[0180] If the accessed state is a periodic access state, then the data in the target data block corresponding to the periodic access state will be provided to the application task.

[0181] Optionally, in the above Figure 11 Based on the corresponding embodiments, in another embodiment of the data processing apparatus provided in this application,

[0182] The acquisition unit 201 is also used to acquire the current access time point, which is the time point when the data reading instruction of the application task is received;

[0183] The processing unit 203 is also used to calculate the access interval based on the current access time and the periodic access interval;

[0184] The processing unit 203 is also used to update the data list according to the current access time and the access interval if the access interval is greater than a preset time interval.

[0185] Optionally, in the above Figure 11 Based on the corresponding embodiments, in another embodiment of the data processing apparatus provided in this application,

[0186] The acquisition unit 201 is also used to retrieve the historical access time point corresponding to the last access from the data list based on the data block identifier;

[0187] The processing unit 203 is also used to calculate the time interval based on the current access time and the historical access time.

[0188] The processing unit 203 is also used to update the data list according to the current access time and the time interval if the time interval is greater than the preset period interval.

[0189] Optionally, in the above Figure 11 Based on the corresponding embodiments, in another embodiment of the data processing apparatus provided in this application,

[0190] The acquisition unit 201 is also used to acquire the number of accessed time points corresponding to the data block identifier if the accessed state is a non-periodic access state;

[0191] The processing unit 203 is also used to update the data list according to the current access time and time interval if the number of accessed time points is less than the preset number of time points;

[0192] The processing unit 203 is also used to delete data in the data block corresponding to the data block identifier based on the current access time.

[0193] Optionally, in the above Figure 11Based on the corresponding embodiments, in another embodiment of the data processing apparatus provided in this application, the processing unit 203 may specifically be used for:

[0194] If the cached data in the target data block has been replaced, the data identifier of the data to be accessed is determined from the data list based on the data block identifier of the target data block.

[0195] The data to be accessed is retrieved from the data storage medium based on the data identifier and stored in the target data block.

[0196] When a data read instruction is received from an application task, the data to be accessed is provided to the application task.

[0197] This application also provides a schematic diagram of another computer device, such as... Figure 12 As shown, Figure 12 This is a schematic diagram of a computer device structure provided in an embodiment of this application. The computer device 300 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 310 (e.g., one or more processors) and a memory 320, and one or more storage media 330 (e.g., one or more mass storage devices) for storing application programs 331 or data 332. The memory 320 and storage media 330 can be temporary or persistent storage. The program stored in the storage media 330 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the computer device 300. Furthermore, the CPU 310 may be configured to communicate with the storage media 330 and execute the series of instruction operations in the storage media 330 on the computer device 300.

[0198] Computer device 300 may also include one or more power supplies 340, one or more wired or wireless network interfaces 350, one or more input / output interfaces 360, and / or one or more operating systems 333, such as Windows Server. TM Mac OS X TM Unix TM Linux TM FreeBSD TM etc.

[0199] The aforementioned computer device 300 is also used to perform, for example Figures 2 to 8 The steps in the corresponding embodiments.

[0200] Another aspect of this application provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform actions such as... Figures 2 to 8 The steps in the method described in the illustrated embodiment.

[0201] Another aspect of this application provides a computer program product containing instructions that, when run on a computer or processor, cause the computer or processor to perform actions such as Figures 2 to 8 The steps in the method described in the illustrated embodiment.

[0202] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0203] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.

[0204] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0205] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0206] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A data processing method, characterized in that, include: Obtain the data block identifier of the data block to be processed; Obtain the configuration file of the application task, the configuration file including the time interval for the application task to access data periodically and the error range of the time interval; Based on the data block identifier, the access status and periodic access interval corresponding to the data block identifier are obtained from the data list. The data list is used to record the mapping relationship between the data block identifier of each data block, the access status of each data block, and the periodic access interval of each data block. The data block is used to cache application data. The periodic access interval is the average time interval calculated based on any two adjacent access time points. If the accessed state is a periodic access state, and the error between the periodic access interval and the time interval in the configuration file is within the error range in the configuration file, then the data block to be processed corresponding to the data block identifier is determined as the target data block, and the application data cached in the target data block is retained; the target data block is the data block that is periodically accessed by the application task. When a data read instruction is received from an application task, the data in the target data block is provided to the application task.

2. The method according to claim 1, characterized in that, After obtaining the access status and periodic access interval corresponding to the data block identifier from the data list based on the data block identifier, the method further includes: If the accessed state is a non-periodic access state, or if the error between the periodic access interval and the time interval in the configuration file does not fall within the error range in the configuration file, then the cached data in the data block corresponding to the data block identifier is marked as replaceable data. When a data read instruction is received from an application task, the replaceable data in the data block is deleted; According to the data reading instruction, the corresponding application task data is obtained from the data storage medium; The acquired application task data is stored in the data block, and the application task data is provided to the application task.

3. The method according to claim 1, characterized in that, The data list is also used to record the mapping relationship between data block identifiers and task names. The step of providing the data in the target data block to the application task when a data read instruction is received from the application task includes: Receive a data read instruction from an application task, wherein the data read instruction carries a data block identifier; Based on the data block identifier, retrieve the task name corresponding to the data block identifier from the data list; If the task name is the same as the application task name, then obtain the access status corresponding to the data block identifier; If the accessed state is a periodic access state, then the data in the target data block corresponding to the periodic access state is provided to the application task.

4. The method according to claim 3, characterized in that, If the accessed state is a periodic access state, after providing the data in the target data block corresponding to the periodic access state to the application task, the method further includes: Obtain the current access time point, which is the time point at which the data read instruction of the application task is received; The access interval is calculated based on the current access time and the periodic access interval. If the access interval is greater than a preset time interval, the data list is updated according to the current access time and the access interval.

5. The method according to claim 4, characterized in that, The method for obtaining the current access time point, wherein the current access time point is after the time point when the data read instruction of the application task is received, further includes: Based on the data block identifier, retrieve the historical access time point corresponding to the last accessed data block identifier from the data list; Calculate the time interval based on the current access time and the historical access time. If the time interval is greater than the preset period interval, the data list is updated according to the current access time and the time interval.

6. The method according to claim 3, characterized in that, If the task name is the same as the application task name, after obtaining the access status corresponding to the data block identifier, the method further includes: If the accessed state is a non-periodic access state, then obtain the number of accessed time points corresponding to the data block identifier; If the number of accessed time points is less than the preset number of time points, then the data list is updated according to the current access time point and the time interval; Based on the current access time, delete the data in the data block corresponding to the data block identifier.

7. The method according to claim 1, characterized in that, The step of providing the data in the target data block to the application task when a data read instruction is received from the application task includes: If the cached data in the target data block has been replaced, then the data identifier of the data to be accessed is determined from the data list based on the data block identifier of the target data block; The data to be accessed is obtained from the data storage medium according to the data identifier, and the data to be accessed is stored in the target data block; When a data read instruction is received from the application task, the data to be accessed is provided to the application task.

8. A cache processing apparatus, characterized in that, include: The acquisition unit is used to acquire the data block identifier of the data block to be processed. The acquisition unit is also used to acquire the configuration file of the application task, the configuration file including the time interval for the application task to periodically access data and the error range of the time interval; The acquisition unit is further configured to acquire the access status and periodic access interval corresponding to the data block identifier from the data list according to the data block identifier. The data list is used to record the mapping relationship between the data block identifier of each data block, the access status of each data block and the periodic access interval of each data block. The data block is used to cache application data. The periodic access interval is the average time interval calculated based on any two adjacent access time points. The determining unit is configured to, if the accessed state is a periodic access state and the error between the periodic access interval and the time interval in the configuration file is within the error range in the configuration file, determine the data block to be processed corresponding to the data block identifier as the target data block, and set the retention setting for the application data cached in the target data block; the target data block is a data block that is periodically accessed by the application task. The processing unit is configured to provide the data in the target data block to the application task when it receives a data read instruction from the application task.

9. The apparatus according to claim 8, characterized in that, The processing unit is further configured to mark the cached data in the data block corresponding to the data block identifier as replaceable data if the accessed state is a non-periodic access state, or if the error between the periodic access interval and the time interval in the configuration file does not fall within the error range in the configuration file. The processing unit is further configured to delete the replaceable data in the data block when it receives a data read instruction from an application task; The acquisition unit is further configured to acquire data of the corresponding application task from the data storage medium according to the data reading instruction; The processing unit is further configured to store the acquired application task data into the data block and provide the application task data to the application task.

10. The apparatus according to claim 8, characterized in that, The data list is also used to record the mapping relationship between data block identifiers and task names, and the processing unit is specifically used for: Receive a data read instruction from an application task, wherein the data read instruction carries a data block identifier; Based on the data block identifier, retrieve the task name corresponding to the data block identifier from the data list; If the task name is the same as the application task name, then obtain the access status corresponding to the data block identifier; If the accessed state is a periodic access state, then the data in the target data block corresponding to the periodic access state is provided to the application task.

11. The apparatus according to claim 10, characterized in that, If the accessed state is a periodic access state, after providing the data in the target data block corresponding to the periodic access state to the application task, the acquisition unit is further used to acquire the current access time point, which is the time point when the data reading instruction of the application task is received. The processing unit is also configured to calculate the access interval based on the current access time and the periodic access interval; The processing unit is further configured to update the data list based on the current access time and the access interval if the access interval is greater than a preset time interval.

12. The apparatus according to claim 11, characterized in that, The current access time point is the time point after receiving the data reading instruction of the application task. The acquisition unit is also used to obtain the historical access time point corresponding to the data block identifier from the data list according to the data block identifier. The processing unit is further configured to calculate a time interval based on the current access time and the historical access time. The processing unit is further configured to update the data list based on the current access time and the time interval if the time interval is greater than a preset periodic interval.

13. The apparatus according to claim 10, characterized in that, If the task name is consistent with the application task name, after obtaining the access status corresponding to the data block identifier, the obtaining unit is further configured to obtain the number of access time points corresponding to the data block identifier if the access status is a non-periodic access status. The processing unit is further configured to update the data list based on the current access time point and the time interval if the number of accessed time points is less than the preset number of time points; The processing unit is further configured to delete data in the data block corresponding to the data block identifier based on the current access time.

14. The apparatus according to claim 8, characterized in that, The processing unit is specifically used for: If the cached data in the target data block has been replaced, then the data identifier of the data to be accessed is determined from the data list based on the data block identifier of the target data block; The data to be accessed is obtained from the data storage medium according to the data identifier, and the data to be accessed is stored in the target data block; When a data read instruction is received from the application task, the data to be accessed is provided to the application task.

15. A computer device, characterized in that, include: Memory, transceiver, processor, and bus system; The memory is used to store programs; When the processor is used to execute a program in the memory, it implements the method as described in any one of claims 1 to 7; The bus system is used to connect the memory and the processor to enable communication between the memory and the processor.

16. A computer-readable storage medium comprising instructions which, when executed on a computer, cause the computer to perform the method as claimed in any one of claims 1 to 7.

17. A computer program product, characterized in that, The method includes computer instructions stored in a computer-readable storage medium; a processor of a network device reads the computer instructions from the computer-readable storage medium and executes the computer instructions to cause the network device to perform the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method for replacing cache files, device and system thereof

    CN102511043A

  • Caching method and caching device

    CN103440207A