A data processing method and device

By cacheing the hotspot data in the first memory in the second memory, the problem of low data processing efficiency caused by small bandwidth of the DDR interface is solved, and the effect of improving data access rate and processing efficiency is achieved.

CN113535606BActive Publication Date: 2025-01-24ALIBABA GROUP HOLDING LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010292065.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-14
Publication Date
2025-01-24
Estimated Expiration
2040-04-14

AI Technical Summary

Technical Problem

When the chip processes data, due to the small interface bandwidth of DDR, the rate of looking up the stream table from DDR is lower, thereby reducing the efficiency of the chip processing data.

Method used

By obtaining the data access parameters in the memory, determine whether the data is hot data and cache hot data in the second memory. The data access rate of the second memory access rate is greater than the data access rate of the first memory.

Benefits of technology

The rate of access to the processor access data is increased, and the processing efficiency of the application based on the application of the data is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113535606B_ABST
    Figure CN113535606B_ABST
Patent Text Reader

Abstract

The present application shows a data processing method and device. Access parameters of first data in a first memory are obtained, and when the first data is determined to be hot data based on the access parameters, the first data is cached in a second memory. In this way, the processor can directly access the first data in the second memory, wherein the data access rate of the second memory is greater than the data access rate of the first memory, and the number of times the first data will be accessed in the time period of the current moment is often greater than the number of times other data in the first memory will be accessed in the time period of the current moment, so that the first data involves more applications that need to be processed than the other data in the first memory. Therefore, the present application can improve the processing efficiency of more applications as much as possible.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method and device. Background Art

[0002] With the rapid development of technology, chips have been widely used. When using chips to process data, it is often necessary to go through the processes of Parser, LookUp, Match, and Action.

[0003] Among them, the processes of Parser, Match and Action are carried out inside the chip. LookUp is the process of querying the flow table, which is located in the DDR (Double Data Rate) outside the chip. That is, LookUp is the process of searching the flow table from the DDR outside the chip. However, the interface bandwidth of DDR is small, which results in a low rate for the chip to search the flow table from DDR, resulting in low efficiency in chip data processing. Summary of the invention

[0004] In order to improve the efficiency of chip processing data, the present application discloses a data processing method and device.

[0005] In a first aspect, the present application provides a data processing method, the method comprising:

[0006] Obtaining access parameters of first data in the first memory;

[0007] determining whether the first data is hot data based at least on the access parameter;

[0008] When the first data is hot data, caching the first data in a second memory;

[0009] Wherein, a data access rate of the second memory is greater than a data access rate of the first memory.

[0010] In an optional implementation, the access parameter includes a frequency at which the first data is accessed;

[0011] The determining whether the first data is hot data based at least on the access parameter comprises:

[0012] Get the preset frequency;

[0013] Determining whether the accessed frequency is greater than a preset frequency;

[0014] When the access frequency is greater than a preset frequency, the first data is determined to be hot data.

[0015] In an optional implementation, obtaining the preset frequency includes:

[0016] Acquire an application type of an application accessing the first data;

[0017] Among a plurality of preset frequencies, a preset frequency suitable for the application type is obtained.

[0018] In an optional implementation, the access parameter includes the interval between the time when the first data was last accessed and the current time;

[0019] The determining whether the first data is hot data based at least on the access parameter comprises:

[0020] Get the preset interval duration;

[0021] Determine whether the interval duration is less than a preset interval duration;

[0022] When the interval duration is less than a preset interval duration, it is determined that the first data is hot data.

[0023] In an optional implementation, the access parameter includes: a frequency at which the first data is accessed and a time interval between a time when the first data was last accessed and a current time;

[0024] The determining whether the first data is hot data based at least on the access parameter comprises:

[0025] Determine the hotspot degree of the first data based on the access frequency and the interval duration;

[0026] Get the preset hotspot level;

[0027] Determining whether the hotspot degree is greater than a preset hotspot degree;

[0028] When the hotspot degree is greater than the preset hotspot degree, the first data is determined to be hotspot data.

[0029] In an optional implementation, obtaining the preset hotspot degree includes:

[0030] Acquire an application type of an application accessing the first data;

[0031] Among a plurality of preset hotspot levels, a preset hotspot level suitable for the application type is obtained.

[0032] In an optional implementation, determining whether the first data is hot data at least based on the access parameter includes:

[0033] The access parameter is input into a data type determination model to obtain an output result output by the data type determination model for indicating whether the first data is hot data.

[0034] In an optional implementation, the data type determines the training method of the model, including:

[0035] Acquire a sample data set, wherein the sample data set includes sample access parameters of a plurality of sample data, and a marking result of whether each marked sample data is a hotspot data;

[0036] The model is trained based on the sample data set until the parameters in the model converge, thereby obtaining the data type determination model.

[0037] In an optional implementation, before caching the first data in the second memory, the method further includes:

[0038] Determining whether the free storage space of the second memory is smaller than the space occupied by the first data;

[0039] When the free storage space is smaller than the occupied space, obtaining a frequency at which each second data in the second memory is accessed;

[0040] At least one second data in the second memory is deleted in order of access frequency from low to high, so that the free storage space of the second memory is greater than or equal to the occupied space.

[0041] In an optional implementation, before caching the first data in the second memory, the method further includes:

[0042] Determining whether the free storage space of the second memory is smaller than the space occupied by the first data;

[0043] When the free storage space is smaller than the occupied space, obtaining the interval between the time when each second data in the second memory is accessed and the current time;

[0044] At least one second data in the second memory is deleted in order of interval duration from long to short, so that the free storage space of the second memory is greater than or equal to the occupied space.

[0045] In an optional implementation, before caching the first data in the second memory, the method further includes:

[0046] Determining whether the free storage space of the second memory is smaller than the space occupied by the first data;

[0047] In a case where the free storage space is smaller than the occupied space, obtaining a frequency at which each second data in the second storage is accessed, and obtaining a time interval between a time at which each second data in the second storage is accessed and a current time;

[0048] Determine the hotspot degree of each second data in the second memory based on the acquired access frequency and interval duration;

[0049] At least one second data in the second memory is deleted in order of hotspot degree from low to high, so that the free storage space of the second memory is greater than or equal to the occupied space.

[0050] In an optional implementation, the method further includes:

[0051] During the process of caching the first data in the second memory, if an update instruction for the first data in the first memory is received, the update instruction is responded to after the first data is completely cached in the second memory.

[0052] In an optional implementation, the responding to the update instruction includes:

[0053] The first data stored in the second memory is updated, and then the first data stored in the first memory is updated.

[0054] In a second aspect, the present application provides a data processing device, the device comprising:

[0055] A first acquisition module, used to acquire access parameters of first data in the first memory;

[0056] A first determination module, configured to determine whether the first data is hot data based at least on the access parameter;

[0057] a cache module, configured to cache the first data in a second memory when the first data is hot data;

[0058] Wherein, a data access rate of the second memory is greater than a data access rate of the first memory.

[0059] In an optional implementation, the access parameter includes a frequency at which the first data is accessed;

[0060] The first determining module comprises:

[0061] A first acquisition unit, used to acquire a preset frequency;

[0062] A first determining unit, configured to determine whether the accessed frequency is greater than a preset frequency;

[0063] The second determining unit is configured to determine that the first data is hot data when the access frequency is greater than a preset frequency.

[0064] In an optional implementation, the first acquiring unit includes:

[0065] A first acquisition subunit, configured to acquire an application type of an application accessing the first data;

[0066] The second acquisition subunit is used to acquire a preset frequency suitable for the application type from a plurality of preset frequencies.

[0067] In an optional implementation, the access parameter includes the interval between the time when the first data was last accessed and the current time;

[0068] The first determining module comprises:

[0069] A second obtaining unit, used to obtain a preset interval duration;

[0070] A third determining unit, configured to determine whether the interval duration is less than a preset interval duration;

[0071] The fourth determination unit is used to determine that the first data is hot data when the interval duration is less than a preset interval duration.

[0072] In an optional implementation, the access parameter includes: a frequency at which the first data is accessed and a time interval between a time when the first data was last accessed and a current time;

[0073] The first determining module comprises:

[0074] A fifth determining unit, configured to determine a hotspot degree of the first data based on the access frequency and the interval duration;

[0075] A third acquisition unit is used to acquire a preset hotspot degree;

[0076] A sixth determining unit, configured to determine whether the hotspot degree is greater than a preset hotspot degree;

[0077] The seventh determination unit is used to determine that the first data is hotspot data when the hotspot degree is greater than the preset hotspot degree.

[0078] In an optional implementation, the third acquisition unit includes:

[0079] a third acquisition subunit, configured to acquire an application type of an application accessing the first data;

[0080] The fourth acquisition subunit is used to acquire a preset hotspot degree suitable for the application type from a plurality of preset hotspot degrees.

[0081] In an optional implementation, the first determining module includes:

[0082] An input unit is used to input the access parameter into a data type determination model to obtain an output result output by the data type determination model to indicate whether the first data is hot data.

[0083] In an optional implementation, the first determining module further includes:

[0084] A fourth acquisition unit is used to acquire a sample data set, wherein the sample data set includes sample access parameters of a plurality of sample data and a labeling result of whether each labeled sample data is a hotspot data;

[0085] A training unit is used to train the model based on the sample data set until the parameters in the model converge to obtain the data type determination model.

[0086] In an optional implementation, the device further includes:

[0087] A second determining module, used to determine whether the free storage space of the second memory is smaller than the space occupied by the first data;

[0088] A second acquisition module, configured to acquire a frequency of access of each second data in the second memory when the free storage space is smaller than the occupied space;

[0089] The first deletion module is used to delete at least one second data in the second memory in order of access frequency from low to high, so that the free storage space of the second memory is greater than or equal to the occupied space.

[0090] In an optional implementation, the device further includes:

[0091] A third determining module, used to determine whether the free storage space of the second memory is smaller than the space occupied by the first data;

[0092] A third acquisition module, configured to acquire, when the free storage space is smaller than the occupied space, the interval between the time when each second data in the second memory is accessed and the current time;

[0093] The second deleting module is used to delete at least one second data in the second memory in order of interval duration from long to short, so that the free storage space of the second memory is greater than or equal to the occupied space.

[0094] In an optional implementation, the device further includes:

[0095] a fourth determining module, configured to determine whether the free storage space of the second memory is smaller than the space occupied by the first data;

[0096] a fourth acquisition module, configured to acquire, when the free storage space is smaller than the occupied space, a frequency at which each second data in the second storage is accessed, and an interval between a time at which each second data in the second storage is accessed and a current time;

[0097] A fifth determining module, configured to determine a hotspot degree of each second data in the second memory based on the acquired access frequency and interval duration;

[0098] The third deletion module is used to delete at least one second data in the second memory in order of hotspot degree from low to high, so that the free storage space of the second memory is greater than or equal to the occupied space.

[0099] In an optional implementation, the device further includes:

[0100] The response module is used for responding to the update instruction after the first data is cached in the second memory if an update instruction for the first data in the first memory is received during the process of caching the first data in the second memory.

[0101] In an optional implementation, the response module is specifically configured to: update the first data stored in the second memory, and then update the first data stored in the first memory.

[0102] In a third aspect, the present application shows an electronic device, the electronic device comprising:

[0103] Processor; and

[0104] A memory having executable codes stored thereon, which, when executed, enables the processor to execute the data processing method as described in the first aspect.

[0105] In a fourth aspect, the present application illustrates one or more machine-readable media on which executable codes are stored. When the executable codes are executed, the processor executes the data processing method as described in the first aspect.

[0106] Compared with the prior art, the embodiments of the present application have the following advantages:

[0107] In the present application, access parameters of first data in a first memory are obtained; whether the first data is hot data is determined at least based on the access parameters; and if the first data is hot data, the first data is cached in a second memory.

[0108] In this way, if the processor needs to access the first data when processing an application, the processor can directly access the first data in the second memory, and then process the application based on the first data. Since the data access rate of the second memory is greater than the data access rate of the first memory, the present application can increase the rate at which the processor accesses the first data, thereby improving the processing efficiency of the application that needs to be based on the first data.

[0109] Secondly, since the first data is the hot data in the first memory, the first data can be the data in the first memory that is accessed very many times in the time period of the current moment. The number of times the first data is accessed in the time period of the current moment is often greater than the number of times other data in the first memory are accessed in the time period of the current moment, so the first data involves more applications that need to be processed than the other data in the first memory. Therefore, the present application can improve the processing efficiency of more applications as much as possible. BRIEF DESCRIPTION OF THE DRAWINGS

[0110] Figure 1 It is a step flow chart of a data processing method shown in an exemplary embodiment of the present application.

[0111] Figure 2 It is a flowchart of a method for determining hotspot data shown in an exemplary embodiment of the present application.

[0112] Figure 3 It is a flowchart of a method for determining hotspot data shown in an exemplary embodiment of the present application.

[0113] Figure 4 It is a flowchart of a method for determining hotspot data shown in an exemplary embodiment of the present application.

[0114] Figure 5 It is a structural block diagram of a data processing device shown in an exemplary embodiment of the present application.

[0115] Figure 6 It is a schematic diagram of the structure of a device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0116] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0117] Figure 1 A schematic diagram of a data processing method of the present application is shown in FIG. Figure 1 , the method comprising:

[0118] In step S101, access parameters of first data in a first memory are obtained;

[0119] In the present application, the first memory includes DDR, etc., and multiple data, such as flow tables, etc., are stored in the first memory. The data stored in the first memory can be accessed by the processor. For example, when processing an application, the processor often needs to access data in the first memory, for example, search for flow tables in the first memory, and then process the application based on the accessed data.

[0120] The processor can process multiple applications in parallel. When processing different applications, the processor may need to access the same data in the first memory, or may access different data in the first memory.

[0121] In this way, for any data stored in the first memory, the situations in which it is accessed by the processor may be different, for example, the time when the data is accessed is different, the frequency at which the data is accessed within a period of time is different, the total number of times the data is accessed is different, and the duration of the continuous process of the data being accessed is different, etc.

[0122] Thus, the data access parameters may include: the time when the data is accessed, for example, the time when the data was last accessed, etc., as well as the frequency of data access within a period of time, the total number of times the data is accessed, and the duration of the continuous process of data access, etc.

[0123] In step S102, determining whether the first data is hot data based at least on the access parameter;

[0124] In the present application, in addition to determining whether the first data is hot data based on the access parameter, other relevant parameters of the first data and the access parameter can also be combined to determine whether the first data is hot data. The present application does not limit the type of parameters required to determine whether it is hot data, and does not limit the method for determining whether it is hot data.

[0125] In the present application, there are a lot of data stored in the first memory that can be accessed by the processor, and the hot data includes data that is accessed very many times among multiple data in the time period of the current moment.

[0126] For example, in a live broadcast scenario, the server needs to continuously send video streams to each user's terminal. Before sending each frame of the video stream, the processor needs to encode the video image first, and then send the encoded video image. The live video stream includes a large number of video images. When encoding the video image, the processor needs to access certain data in the first memory, and then encode the video image based on the accessed data.

[0127] However, since the live video stream includes a large number of video images, and each frame of the video image needs to be encoded, and the data in the first memory needs to be accessed when encoding each frame of the video image, the data in the first memory will be accessed by the processor many times during the live broadcast time period.

[0128] However, in the present application, the interface bandwidth of the first memory is relatively low, resulting in a low rate at which the processor accesses data in the first memory, which further reduces the efficiency of the processor in processing applications. For example, it reduces the efficiency of encoding live video images, affecting the real-time and smooth viewing of live videos by a large number of users, thereby reducing the user experience.

[0129] Therefore, in order to improve the efficiency of the processor in processing applications, in the present application, the rate at which the processor accesses data can be increased. For example, at least one second memory can be set, and the data access rate of the second memory is greater than the data access rate of the first memory, that is, the rate at which the processor accesses data in the second memory is greater than the rate at which the processor accesses data in the first memory.

[0130] A portion of the data in the first memory may be cached in the second memory, so that when the processor needs to access the portion of the data, the processor may directly access the portion of the data in the second memory.

[0131] Since the processor accesses data in the second memory at a faster rate than in the first memory, the processing efficiency of the application based on this part of data can be improved.

[0132] In the present application, there are multiple data in the first memory, and the processor needs to access different data in the first memory when processing different applications. Among these data, some data will be accessed very many times in the time period of the current moment, and some data will be accessed less often in the time period of the current moment. The data that are accessed very many times in the time period of the current moment involve a large number of applications that need to be processed, and the data that are accessed less often in the time period of the current moment involve fewer applications that need to be processed.

[0133] Therefore, in order to improve the processing efficiency of more applications as much as possible, in another embodiment of the present application, the hot data in the first memory can be cached in the second memory, however, it is first necessary to determine which data in the first memory is the hot data. The specific determination method can refer to the embodiment shown later, which will not be described in detail here.

[0134] In the case where the first data is hot data, in step S103, the first data is cached in the second memory;

[0135] In the present application, the first data in the first memory can be copied and cached in the second memory, so that the first data is available in both the first memory and the second memory. Alternatively, the hot data can be directly cut from the first memory to the second memory, so that the first data no longer exists in the first memory, thereby saving the storage space of the first memory, and then the first data can be cut from the second memory to the first memory again when needed.

[0136] In the present application, access parameters of first data in a first memory are obtained; whether the first data is hot data is determined at least based on the access parameters; and if the first data is hot data, the first data is cached in a second memory.

[0137] In this way, if the processor needs to access the first data when processing an application, the processor can directly access the first data in the second memory, and then process the application based on the first data. Since the data access rate of the second memory is greater than the data access rate of the first memory, the present application can increase the rate at which the processor accesses the first data, thereby improving the processing efficiency of the application that needs to be based on the first data.

[0138] Secondly, since the first data is the hot data in the first memory, the first data can be the data in the first memory that is accessed very many times in the time period of the current moment. The number of times the first data is accessed in the time period of the current moment is often greater than the number of times other data in the first memory are accessed in the time period of the current moment, so the first data involves more applications that need to be processed than the other data in the first memory. Therefore, the present application can improve the processing efficiency of more applications as much as possible.

[0139] Among them, the present application can be applied in the field of smart network cards, and of course, can also be applied to all scenarios and products involving network message switching and forwarding, such as AVS (Application virtual switch), switches, routers, and network cards.

[0140] In another embodiment of the present application, sometimes according to actual needs, it may be necessary to update the data stored in the first memory. After the first data in the first memory is updated, it is also necessary to determine whether the first data is cached in other memories. If the first data is cached in other memories, in order to maintain data consistency, the first data cached in other memories also needs to be updated.

[0141] However, if an update instruction for the first data in the first memory is received during the process of caching the first data in the second memory.

[0142] If the first data in the first memory is directly updated at this time, after the first data in the first memory is updated, it will be immediately determined whether other memories have cached the first data. However, if the process of caching the first data in the second memory has not been completed at this time, that is, the process of caching the first data in the second memory has not been completed, then the second memory does not have complete first data. Therefore, it is often determined that the first data does not exist in the second memory at this time, and the process of updating the first data in the second memory is not involved.

[0143] After the first data is cached in the second memory, since the "determining whether the first data is cached in the second memory" has been completed, that is, the operation of updating the first data in each memory has been completed, the "determining whether the first data is cached in the second memory" will not be repeated again, and the first data in the second memory will not be updated.

[0144] However, this will result in that after the first data is cached in the second memory, the first data cached in the second memory is old data before updating, and the first data stored in the first memory is new data after updating, resulting in data inconsistency.

[0145] Since the first data is cached in the second memory, the processor can often directly access the first data in the second memory when it needs to access the first data, instead of accessing the first data in the first memory. This will cause the first data accessed by the processor to be old data before the update, and the processor will never be able to access the new first data after the update.

[0146] Therefore, in order to enable the processor to access the updated new first data when accessing the first data, in the present application, during the process of caching the first data in the second memory, if an update instruction for the first data in the first memory is received, the update instruction may not be responded to immediately, but the processor may wait until the first data is cached in the second memory before responding to the update instruction.

[0147] In this way, when the update instruction begins to be responded, the first data is stored in both the first memory and the second memory. Therefore, after the first data stored in the first memory is updated, it can be determined whether the other memories have the first data cached, and it can be determined that the first data is cached in the second memory. Therefore, the first data cached in the second memory can be updated. In this way, the first data stored in the first memory and the first data cached in the second memory are both updated data, and data consistency can be maintained. Later, when the processor needs to access the first data, the processor can directly access the first data in the second memory, and the first data accessed is the updated new first data.

[0148] However, in one case, the data updating operation is single-threaded, that is, data in only one memory can be updated at a time. For example, after the first data stored in one memory is updated, the first data stored in another memory can be updated.

[0149] In this way, when responding to the above update instruction, if the first data stored in the first memory is updated first, and then the first data cached in the second memory is updated, after starting to respond to the update instruction, the processor can access the updated new first data in the second memory only after the process of updating the first data stored in the first memory and the process of updating the first data cached in the second memory has passed. That is, it takes a long time for the processor to access the updated new first data in the second memory after starting to respond to the update instruction.

[0150] In order to enable the processor to access the updated new first data in the second memory as quickly as possible, in another embodiment of the present application, the first data stored in the second memory may be updated first, and then the first data stored in the first memory may be updated.

[0151] In this way, after starting to respond to the update instruction, the processor can access the updated new first data in the second memory only after the process of updating the first data cached in the second storage is completed. That is, after starting to respond to the update instruction, it takes a short time for the processor to access the updated new first data in the second memory.

[0152] In one embodiment of the present application, the access parameter includes a frequency at which the first data is accessed; wherein the frequency at which the first data is accessed includes: the frequency at which the first data is accessed in a time period before the current moment and close to the current moment, for example, the time period before the current moment and close to the current moment includes: a time period with the current moment as the end moment, for example, a time period lasting 2 seconds, a time period lasting 3 seconds, or a time period lasting 5 seconds with the current moment as the end moment, etc., of course, it can also be a time period lasting 10 seconds, a time period lasting 20 seconds, or a time period lasting 50 seconds with the current moment as the end moment, etc., and the present application does not limit the specific time period.

[0153] Therefore, see Figure 2 , step S102 includes:

[0154] In step S201, a preset frequency is obtained;

[0155] The preset frequency may be set in advance by a technician based on experience.

[0156] In step S202, it is determined whether the frequency at which the first data is accessed is greater than a preset frequency;

[0157] When the frequency at which the first data is accessed is greater than the preset frequency, in step S203 , the first data is determined to be hotspot data.

[0158] In the present application, when the frequency of access to the first data is greater than the preset frequency, it often means that: compared with other data in the first memory except the first data, the first data is accessed more times in a short period of time, and the applications that need to be processed involving the first data will be more than the applications that need to be processed involving other data in the first memory except the first data. Therefore, in order to improve the processing efficiency of more applications as much as possible, the first data can be determined as hot data.

[0159] When the frequency of accessing the first data is less than or equal to or greater than the preset frequency, in step S204 , it is determined that the first data is non-hotspot data.

[0160] In the present application, the data stored in the first memory may be accessed by the processor based on applications of different application types, for example, accessed by the processor based on applications of live video broadcasting, accessed by the processor based on applications of ordinary web pages, accessed by the processor based on applications of instant messaging, and accessed by the processor based on applications of games, etc.

[0161] For example, the above-mentioned applications generally involve image encoding. Thus, when the processor encodes an image, it needs to access certain data in the first memory. Therefore, the above-mentioned applications all involve the processor accessing the data in the first memory, for example, accessing a flow table, etc., and encoding the image based on the accessed data.

[0162] In the present application, one of the purposes of setting up the second memory is to cache a portion of the data in the first memory so that the processor can access this portion of data in the second processor, thereby increasing the rate at which the processor accesses this portion of data, thereby improving the processing efficiency of applications that need to be based on this portion of data.

[0163] Therefore, when the second processor has free storage space, part of the data in the first memory can be cached in the second memory, and more data in the first memory can be cached in the second memory as much as possible to make the best use of the storage space of the second memory, thereby increasing the rate at which more data is accessed by the processor as much as possible, thereby increasing the processing efficiency of the processor in processing more applications as much as possible.

[0164] However, when the processor processes different types of applications, the processor accesses data in the first memory at different frequencies according to application requirements.

[0165] For example, in live video applications, since the live video includes a large number of video images and each frame of the video image needs to be encoded, encoding each frame of the image requires accessing the data stored in the first memory once, such as accessing the flow table, etc. Therefore, when the processor processes live video applications, the processor accesses the data stored in the first memory at a higher frequency.

[0166] In game applications, since the displayed game screen is constantly changing, images need to be continuously rendered. Rendering images requires access to data in the first memory, such as access to the flow table. Therefore, when the processor processes game applications, the processor accesses the data stored in the first memory at a high frequency.

[0167] In ordinary web page access and chat applications, it is usually not necessary to encode a large number of images, and often only a small number of images are required. Therefore, when the processor processes ordinary web page access and chat applications, the processor accesses the data stored in the first memory at a low frequency.

[0168] Thus, the frequency of each data stored in the first memory being accessed by the processor based on ordinary web applications or chat applications is often relatively low. The frequency of each data stored in the first memory being accessed by the processor based on live video applications or game applications is often relatively high.

[0169] In this way, if a preset frequency is uniformly used by various applications, when the preset frequency is low, if the processor mainly accesses the data in the first memory based on ordinary web applications or chat applications, since the frequency at which the various data stored in the first memory are accessed by the processor based on ordinary web applications or chat applications is often relatively low, the data in the first memory can often select part of the data whose access frequency is greater than the preset threshold, and the selected part of the data can be cached in the second memory, so that the processor can access the part of the data whose access frequency is greater than the preset threshold in the second processor later, so as to increase the access rate of these data.

[0170] However, if the processor mainly accesses the data in the first memory based on live video applications or game applications, since the frequency with which the data stored in the first memory is accessed by the processor based on live video applications or game applications is often relatively high, most of the data in the first memory is often data accessed at a frequency greater than a preset threshold. Among them, the storage space in the second memory is often limited. Therefore, it is actually impossible to cache all data accessed at a frequency greater than the preset threshold in the second memory. If an attempt is made to forcibly cache all data accessed at a frequency greater than the preset threshold in the second memory, but since the amount of all data accessed at a frequency greater than the preset threshold is much larger than the storage space of the second memory, it will cause the second memory to overflow, and then cause the second memory to be abnormal.

[0171] In the case where the preset frequency is set high, if the processor mainly accesses the data in the first memory based on ordinary web applications or chat applications, since the frequency of each data stored in the first memory being accessed by the processor based on ordinary web applications or chat applications is often relatively low, the data in the first memory often cannot select part of the data whose access frequency is greater than the preset threshold, and the data in the first memory cannot be cached in the second memory, so the storage space of the second memory cannot be used, and the advantage of the fast access rate of the second memory cannot be used, and the access rate of the data cannot be increased.

[0172] Therefore, in order to avoid the above situation, in another embodiment of the present application, for any application type, the technician can count the preset frequency applicable to the application type in advance, that is, according to the frequency of the processor accessing the data in the first memory based on the application of the application type, an appropriate number of hot data can be selected from each data in the first memory based on the preset frequency, such as data with an access frequency greater than the preset frequency, etc. Caching the selected data in the second memory will not cause the second memory to overflow, and the storage space of the second memory can be utilized to achieve the purpose of increasing the rate of accessing data. Afterwards, the application type and the preset frequency applicable to the application type that are counted can be composed of corresponding table items and stored in the corresponding relationship between the application type and the preset frequency. The same is true for each other application type.

[0173] Therefore, in the present application, when obtaining the preset frequency, the application type of the application accessing the first data can be obtained; then, among the multiple preset frequencies, a preset frequency suitable for the application type is obtained. For example, in the correspondence between the application type and the preset frequency, the preset frequency corresponding to the application type is searched and used as the preset frequency suitable for the application type.

[0174] In one embodiment of the present application, the access parameter includes the interval between the time when the first data was last accessed and the current time.

[0175] Therefore, see Figure 3 , step S102 includes:

[0176] In step S301, a preset interval duration is obtained;

[0177] The preset interval duration may be set in advance by a technician based on experience.

[0178] In step S302, it is determined whether the interval duration is less than a preset interval duration;

[0179] In the present application, when the processor needs to process an application, it needs to access data in the first memory, and when processing different types of applications, different data may need to be accessed from the first memory.

[0180] Also, usually, the processor needs to process a large number of applications of the same type in a short period of time. For example, in a live broadcast scenario, the server needs to continuously send video streams to each user's terminal. Before sending each frame of the video stream, the processor needs to encode the video image first, and then send the encoded video image. The live video stream includes a large number of video images. When encoding the video image, the processor needs to access certain data in the first memory, and then encode the video image based on the accessed data.

[0181] Since the live video stream includes a large number of video images, and each frame of the video image needs to be encoded, and the data in the first memory needs to be accessed when encoding each frame of the video image, the data in the first memory will be accessed by the processor many times during the live broadcast period. After the live broadcast is completed, the processor does not need to continue to access the first data for a period of time thereafter, and will continue to access the first data only when it needs to process an application that needs to access the first data again.

[0182] Other types of applications are similar. Therefore, if a certain data in the first memory is accessed by the processor, the data will often be accessed multiple times in a short period of time thereafter, that is, the data is likely to be hot data in a short period of time thereafter.

[0183] However, if certain data in the first memory has not been accessed by the processor for a long time, the data will often not be accessed multiple times in a short period of time thereafter, that is, the data is likely to be non-hotspot data in a short period of time thereafter.

[0184] When the interval duration is less than the preset interval duration, in step S303, it is determined that the first data is hotspot data.

[0185] In the present application, when the interval between the time when the first data was last accessed and the current time is less than the preset interval, it often means that: compared with other data in the first memory except the first data, the first data is accessed more times in a short period of time, and the applications that need to be processed involving the first data will be more than the applications that need to be processed involving other data in the first memory except the first data. Therefore, in order to improve the processing efficiency of more applications as much as possible, the first data can be determined as hot data.

[0186] When the interval duration is greater than or equal to the preset interval duration, in step S304, it is determined that the first data is non-hotspot data.

[0187] In one embodiment of the present application, the access parameter includes the frequency at which the first data is accessed, and the access parameter includes the interval between the time when the first data was last accessed and the current time. The frequency at which the first data is accessed includes: the frequency at which the first data is accessed in a time period before the current time and close to the current time, for example, the time period before the current time and close to the current time includes: a time period with the current time as the end time, for example, a duration of 2 seconds, a duration of 3 seconds, or a duration of 5 seconds with the current time as the end time, etc. Of course, it can also be a duration of 10 seconds, a duration of 20 seconds, or a duration of 50 seconds with the current time as the end time, etc. The present application does not limit the specific duration.

[0188] Therefore, see Figure 4 , step S102 includes:

[0189] In step S401, the hotspot degree of the first data is determined based on the frequency of access to the first data and the interval between the time when the first data was last accessed and the current time;

[0190] In the present application, access parameters such as the frequency with which the first data is accessed and the interval between the time when the first data was last accessed and the current time will affect whether the first data is hot data. Figure 2 and Figure 3 The embodiment shown can use a single access parameter such as the frequency of first data access or the interval between the last access time and the current time to determine whether the first data is hot data, while this embodiment can combine at least two access parameters such as the frequency of first data access and the interval between the last access time and the current time to determine whether the first data is hot data. Since more access parameters are considered, the accuracy of the result of determining whether the first data is hot data can be improved.

[0191] Among them, the closer the time when the data is accessed is to the current time, the greater the possibility that the data is hot data at the current time and a period of time after the current time; the farther the time when the data is accessed is from the current time, the smaller the possibility that the data is hot data at the current time and a period of time after the current time.

[0192] The higher the frequency of data access, the greater the possibility that the data is hot data at the current moment and a period of time after the current moment; the lower the frequency of data access, the lower the possibility that the data is hot data at the current moment and a period of time after the current moment.

[0193] Therefore, in one possible way, technicians can set weight values ​​for each access parameter in advance based on experience. If a certain access parameter has a greater impact on whether the data is hot data, the weight value of the access parameter can be set to a larger value. If a certain access parameter has a smaller impact on whether the data is hot data, the weight value of the access parameter can be set to a smaller value.

[0194] In this way, when determining the hotness of the first data based on the frequency of access to the first data and the time interval between the last time the first data was accessed and the current time, the frequency of access to the first data and the time interval between the last time the first data was accessed and the current time can be combined with their respective weight values ​​to perform a weighted operation to obtain the hotness of the first data. This application does not limit the specific weighted operation method.

[0195] In step S402, a preset hotspot degree is obtained;

[0196] The preset hotspot degree may be set in advance by a technician based on experience.

[0197] In step S403, it is determined whether the hotspot degree of the first data is greater than a preset hotspot degree;

[0198] When the hotspot degree of the first data is greater than the preset hotspot degree, in step S404, the first data is determined to be hotspot data.

[0199] In the present application, when the hotspot degree of the first data is greater than the preset hotspot degree, it often means that: compared with other data in the first memory except the first data, the first data is accessed more times in a short period of time, and the applications that need to be processed involving the first data will be more than the applications that need to be processed involving other data in the first memory except the first data. Therefore, in order to improve the processing efficiency of more applications as much as possible, the first data can be determined as hotspot data.

[0200] When the hotspot degree of the first data is less than or equal to the preset hotspot degree, in step S405 , the first data is determined to be non-hotspot data.

[0201] In this embodiment, the frequency of accessing the first data is used when determining whether the first data is hot data. Figure 2Regarding the description of application types in the illustrated embodiment, in the embodiment of the present application, for any application type, the technician can count the preset hotspot degree applicable to the application type in advance, and then the application type and the counted preset hotspot degree applicable to the application type can be formed into a corresponding table item, and stored in the corresponding relationship between the application type and the preset hotspot degree. The same is true for each other application type.

[0202] Therefore, in the present application, when obtaining the preset hotspot degree, the application type of the application accessing the first data can be obtained; then, among multiple preset hotspot degrees, the preset hotspot degree applicable to the application type is obtained. For example, in the correspondence between the application type and the preset hotspot degree, the preset hotspot degree corresponding to the application type is searched and used as the preset hotspot degree applicable to the application type.

[0203] In another embodiment of the present application, in step S102, the access parameter may be input into a data type determination model to obtain an output result output by the data type determination model indicating whether the first data is hot data.

[0204] Among them, the data type determination model can be trained in advance, and the specific training method includes: obtaining a sample data set, the sample data set includes sample access parameters of multiple sample data, and whether each labeled sample data is a labeling result of hot data; training the model based on the sample data set until the parameters in the model converge to obtain the data type determination model.

[0205] Among them, the model includes: CNN (Convolutional Neural Networks), RNN (Recurrent Neural Networks) and LSTM (Long Short-Term Memory Networks), etc. This application does not limit the specific model.

[0206] The sample access parameters of the sample data include, for example, the time when the sample data was last accessed, the frequency of sample data access within a period of time, the total number of times the sample data is accessed, and the duration of the continuous process of sample data access.

[0207] Among them, the closer the time when the data is accessed is to the current time, the greater the possibility that the data is hot data at the current time and a period of time after the current time; the farther the time when the data is accessed is from the current time, the smaller the possibility that the data is hot data at the current time and a period of time after the current time.

[0208] The higher the frequency of data access, the greater the possibility that the data is hot data at the current moment and a period of time after the current moment; the lower the frequency of data access, the lower the possibility that the data is hot data at the current moment and a period of time after the current moment.

[0209] The higher the total number of times the data is accessed, the more likely it is that the data is hot data at the current moment and within a period of time after the current moment. The lower the total number of times the data is accessed, the less likely it is that the data is hot data at the current moment and within a period of time after the current moment.

[0210] The longer the duration of the continuous process of data being accessed, the greater the possibility that the data is hot data at the current moment and a period of time after the current moment; the shorter the duration of the continuous process of data being accessed, the smaller the possibility that the data is hot data at the current moment and a period of time after the current moment.

[0211] In the present application, the data type determination model can adaptively adjust the model parameters according to the actual data to improve the data type determination model, thereby making the accuracy of the determination result of whether the first data is hot data based on the data type determination model higher.

[0212] In the present application, when it is necessary to cache the first data in the second memory, sometimes the free storage space in the second memory is greater than or equal to the space occupied by the first data. In this way, the second memory can accommodate the first data. Therefore, step S103 can be directly executed: cache the first data in the second memory.

[0213] However, sometimes some data has been stored in the second memory, resulting in the free storage space in the second memory being smaller than the space occupied by the first data. In this way, the second memory cannot accommodate the first data, and step S103 cannot be executed directly. In this way, the first data cannot be cached in the second memory, and the processor cannot access the first data in the second memory, resulting in the inability to increase the rate at which the processor accesses the first data, and further resulting in the inability to improve the processing efficiency of applications that need to be based on the first data.

[0214] Therefore, in one embodiment of the present application, in order to solve the above problem, before caching the first data in the second memory, it can be determined whether the free storage space of the second memory is smaller than the space occupied by the first data.

[0215] In the case that the free storage space of the second memory is greater than or equal to the space occupied by the first data, the first data may be directly cached in the second memory.

[0216] When the free storage space of the second memory is smaller than the space occupied by the first data, in order to cache the first data in the second memory so that the processor can access the first data in the second memory later, so as to increase the rate at which the processor accesses the first data, and thereby improve the processing efficiency of the application based on the first data, the access frequency of each second data in the second memory can be obtained; and at least one second data in the second memory can be deleted in order of access frequency from low to high, so that the free storage space of the second memory is greater than or equal to the occupied space, so that the second memory can accommodate the first data, and the first data can be cached in the second memory, and then the processor can access the first data in the second memory, thereby increasing the rate at which the processor accesses the first data, and thereby improving the processing efficiency of the application based on the first data.

[0217] Among them, the second data with the lowest access frequency can be deleted from the second memory first. If the free storage space of the second memory is still smaller than the space occupied by the first data at this time, the second data with the lowest access frequency can continue to be deleted from the second storage space until the free storage space of the second memory is greater than or equal to the space occupied by the first data.

[0218] Among them, in the second memory, the number of times that the second data with a high access frequency is accessed in a short period of time thereafter is often greater than the number of times that the second data with a low access frequency is accessed in a short period of time thereafter. The second data with a high access frequency involves more applications that need to be processed than the second data with a low access frequency. Therefore, in the second memory, the second data with a low access frequency is deleted first, and the second data with a high access frequency is retained, so as to maintain the processing efficiency of more applications as much as possible.

[0219] Alternatively, in another embodiment of the present application, in order to solve the above problem, before caching the first data in the second memory, it can be determined whether the free storage space of the second memory is smaller than the space occupied by the first data.

[0220] In the case that the free storage space of the second memory is greater than or equal to the space occupied by the first data, the first data may be directly cached in the second memory.

[0221] In the case where the free storage space of the second memory is smaller than the space occupied by the first data, in order to cache the first data in the second memory so that the processor can access the first data in the second memory later, so as to increase the rate at which the processor accesses the first data, and thereby improve the processing efficiency of the application that needs to be based on the first data, the interval between the time when each second data in the second memory is accessed and the current time can be obtained; and in order of the interval time from long to short, at least one second data in the second memory is deleted so that the free storage space of the second memory is greater than or equal to the occupied space, so that the second memory can accommodate the first data, and the first data can be cached in the second memory, and then the processor can access the first data in the second memory, thereby increasing the rate at which the processor accesses the first data, and thereby improving the processing efficiency of the application that needs to be based on the first data.

[0222] Among them, the second data with the longest interval can be deleted from the second memory first. If the free storage space of the second memory is still smaller than the space occupied by the first data at this time, the second data with the longest interval can continue to be deleted from the second storage space until the free storage space of the second memory is greater than or equal to the space occupied by the first data.

[0223] Among them, in the second memory, the number of times the second data with a shorter interval between the last accessed moment and the current moment is accessed in a short period of time thereafter is often greater than the number of times the second data with a longer interval between the last accessed moment and the current moment is accessed in a short period of time thereafter. The second data with a shorter interval between the last accessed moment and the current moment will involve more applications that need to be processed than the second data with a longer interval between the last accessed moment and the current moment. Therefore, in the second memory, the second data with a longer interval between the last accessed moment and the current moment is deleted first, while the second data with a shorter interval between the last accessed moment and the current moment is retained, so as to maintain the processing efficiency of more applications as much as possible.

[0224] Alternatively, in another embodiment of the present application, in order to solve the above problem, before caching the first data in the second memory, it can be determined whether the free storage space of the second memory is smaller than the space occupied by the first data.

[0225] In the case that the free storage space of the second memory is greater than or equal to the space occupied by the first data, the first data may be directly cached in the second memory.

[0226] In the case where the free storage space of the second memory is smaller than the space occupied by the first data, in order to cache the first data in the second memory so that the processor can access the first data in the second memory later, so as to improve the rate at which the processor accesses the first data, and thus improve the processing efficiency of the application based on the first data, the access frequency of each second data in the second memory can be obtained, and the interval between the access time and the current time of each second data in the second memory can be obtained; then, based on the obtained access frequency and interval, the hotspot degree of each second data in the second memory is determined; and at least one second data in the second memory is deleted in the order of hotspot degree from low to high, so that the free storage space of the second memory is greater than or equal to the occupied space. In this way, the second memory can accommodate the first data, and the first data can be cached in the second memory, and then the processor can access the first data in the second memory, so as to improve the rate at which the processor accesses the first data, and thus improve the processing efficiency of the application based on the first data.

[0227] Among them, the second data with the lowest hotspot degree can be deleted from the second memory first. If the free storage space of the second memory is still smaller than the space occupied by the first data at this time, the second data with the lowest hotspot degree can continue to be deleted from the second storage space until the free storage space of the second memory is greater than or equal to the space occupied by the first data.

[0228] Among them, in the second memory, the number of times the second data with a high hotspot degree is accessed in a short period of time thereafter is often greater than the number of times the second data with a low hotspot degree is accessed in a short period of time thereafter. The second data with a high hotspot degree involves more applications that need to be processed than the second data with a low hotspot degree. Therefore, in the second memory, the second data with a low hotspot degree is deleted first, and the second data with a high hotspot degree is retained, so as to maintain the processing efficiency of more applications as much as possible.

[0229] In another embodiment of the present application, for scenarios with different cache capacities and forwarding capabilities, the quantification standards for distinguishing traffic types can be adjusted, or even the distinction calculation logic can be omitted to save costs. User options can be provided for users to choose, or adaptive adjustments can be made based on actual traffic conditions.

[0230] In the case where the storage capacity of the second memory is limited, if hotspot data is continuously determined in the first memory and needs to be cached in the second memory, then each time before caching the hotspot data in the second cache, part of the cached data in the second memory needs to be deleted so that the determined hotspot data can be accommodated in the second memory. However, this causes the data cached in the second memory to be constantly replaced, which will affect the stability of the efficiency of the processor in processing applications that need to use the data.

[0231] Therefore, the threshold for determining hot data in the first memory can be raised to avoid frequent replacement of data cached in the second memory.

[0232] Afterwards, if the capacity of the second memory is expanded, the threshold for determining hot data in the first memory can be appropriately lowered, and if the capacity of the second memory is reduced, the threshold for determining hot data in the first memory can be increased.

[0233] Of course, the work of determining the hotspot data in the first memory may be left to the user to determine manually, instead of using the above-mentioned automatic determination method, thereby saving costs.

[0234] In addition, the greater the forwarding capability of the processor, the greater the number of first memory cells that need to be used by the processor; the smaller the forwarding capability of the processor, the smaller the number of first memory cells that need to be used by the processor.

[0235] Therefore, when the forwarding capability of the processor is relatively large, in order to improve the efficiency of the processor in processing applications, the threshold for determining hot data in the first memory can be lowered so that more data in the first memory can enter the second memory.

[0236] When the forwarding capability of the processor is relatively small, the threshold for determining hot data in the first memory can be increased to avoid constant replacement of cached data in the second memory, thereby avoiding affecting the stability of the efficiency of the processor in processing applications that need to use the data.

[0237] Figure 5 A structural block diagram of a data processing device of the present application is shown in FIG. Figure 5 , the method comprising:

[0238] A first acquisition module 11, used to acquire access parameters of first data in a first memory;

[0239] A first determination module 12, configured to determine whether the first data is hot data based at least on the access parameter;

[0240] A cache module 13, configured to cache the first data in a second memory when the first data is hot data;

[0241] Wherein, a data access rate of the second memory is greater than a data access rate of the first memory.

[0242] In an optional implementation, the access parameter includes a frequency at which the first data is accessed;

[0243] The first determining module comprises:

[0244] A first acquisition unit, used to acquire a preset frequency;

[0245] A first determining unit, configured to determine whether the accessed frequency is greater than a preset frequency;

[0246] The second determining unit is configured to determine that the first data is hot data when the access frequency is greater than a preset frequency.

[0247] In an optional implementation, the first acquiring unit includes:

[0248] A first acquisition subunit, configured to acquire an application type of an application accessing the first data;

[0249] The second acquisition subunit is used to acquire a preset frequency suitable for the application type from a plurality of preset frequencies.

[0250] In an optional implementation, the access parameter includes the interval between the time when the first data was last accessed and the current time;

[0251] The first determining module comprises:

[0252] A second obtaining unit, used to obtain a preset interval duration;

[0253] A third determining unit, configured to determine whether the interval duration is less than a preset interval duration;

[0254] The fourth determination unit is used to determine that the first data is hot data when the interval duration is less than a preset interval duration.

[0255] In an optional implementation, the access parameter includes: a frequency at which the first data is accessed and a time interval between a time when the first data was last accessed and a current time;

[0256] The first determining module comprises:

[0257] A fifth determining unit, configured to determine a hotspot degree of the first data based on the access frequency and the interval duration;

[0258] A third acquisition unit is used to acquire a preset hotspot degree;

[0259] A sixth determining unit, configured to determine whether the hotspot degree is greater than a preset hotspot degree;

[0260] The seventh determination unit is used to determine that the first data is hotspot data when the hotspot degree is greater than the preset hotspot degree.

[0261] In an optional implementation, the third acquisition unit includes:

[0262] a third acquisition subunit, configured to acquire an application type of an application accessing the first data;

[0263] The fourth acquisition subunit is used to acquire a preset hotspot degree suitable for the application type from a plurality of preset hotspot degrees.

[0264] In an optional implementation, the first determining module includes:

[0265] An input unit is used to input the access parameter into a data type determination model to obtain an output result output by the data type determination model to indicate whether the first data is hot data.

[0266] In an optional implementation, the first determining module further includes:

[0267] A fourth acquisition unit is used to acquire a sample data set, wherein the sample data set includes sample access parameters of a plurality of sample data and a labeling result of whether each labeled sample data is a hotspot data;

[0268] A training unit is used to train the model based on the sample data set until the parameters in the model converge to obtain the data type determination model.

[0269] In an optional implementation, the device further includes:

[0270] A second determining module, used to determine whether the free storage space of the second memory is smaller than the space occupied by the first data;

[0271] A second acquisition module, configured to acquire a frequency of access of each second data in the second memory when the free storage space is smaller than the occupied space;

[0272] The first deletion module is used to delete at least one second data in the second memory in order of access frequency from low to high, so that the free storage space of the second memory is greater than or equal to the occupied space.

[0273] In an optional implementation, the device further includes:

[0274] A third determining module, used to determine whether the free storage space of the second memory is smaller than the space occupied by the first data;

[0275] A third acquisition module, configured to acquire, when the free storage space is smaller than the occupied space, the interval between the time when each second data in the second memory is accessed and the current time;

[0276] The second deleting module is used to delete at least one second data in the second memory in order of interval duration from long to short, so that the free storage space of the second memory is greater than or equal to the occupied space.

[0277] In an optional implementation, the device further includes:

[0278] a fourth determining module, configured to determine whether the free storage space of the second memory is smaller than the space occupied by the first data;

[0279] a fourth acquisition module, configured to acquire, when the free storage space is smaller than the occupied space, a frequency at which each second data in the second storage is accessed, and an interval between a time at which each second data in the second storage is accessed and a current time;

[0280] A fifth determining module, configured to determine a hotspot degree of each second data in the second memory based on the acquired access frequency and interval duration;

[0281] The third deletion module is used to delete at least one second data in the second memory in order of hotspot degree from low to high, so that the free storage space of the second memory is greater than or equal to the occupied space.

[0282] In an optional implementation, the device further includes:

[0283] The response module is used for responding to the update instruction after the first data is cached in the second memory if an update instruction for the first data in the first memory is received during the process of caching the first data in the second memory.

[0284] In an optional implementation, the response module is specifically configured to: update the first data stored in the second memory, and then update the first data stored in the first memory.

[0285] In the present application, access parameters of first data in a first memory are obtained; whether the first data is hot data is determined at least based on the access parameters; and if the first data is hot data, the first data is cached in a second memory.

[0286] In this way, if the processor needs to access the first data when processing an application, the processor can directly access the first data in the second memory, and then process the application based on the first data. Since the data access rate of the second memory is greater than the data access rate of the first memory, the present application can increase the rate at which the processor accesses the first data, thereby improving the processing efficiency of the application that needs to be based on the first data.

[0287] Secondly, since the first data is the hot data in the first memory, the first data can be the data in the first memory that is accessed very many times in the time period of the current moment. The number of times the first data is accessed in the time period of the current moment is often greater than the number of times other data in the first memory are accessed in the time period of the current moment, so the first data involves more applications that need to be processed than the other data in the first memory. Therefore, the present application can improve the processing efficiency of more applications as much as possible.

[0288] The embodiment of the present application also provides a non-volatile readable storage medium, which stores one or more modules (programs). When the one or more modules are applied to a device, the device can execute instructions (instructions) of each method step in the embodiment of the present application.

[0289] The present application embodiment provides one or more machine-readable media on which instructions are stored, and when executed by one or more processors, the electronic device executes one or more of the methods described in the above embodiments. In the present application embodiment, the electronic device includes a server, a gateway, a sub-device, etc., and the sub-device is an Internet of Things device or other device.

[0290] The embodiments of the present disclosure may be implemented as an apparatus configured as desired using any appropriate hardware, firmware, software, or any combination thereof, and the apparatus may include electronic devices such as servers (clusters), terminal devices such as IoT devices, and the like.

[0291] Figure 6An exemplary apparatus 1300 that can be used to implement various embodiments described in this application is schematically shown.

[0292] For one embodiment, Figure 6 An exemplary apparatus 1300 is shown having one or more processors 1302, a control module (chip set) 1304 coupled to at least one of the (one or more) processors 1302, a memory 1306 coupled to the control module 1304, a non-volatile memory (NVM) / storage device 1308 coupled to the control module 1304, one or more input / output devices 1310 coupled to the control module 1304, and a network interface 1312 coupled to the control module 1306.

[0293] The processor 1302 may include one or more single-core or multi-core processors, and the processor 1302 may include any combination of general-purpose processors or special-purpose processors (such as graphics processors, application processors, baseband processors, etc.). In some embodiments, the device 1300 can be used as a server device such as a gateway described in the embodiments of the present application.

[0294] In some embodiments, the device 1300 may include one or more computer-readable media (e.g., memory 1306 or NVM / storage device 1308) having instructions 1314 and one or more processors 1302 configured to execute the instructions 1314 in combination with the one or more computer-readable media to implement a module to perform the actions described in the present disclosure.

[0295] For one embodiment, the control module 1304 may include any suitable interface controller to provide any suitable interface to at least one of the processor(s) 1302 and / or any suitable device or component in communication with the control module 1304 .

[0296] The control module 1304 may include a memory controller module to provide an interface to the memory 1306. The memory controller module may be a hardware module, a software module, and / or a firmware module.

[0297] The memory 1306 may be used, for example, to load and store data and / or instructions 1314 for the device 1300. For one embodiment, the memory 1306 may include any suitable volatile memory, such as a suitable DRAM. In some embodiments, the memory 1306 may include double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).

[0298] For one embodiment, control module 1304 may include one or more input / output controllers to provide an interface to NVM / storage device 1308 and input / output device(s) 1310 .

[0299] For example, NVM / storage 1308 may be used to store data and / or instructions 1314. NVM / storage 1308 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable non-volatile storage device(s) (e.g., one or more hard disk drives (HDDs), one or more compact disk (CD) drives, and / or one or more digital versatile disk (DVD) drives).

[0300] NVM / storage device 1308 may include storage resources that are physically part of the device on which apparatus 1300 is installed, or it may be accessible to the device without being part of the device. For example, NVM / storage device 1308 may be accessed via input / output device(s) 1310 over a network.

[0301] (One or more) input / output devices 1310 may provide an interface for the apparatus 1300 to communicate with any other appropriate device, and the input / output device 1310 may include a communication component, an audio component, a sensor component, etc. The network interface 1312 may provide an interface for the apparatus 1300 to communicate through one or more networks, and the apparatus 1300 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols, for example, accessing a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, etc., or a combination thereof for wireless communication.

[0302] For one embodiment, at least one of the processor(s) 1302 may be packaged together with the logic of one or more controllers (e.g., a memory controller module) of the control module 1304. For one embodiment, at least one of the processor(s) 1302 may be packaged together with the logic of one or more controllers of the control module 1304 to form a system-in-package (SiP). For one embodiment, at least one of the processor(s) 1302 may be integrated on the same die with the logic of one or more controllers of the control module 1304. For one embodiment, at least one of the processor(s) 1302 may be integrated on the same die with the logic of one or more controllers of the control module 1304 to form a system-on-chip (SoC).

[0303] In various embodiments, the device 1300 may be, but is not limited to, a terminal device such as a server, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). In various embodiments, the device 1300 may have more or fewer components and / or a different architecture. For example, in some embodiments, the device 1300 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.

[0304] An embodiment of the present application provides an electronic device, comprising: one or more processors; and one or more machine-readable media having instructions stored thereon, which, when executed by the one or more processors, enable the server to execute the data processing method as described in one or more of the embodiments of the present application.

[0305] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0306] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0307] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0308] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0309] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0310] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0311] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0312] The data processing method and device provided by the present application are introduced in detail above. The principles and implementation methods of the present application are explained in this article using specific examples. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A data processing method, characterized in that: The method comprises: Obtaining access parameters of first data in the first memory; determining whether the first data is hot data based at least on the access parameter; When the first data is hot data, caching the first data in a second memory; wherein the data access rate of the second memory is greater than the data access rate of the first memory; The method further comprises: During the process of caching the first data in the second memory, if an update instruction for the first data in the first memory is received, responding to the update instruction after the first data is cached in the second memory; The responding to the update instruction comprises: updating the first data stored in the first memory; After the first data stored in the first memory is updated, determining whether the second memory has cached the first data; When it is determined that the first data is cached in the second memory, the first data cached in the second memory is updated.

2. The method according to claim 1, characterized in that The access parameter includes a frequency at which the first data is accessed; The determining whether the first data is hot data based at least on the access parameter comprises: Get the preset frequency; Determining whether the accessed frequency is greater than a preset frequency; When the access frequency is greater than a preset frequency, the first data is determined to be hot data.

3. The method according to claim 2, characterized in that The obtaining of the preset frequency comprises: Acquire an application type of an application accessing the first data; Among a plurality of preset frequencies, a preset frequency suitable for the application type is obtained.

4. The method according to claim 1, characterized in that: The access parameter includes the interval between the time when the first data was last accessed and the current time; The determining whether the first data is hot data based at least on the access parameter comprises: Get the preset interval duration; Determine whether the interval duration is less than a preset interval duration; When the interval duration is less than a preset interval duration, it is determined that the first data is hot data.

5. The method according to claim 1, characterized in that The access parameters include: the frequency of access to the first data and the interval between the time when the first data was last accessed and the current time; The determining whether the first data is hot data based at least on the access parameter comprises: Determine the hotspot degree of the first data based on the access frequency and the interval duration; Get the preset hotspot level; Determining whether the hotspot degree is greater than a preset hotspot degree; When the hotspot degree is greater than the preset hotspot degree, the first data is determined to be hotspot data.

6. The method according to claim 5, characterized in that The step of obtaining the preset hotspot degree includes: Acquire an application type of an application accessing the first data; Among a plurality of preset hotspot levels, a preset hotspot level suitable for the application type is obtained.

7. The method according to claim 1, characterized in that The determining whether the first data is hot data based at least on the access parameter comprises: The access parameter is input into a data type determination model to obtain an output result output by the data type determination model for indicating whether the first data is hot data.

8. The method according to claim 7, characterized in that The data type determines how the model is trained, including: Acquire a sample data set, wherein the sample data set includes sample access parameters of a plurality of sample data, and a marking result of whether each marked sample data is a hotspot data; The model is trained based on the sample data set until the parameters in the model converge, thereby obtaining the data type determination model.

9. The method according to claim 1, characterized in that: Before caching the first data in the second memory, the method further includes: Determining whether the free storage space of the second memory is smaller than the space occupied by the first data; When the free storage space is smaller than the occupied space, obtaining a frequency at which each second data in the second memory is accessed; At least one second data in the second memory is deleted in order of access frequency from low to high, so that the free storage space of the second memory is greater than or equal to the occupied space.

10. The method according to claim 1, characterized in that Before caching the first data in the second memory, the method further includes: Determining whether the free storage space of the second memory is smaller than the space occupied by the first data; When the free storage space is smaller than the occupied space, obtaining the interval between the time when each second data in the second memory is accessed and the current time; At least one second data in the second memory is deleted in order of interval duration from long to short, so that the free storage space of the second memory is greater than or equal to the occupied space.

11. The method according to claim 1, characterized in that: Before caching the first data in the second memory, the method further includes: Determining whether the free storage space of the second memory is smaller than the space occupied by the first data; In a case where the free storage space is smaller than the occupied space, obtaining a frequency at which each second data in the second storage is accessed, and obtaining a time interval between a time at which each second data in the second storage is accessed and a current time; Determine the hotspot degree of each second data in the second memory based on the acquired access frequency and interval duration; At least one second data in the second memory is deleted in order of hotspot degree from low to high, so that the free storage space of the second memory is greater than or equal to the occupied space.

12. The method according to claim 1, characterized in that The responding to the update instruction comprises: The first data stored in the second memory is updated, and then the first data stored in the first memory is updated.

13. A data processing device, characterized in that: The device comprises: A first acquisition module, used to acquire access parameters of first data in the first memory; A first determination module, configured to determine whether the first data is hot data based at least on the access parameter; a cache module, configured to cache the first data in a second memory when the first data is hot data; wherein the data access rate of the second memory is greater than the data access rate of the first memory; The device also includes: a response module, configured to respond to the update instruction after the first data is cached in the second memory if an update instruction for the first data in the first memory is received during the process of caching the first data in the second memory; The response module is specifically used to: update the first data stored in the first memory; after the first data stored in the first memory is updated, determine whether the second memory has cached the first data; if it is determined that the first data is cached in the second memory, update the first data cached in the second storage.

14. The device according to claim 13, characterized in that The access parameter includes a frequency at which the first data is accessed; The first determining module comprises: A first acquisition unit, used to acquire a preset frequency; A first determining unit, configured to determine whether the accessed frequency is greater than a preset frequency; The second determining unit is configured to determine that the first data is hot data when the access frequency is greater than a preset frequency.

15. The device according to claim 14, characterized in that The first acquiring unit includes: A first acquisition subunit, configured to acquire an application type of an application accessing the first data; The second acquisition subunit is used to acquire a preset frequency suitable for the application type from a plurality of preset frequencies.

16. The device according to claim 13, characterized in that The access parameter includes the interval between the time when the first data was last accessed and the current time; The first determining module comprises: A second obtaining unit, used to obtain a preset interval duration; A third determining unit, configured to determine whether the interval duration is less than a preset interval duration; The fourth determination unit is used to determine that the first data is hot data when the interval duration is less than a preset interval duration.

17. The device according to claim 13, characterized in that The access parameters include: the frequency of access to the first data and the interval between the time when the first data was last accessed and the current time; The first determining module comprises: A fifth determining unit, configured to determine a hotspot degree of the first data based on the access frequency and the interval duration; A third acquisition unit is used to acquire a preset hotspot degree; A sixth determining unit, configured to determine whether the hotspot degree is greater than a preset hotspot degree; The seventh determination unit is used to determine that the first data is hotspot data when the hotspot degree is greater than the preset hotspot degree.

18. The device according to claim 17, characterized in that The third acquisition unit includes: a third acquisition subunit, configured to acquire an application type of an application accessing the first data; The fourth acquisition subunit is used to acquire a preset hotspot degree suitable for the application type from a plurality of preset hotspot degrees.

19. The device according to claim 13, characterized in that The first determining module comprises: An input unit is used to input the access parameter into a data type determination model to obtain an output result output by the data type determination model to indicate whether the first data is hot data.

20. The device according to claim 19, characterized in that The first determining module also includes: A fourth acquisition unit is used to acquire a sample data set, wherein the sample data set includes sample access parameters of a plurality of sample data and a labeling result of whether each labeled sample data is a hotspot data; A training unit is used to train the model based on the sample data set until the parameters in the model converge to obtain the data type determination model.

21. The device according to claim 13, characterized in that The device also includes: A second determining module, used to determine whether the free storage space of the second memory is smaller than the space occupied by the first data; A second acquisition module, configured to acquire a frequency of access of each second data in the second memory when the free storage space is smaller than the occupied space; The first deletion module is used to delete at least one second data in the second memory in order of access frequency from low to high, so that the free storage space of the second memory is greater than or equal to the occupied space.

22. The device according to claim 13, characterized in that The device also includes: A third determining module, used to determine whether the free storage space of the second memory is smaller than the space occupied by the first data; A third acquisition module, configured to acquire, when the free storage space is smaller than the occupied space, the interval between the time when each second data in the second memory is accessed and the current time; The second deleting module is used to delete at least one second data in the second memory in order of interval duration from long to short, so that the free storage space of the second memory is greater than or equal to the occupied space.

23. The device according to claim 13, characterized in that The device also includes: a fourth determining module, configured to determine whether the free storage space of the second memory is smaller than the space occupied by the first data; a fourth acquisition module, configured to acquire, when the free storage space is smaller than the occupied space, a frequency at which each second data in the second storage is accessed, and an interval between a time at which each second data in the second storage is accessed and a current time; A fifth determining module, configured to determine a hotspot degree of each second data in the second memory based on the acquired access frequency and interval duration; The third deletion module is used to delete at least one second data in the second memory in order of hotspot degree from low to high, so that the free storage space of the second memory is greater than or equal to the occupied space.

24. The device according to claim 13, characterized in that The response module is specifically used to: update the first data stored in the second memory, and then update the first data stored in the first memory.

25. An electronic device, characterized in that: The electronic device comprises: Processor; and A memory having executable codes stored thereon, which, when the executable codes are executed, enable the processor to execute the data processing method according to any one of claims 1 to 12.

26. One or more machine-readable media, characterized in that An executable code is stored thereon, and when the executable code is executed, the processor executes the data processing method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Processing method and system of data access

    CN103177005A

  • Method and device to migrate resource data

    CN108228110A