WO2020073328A1 - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
WO2020073328A1
WO2020073328A1 PCT/CN2018/110111 CN2018110111W WO2020073328A1 WO 2020073328 A1 WO2020073328 A1 WO 2020073328A1 CN 2018110111 W CN2018110111 W CN 2018110111W WO 2020073328 A1 WO2020073328 A1 WO 2020073328A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
address
requested
information
cache
Prior art date
Application number
PCT/CN2018/110111
Other languages
French (fr)
Chinese (zh)
Inventor
张伟
刘威
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2018/110111 priority Critical patent/WO2020073328A1/en
Priority to CN201880097522.4A priority patent/CN112673359A/en
Publication of WO2020073328A1 publication Critical patent/WO2020073328A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/12Replacement control

Definitions

  • the embodiments of the present application relate to the field of computer technology, and in particular, to a data processing method and device.
  • the cache memory is used to store frequently used data to facilitate quick access.
  • Cache When Cache is used, a copy of some content in the memory is saved in the Cache.
  • the Central Processing Unit CPU
  • the CPU When reading and writing data, the Central Processing Unit (CPU) first To access the Cache, the CPU only accesses the memory when there is no data required by the CPU in the Cache, and transfers the entire data block containing the storage unit to the Cache, so that several subsequent memory accesses can be converted to the Cache access. If the Cache memory is full, it is necessary to use the block information to replace the original block of information in the Cache according to a replacement algorithm / strategy under the control of the replacement control component.
  • Embodiments of the present application provide a data processing method and device, which can associate a detection mechanism of a hot data stream and a cold data stream, and the two cooperate with each other, which can effectively reduce the probability of the cold data stream replacing the hot data stream in the cache.
  • a first aspect of an embodiment of the present application provides a data processing method.
  • the method includes: receiving a request instruction, where the request instruction carries address information of the requested data; and determining whether the data requested by the request instruction has been saved in the cache memory In the Cache, and to determine whether the data requested by the request instruction is a hot data stream, if it is determined that the data requested by the request instruction is not stored in the above Cache, and the data requested by the request instruction is a hot data stream, according to the address of the requested data Information, query the first information table to determine the target address of the requested data in the cache, where the hot data stream refers to data whose access frequency is greater than or equal to a preset threshold; the first information table includes one or more first Address, the first address corresponds one-to-one with the second address in the cache, the first information table further includes an attribute identifier corresponding to each first address, the attribute identifier includes a first identifier and a second identifier, the first The identifier is used to indicate that the data at
  • the target address is the second address corresponding to any first address whose attribute identifier is the first identifier in the first information table; copy the data requested by the request instruction to the Cache. On the above target address. Based on this solution, by identifying the second address corresponding to any first address of the first identifier in the attribute of the first information table, it is determined as the target address of the hot data stream not stored in the cache, so that the When data is replaced, only the data that can be replaced will be replaced, and the data that cannot be replaced will not be replaced, so the probability of the cold data stream replacing the hot data stream in the Cache can be reduced.
  • the method further includes: if the data requested by the request instruction is successfully copied to the target address in the cache, the first information table corresponds to the target address The attribute identifier of the first address is reset to the second identifier.
  • the request data (Hot data stream)
  • the data identified as non-replaceable data can effectively degrade the probability that the cold data stream replaces the hot data stream.
  • the address information of the request data includes row address information
  • the first information table includes one or more rows, each of which includes one Or a plurality of first addresses, querying the first information table according to the address information of the request data, and determining the target address of the request data, including: searching the row indicated by the row address information in the first information table; in the row In the row indicated by the address information, select any one of the attribute addresses as the first address of the first identifier, and determine that the second address in the Cache corresponding to the first address is the target address.
  • the first address that identifies any attribute in the row indicated by the row address information as the first identifier can be determined as the target address, so that when the data in the cache is replaced, only the data that can be replaced is replaced, The data that cannot be replaced will not be replaced, and the efficiency of data processing can be improved while reducing the probability of the cold data stream replacing the hot data stream in the cache.
  • the method further includes: if it is determined that the data requested by the request instruction is stored in the cache, and the data requested by the request instruction is hot data Search for the second address of the requested data in the cache; reset the attribute identifier of the first address corresponding to the second address in the first information table to the second identifier. Based on this solution, by resetting the first address in the first information table corresponding to the second address of the hot data stream in the Cache to the second identifier, the hot data stream is identified as data that cannot be replaced, It can reduce the probability that the cold data stream replaces the hot data stream in the cache.
  • the method further includes: if it is determined that the data requested by the request instruction is a cold data stream, according to the address information of the request data, the The second information table replaces the address information in any third address with the address information of the above-mentioned request data; wherein, the cold data stream refers to data whose access frequency is less than the preset threshold; the second information table contains one or more A third address, the third address includes address information.
  • the address information in any third address in the second information table can be replaced with the address information of the request data, so that when the access frequency of the request instruction is high, the data requested by the request instruction can be detected as hot data flow.
  • the second information table includes one or more rows, and each row includes one or more third addresses.
  • replace the address information in any third address with the address information of the request data in the second information table including: according to the address information of the request data, replace the above information in the second information table
  • the address information in any third address in the line indicated by the line address information is replaced with the address information of the above-mentioned request data.
  • the attribute identifiers of any row in the first information table are all second identifiers
  • the rows in which all are second identifiers All attribute identifiers are reset to the first identifier.
  • the above method further includes: searching for the row indicated by the above row address information in the second information table according to the address information of the above request data; if the The address information of the requested data is the same as the address information included in any third address in the row indicated by the row address information in the second information table, and it is determined that the data requested by the request instruction is a hot data stream; if the address of the requested data The information is different from the address information included in all the third addresses in the row indicated by the row address information in the second information table, and it is determined that the data requested by the request instruction is a cold data stream. Based on this solution, it can be determined according to the second information table that the data requested by the request instruction is a hot data stream or a cold data stream.
  • a second aspect of an embodiment of the present application provides a chip including a processor, a memory controller, and a cache memory, wherein the processor is used to send a request instruction, and the request instruction carries the address of the requested data Information; the memory controller, used to receive the request command sent by the processor; determine whether the data requested by the request command has been saved in the cache memory, and determine whether the data requested by the request command is a hot data stream If it is determined that the data requested by the request instruction is not stored in the Cache, and the data requested by the request instruction is a hot data stream, query the first information table according to the address information of the request data to determine the requested data in the Cache Target address, where the hot data stream refers to data with an access frequency greater than or equal to a preset threshold; the first information table includes one or more first addresses, and the first addresses correspond one-to-one with the second addresses in the cache , The above-mentioned first information table further includes an attribute identifier corresponding to each first address, and the attribute identifier The identification includes
  • the first identification is used to indicate that the data at the corresponding second address can be replaced
  • the second identification is used to indicate that the data at the corresponding second address cannot be replaced.
  • the target address is a second address corresponding to any first address whose attribute identifier is the first identifier in the first information table; copy the data requested by the request instruction to the target address in the cache.
  • the memory controller is further configured to, if the data requested by the request instruction is successfully copied to the target address in the cache, add the first information table to the The attribute identifier of the first address corresponding to the target address is reset to the second identifier.
  • the address information of the request data includes row address information
  • the first information table includes one or more rows, and each row includes one Or a plurality of first addresses
  • the memory controller is also used to search for the row indicated by the row address information in the first information table; select any attribute identifier as the first identifier in the row indicated by the row address information For the first address, determine that the second address in the Cache corresponding to the first address is the target address.
  • the memory controller is further configured to determine that the data requested by the request instruction is stored in the cache and the data requested by the request instruction For hot data flow, search for the second address of the requested data in the Cache; reset the attribute identifier of the first address corresponding to the second address in the first information table to the second identifier.
  • the memory controller is further configured to determine that the data requested by the request instruction is a cold data stream, based on the address information of the request data, In the second information table, replace the address information in any third address with the address information of the request data; wherein, the cold data stream refers to data whose access frequency is less than the preset threshold; the second information table contains One or more third addresses, the third address including address information.
  • the memory controller is specifically configured to indicate the row address information in the second information table according to the address information of the request data The address information in any third address in the row of is replaced with the address information of the above request data.
  • the foregoing memory controller is further configured to, if the attribute identifiers of any row in the first information table are all second identifiers, Reset all attribute identifiers in the row of the second identifier to the first identifier.
  • the foregoing memory controller is further configured to search for the row indicated by the row address information in the second information table according to the address information of the request data If the address information of the requested data is the same as the address information included in any third address in the row indicated by the row address information in the second information table, it is determined that the data requested by the request instruction is a hot data stream; if the above request The address information of the data is different from the address information included in all the third addresses in the row indicated by the row address information in the second information table, and it is determined that the data requested by the request instruction is a cold data stream.
  • a server in a third aspect of the embodiments of the present application, includes a processor and a memory.
  • the memory is used to couple with the processor to store necessary program instructions and data of the server.
  • the processor is used to execute The program instructions stored in the memory cause the server to execute the above method.
  • a computer storage medium in which computer program code is stored, and when the computer program code runs on a processor, the processor is caused to execute the first aspect Or the data processing method described in any one of the possible implementation manners of the first aspect.
  • a fifth aspect of the embodiments of the present application provides a computer program product that stores computer software instructions executed by the processor, and the computer software instructions include a program for executing the solution described in the above aspect.
  • an apparatus exists in the form of a chip product.
  • the structure of the apparatus includes a processor and a memory.
  • the memory is used to couple with the processor to store necessary programs of the apparatus Instruction and data, the processor is used to execute the program instructions stored in the memory, so that the device performs the function of the data processing device in the above method.
  • FIG. 1 is an architectural diagram of a computer system provided by an embodiment of the present application
  • FIG. 2 is a flowchart of a data processing method provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a second information table provided by an embodiment of this application.
  • FIG. 4 is a schematic diagram of a first information table provided by an embodiment of this application.
  • FIG. 5 is an application schematic diagram of a data processing method provided by an embodiment of the present application.
  • FIG. 6 is a flowchart of another data processing method provided by an embodiment of the present application.
  • FIG. 7 is an application schematic diagram of another data processing method provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of application of another data processing method provided by an embodiment of the present application.
  • FIG. 11 is a flowchart of another data processing method provided by an embodiment of this application.
  • FIG. 12 is an application schematic diagram of another data processing method provided by an embodiment of the present application.
  • FIG. 13 is a schematic diagram of the composition of a data processing device provided by an embodiment of the present application.
  • 15 is a schematic diagram of the composition of a chip provided by an embodiment of the present application.
  • An embodiment of the present application provides a data processing method, which can be applied to the computer system 100 shown in FIG. 1.
  • the computer system shown in FIG. 1 may include a processor 101, a memory controller 102, and a first-level memory 103 ⁇ ⁇ Secondary storage 104.
  • the processor 101 is a control center of the computer system 100, and is used to run an operating system of the computer system 100 and applications (including system applications and third-party applications) on the computer 100.
  • the processor 101 may specifically be a central processing unit (CPU), which may implement or execute various exemplary logical blocks, modules, and modules described in conjunction with the contents disclosed in the embodiments of the present application.
  • the circuit; the processor may also be a combination that realizes a calculation function, for example, including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc. This embodiment of the present application does not limit this.
  • the memory controller 102 is used to manage data in the first-level storage and the second-level storage.
  • the memory controller may be a cache controller, which is used to manage data in the cache.
  • the first-level memory 103 is used to cache data in the second-level memory, and is also used to support cache access.
  • the first-level memory 103 may be a cache memory Cache between the processor and the memory, which is used to improve the read and write performance of the system.
  • the data in the cache can be part of the data in the memory.
  • the processor 101 can obtain the data to be accessed from the Cache instead of obtaining the data to be accessed from the memory, thereby speeding up the reading speed.
  • the first-level memory is used as the cache memory Cache as an example for description.
  • the second level memory 104 is used to store all instructions and data.
  • the second-level memory 104 may be the memory of the computer system 100.
  • the second-level memory 104 may specifically include volatile memory (volatile memory), such as random-access memory (RAM); the memory may also include non-volatile memory (non-volatile memory). volatile memory), such as a read-only memory (Read Only Memory, ROM); the memory may also include a combination of the above types of memory.
  • volatile memory such as random-access memory (RAM)
  • non-volatile memory non-volatile memory
  • volatile memory such as a read-only memory (Read Only Memory, ROM); the memory may also include a combination of the above types of memory.
  • FIG. 1 is only an exemplary description. In practical applications, the computer system 100 may include more or fewer components than those shown in FIG. 1, and the structure shown in FIG. 1 does not constitute the computer system provided by the embodiments of the present application. Any restrictions.
  • a data processing method can associate the detection mechanism of the hot data stream and the cold data stream. The two cooperate with each other to reduce the probability that the cold data stream replaces the hot data stream in the cache.
  • the data processing method provided in this embodiment of the present application may include steps S201-S203.
  • the memory controller receives the request instruction.
  • the above request instruction carries the address information of the request data, and the address of the request data is a logical address.
  • the memory controller may receive a request instruction sent by the processor, and the request instruction may be any access request sent by the processor.
  • the above request instruction may be a read request or a write request sent by the processor, and the read request or the write request is used to read or write data in the first-level memory and / or the second-level memory.
  • the address information of the request data carried in the above request instruction may include row address information, and the row address information may be row address information divided according to a preset rule, for example, the attributes of the data may be classified into rows.
  • a preset rule for example, the attributes of the data may be classified into rows.
  • the row address information may be recorded as RowID.
  • the hot data stream refers to data whose access frequency is greater than or equal to a preset threshold, that is, data that the processor frequently accesses.
  • a preset threshold that is, data that the processor frequently accesses.
  • the specific value of the preset threshold is not limited in this embodiment of the present application, and can be determined according to actual applications. .
  • the method for determining whether the data requested by the request instruction is a hot data stream in the embodiment of the present application may be implemented in various ways, for example, the number of accesses of the requested data within a preset time may be compared with the preset number of accesses, If the number of accesses to the requested data within a preset time is greater than or equal to the preset number of accesses, the requested data can be determined to be a hot data stream; for another example, the access frequency of the requested data can be compared with the preset threshold by counting the access frequency of the requested data For comparison, if the access frequency of the requested data is greater than or equal to the preset threshold, the requested data can be determined to be a hot data stream; for another example, the address information of the requested data in the second information table can be found by searching for the address information of the requested data It matches the address information of any requested data in the second information table, and it can be determined that the requested data is a hot data stream.
  • the embodiment of the present application does not limit the specific method for
  • the second information table may include one or more third addresses, and each third address includes address information.
  • the above-mentioned determination of whether the data requested by the request instruction is a hot data stream by searching the second information table may specifically include : Search in the second information table according to the address information of the requested data. If the address information of the requested data is the same as the address information included in any third address in the second information table, determine that the data requested by the request instruction is a hot data stream; If the address information of the requested data is different from the address information included in all the third addresses in the second information table, it is determined that the data requested by the request instruction is a cold data stream.
  • the second information table may include one or more rows, and each row includes one or more third addresses.
  • the second information table includes multiple rows, and each row includes 8 pieces of information.
  • Each information space records address information corresponding to 8 addresses (third address).
  • the third address marked as black in FIG. 3 stores the address information of the requested data, and the third address marked as white Store empty address information.
  • the embodiment of the present application does not limit the specific specifications of the second information table.
  • only eight information spaces are included in each row as an example for description.
  • the address information of the requested data can be matched with the address information included in the third address in the second information table. If the address information of the requested data includes row address information, and the address information of the requested data is Any third address in the row indicated by the row of address information in the second information table includes the same address information.
  • the data requested by the request instruction is data frequently accessed by the processor, and the data requested by the request instruction is determined to be hot Data flow; if the address information of the requested data is different from the address information included in all the third addresses in the row indicated by the row of address information in the second information table, it can be considered that the data requested by the request instruction is not frequently accessed by the processor Data, it is determined that the data requested by the request instruction is a cold data stream.
  • the above target address refers to the target address in the cache of the data requested by the request instruction. It can be understood that the data requested by the request instruction and the requested data in the embodiment of the present application are the same data.
  • the above-mentioned first information table is used to record the currently available Cache resources.
  • the first information table may include one or more first addresses, and the first addresses correspond one-to-one with the second addresses in the Cache.
  • the first information table may further include an attribute identifier corresponding to each first address.
  • the attribute identifier includes a first identifier and a second identifier. The first identifier is used to indicate that data on the corresponding second address can be replaced. The second identifier is used to indicate that the data at the corresponding second address cannot be replaced.
  • the target address of the foregoing request data may be a second address corresponding to any first address whose attribute identifier is the first identifier in the first information table.
  • the second address corresponding to the first address of any attribute identified as the first identification in the first information table may be determined as the target address, because the first address whose attribute is identified as the first identification corresponds to the first
  • the data stored at the second address is data that can be replaced, so the data stored at the target address of the requested data is data that can be replaced, and the requested data can be stored at the target address to replace the original data at the target address .
  • the first information table may include one or more rows, and each row includes one or more first addresses. As shown in FIG. 4, each row includes 8 information spaces, and each information space records Attribute identifiers corresponding to 8 addresses (first addresses), the attribute identifier corresponding to each first address may be the first identifier or the second identifier, the first identifier may be recorded as 0, and the second identifier may be recorded as 1.
  • the attribute ID of 0 means that the data of the first address in the corresponding second address in the Cache can be replaced, and the attribute ID of 1 means that the data of the first address in the corresponding second address in the Cache cannot be replaced
  • the first address corresponding to the hot data stream in the embodiment of the present application in the first information table may be identified as 1.
  • the embodiment of the present application does not limit the specifications of the first information table and the specific expression forms of the first identifier and the second identifier.
  • each row in the first information table includes 8 information spaces, and the first identifier is recorded as 0, the second mark is 1 as an example for description.
  • the target address of the foregoing request data may be a row indicated by row address information in the first information table, and the attribute identifier is a second address corresponding to any first address of the first identifier.
  • the second address corresponding to the first address whose first attribute is identified as the first identification in the row corresponding to the above-mentioned row address information in the first information table may be determined as the target address, since the first attribute identified as 0
  • the data stored at the second address corresponding to the address in the cache is data that can be replaced, so the data stored at the target address of the requested data is data that can be replaced.
  • the above querying the first information table according to the address information of the requested data to determine the target address of the requested data in the cache may include: searching the first information table for the row indicated by the row address information, where the row address information In the indicated line, select any one of the attribute addresses as the first address of the first identifier, and determine that the second address in the Cache corresponding to the first address is the target address.
  • the row address RowID carried in the request instruction if the row address is 2, in the row indicated by the row address RowID 2, randomly select any first address in the row whose attribute ID is 0 (Location), as shown in Fig. 5, there are 5 first addresses with attribute identification 0, and a first address (location) can be randomly selected from the 5 first addresses (location) with attribute identification 0, as shown in Fig. 5
  • the rowID indicates a first address with a column ID of 1 in the row indicated by 2 (the position identified as 0 in the dotted frame), and the second address corresponding to the first address in the cache is determined as the target address.
  • the data of the first address with the attribute ID of 0 at the corresponding second address in the Cache can be replaced, the data of the first address with the attribute ID of 1 at the corresponding second address of the Cache cannot be replaced, so this
  • by selecting the second address corresponding to any one of the first addresses with the attribute identifier of 0 as the target address it can be ensured that the data stored on the selected target address is data that can be replaced, not not Replaced data.
  • the data of the first address in the first information table with the attribute ID of 0 in the corresponding second address in the Cache is data that can be replaced
  • the first address in the first information table with the attribute ID of 1 in the Cache The data at the corresponding second address in the data is data that cannot be replaced, wherein the hot data stream can be identified as 1, and the data processing method in this embodiment of the present application can identify any attribute in the first information table as 0
  • a second address corresponding to a first address in the Cache is determined to be the target address, that is, the data identified as 0 is replaced, and the data identified as 1 is not replaced.
  • the data processing method in the embodiment of the present application can reduce the current There is a probability that a cold data stream replaces a hot data stream in the technology.
  • the memory controller copies the data requested by the request instruction to the target address in the cache.
  • the target address is a second address of data that can be replaced in the cache.
  • the data requested by the above request instruction is not stored in the cache and is a hot data stream, so the requested data can be copied from the memory to the target address in the cache. Since the target address is the second address corresponding to any first address whose attribute identifier is the first identifier in the first information table, when copying the requested data from the memory to the target address on the cache, the target address
  • the previously stored data that can be replaced is replaced with the request data, and during the replacement, only the data that can be replaced will be replaced, and the data that is identified as 1 that cannot be replaced will not be replaced.
  • step S203 it may further include: the memory controller obtains the requested data from the memory according to the address information of the requested data.
  • the request instruction by receiving a request instruction, the request instruction carries the address information of the requested data; if it is determined that the data requested by the request instruction is not stored in the cache, and the data requested by the request instruction is a hot data stream, According to the address information of the requested data, query the first information table to determine the target address of the requested data in the cache, where the target address is the second corresponding to any one of the first addresses whose attribute identifier is the first identifier in the first information table Address; copy the data requested by the request instruction to the target address in the Cache.
  • the target address of the hot data stream not hit in the cache is determined, so that the When data is replaced, only the data that can be replaced will be replaced, and the data that cannot be replaced will not be replaced. Therefore, the probability of the cold data stream replacing the hot data stream in the cache can be effectively reduced.
  • step S203 successfully copies the requested data to the cache
  • step S204 if the requested data is not successfully copied to the chip, a failure message is returned.
  • the memory controller resets the attribute identifier of the first address corresponding to the target address in the first information table to the second identifier.
  • the attribute identifier of the first address corresponding to the target address in the first information table is reset to 1, so the request data (hot data stream )
  • the attribute identifier of the corresponding first address in the first information table is a second identifier that cannot be replaced.
  • the request data reset to the second identifier is data that cannot be replaced. Therefore, when the data requested by the next request instruction is a hot data stream and is not hit in the cache, the above cannot be reset to The requested data of the second identifier is replaced, thereby reducing the probability that the cold data stream replaces the hot data stream in the cache.
  • the second information table can be used to determine whether the data requested by the request instruction is a hot data stream or a cold data stream
  • the attribute identifier in the first information table can be used to determine whether the resources in the cache can be replaced, and the request instruction Is not stored in the cache and is a hot data stream
  • the first information table corresponds to the target address
  • the attribute identifier of the first address is reset to a second identifier that cannot be replaced, so that the detection mechanism of the cold data stream and the hot data stream are unified and coordinated; and because the embodiment of the present application replaces the data in the cache, only The data with the identifier 0 can be replaced, but the data with the identifier 1 cannot be replaced. Therefore, the probability that the cold data stream can replace the hot data stream can be effectively reduced.
  • the request instruction by receiving a request instruction, the request instruction carries the address information of the requested data; if it is determined that the data requested by the request instruction is not stored in the cache, and the requested data is a hot data stream According to the address information of the requested data, query the first information table to determine the target address of the requested data in the cache, where the target address is the second corresponding to any one of the first addresses whose attribute identifier is the first identifier in the first information table Address; copy the data requested by the request instruction to the target address in the Cache; reset the attribute identifier of the first address corresponding to the target address in the first information table to the second identifier.
  • the attribute in the first information table is identified as the second address corresponding to any one of the first addresses in the first identifier, and is determined as the target address of the hot data stream not hit in the cache.
  • the data processing method further includes S205-S206.
  • the second address of the request data in the cache may be found according to the address information of the request data carried in the request instruction, the The second address corresponds to the first address in the first information table.
  • the memory controller resets the attribute identifier of the first address corresponding to the second address in the first information table to the second identifier.
  • the first address corresponding to the second address may be searched in the first information table according to the second address of the request data in the Cache, and The first address is reset to the second identification.
  • the attribute identifier of the first address corresponding to the second address may be the first identifier or the second ID, regardless of whether the attribute ID of the first address corresponding to the target address before resetting is the first ID or the second ID, the attribute ID needs to be reset to the second ID.
  • the request data is data that cannot be replaced.
  • the attribute identifier of the first address corresponding to the second address is set to 1 in the first information table, and the attribute identifier is 1 indicating that the second address is stored on the second address
  • the data cannot be replaced. Therefore, when the data requested by the next request instruction is a hot data stream and is stored in the cache, the above-mentioned request data reset to the second identification cannot be replaced.
  • the second information table can be used to determine whether the data requested by the request instruction is a hot data stream or a cold data stream
  • the attribute identifier in the first information table can be used to determine whether the resources in the Cache can be replaced, and then determine the request instruction request
  • the attribute identifier of the corresponding address in the first information table can be reset to a second identifier that cannot be replaced, so that the detection mechanism of the cold data stream and the hot data stream is unified Coordination; and because the embodiments of the present application replace the data in the Cache, only the data with the identifier 0 can be replaced, and the data with the identifier 1 can not be replaced, so it can be effectively downgraded The probability of a cold data stream replacing a hot data stream.
  • the request instruction by receiving the request instruction, the request instruction carries the address information of the requested data; if it is determined that the data requested by the request instruction is stored in the Cache and the requested data is a hot data stream, search for Request the second address of the data in the Cache; reset the attribute identifier of the first address corresponding to the second address in the first information table to the second identifier.
  • the data in the cache can be replaced without replacing the first address
  • the data stream whose attribute identifier is the second identifier in the information table is replaced, so the probability of the cold data stream replacing the hot data stream in the cache can be effectively reduced.
  • the data processing method further includes S207.
  • the memory controller replaces the address information in any third address in the second information table with the address information of the requested data in the second information table.
  • the cold data stream refers to data whose access frequency is less than a preset threshold, that is, data that the processor does not access frequently (less access times), and the specific value of the preset threshold is not limited in the embodiment of the present application. It can be determined according to the actual application.
  • replacing the address information in any third address with the address information of the request data in the second information table according to the address information of the request data may include: according to the address information of the request data, in the second In the information table, the address information in any third address in the row indicated by the row address information is replaced with the address information of the requested data. For example, as shown in FIG. 10, if it is determined that the data requested by the request instruction is a cold data stream (infrequently accessed data), any third address in the row indicated by the row address information may be replaced with the address information of the requested data , So that when the access frequency of the request instruction is relatively high, the data requested by the request instruction can be detected as a hot data stream.
  • replacing the instruction address information included in any third address in the row indicated by the row address information with the instruction address information of the request data may include: if any third address in the row indicated by the row address information If the address information of the requested data is stored, the address information of the requested data stored in the third address can be replaced with the address information of the data requested by the request instruction; if any one of the rows indicated by the address information of the row is third The address stores empty address information, and the empty address information stored in the third address can be replaced with the address information of the data requested by the request instruction.
  • the request data can be processed in steps S201-S204; if the data requested by the request instruction is successfully copied to the Cache, when the request instruction initiates a request again, the request instruction requests the The data is stored in the cache and is a hot data stream.
  • the data processing method of steps S205-S206 can be used to reset the attribute identifier of the first address corresponding to the second address in the first information table to the second identifier. During the data processing, the probability of the cold data stream replacing the hot data stream can be reduced.
  • the request instruction by receiving a request instruction, the request instruction carries address information of the requested data, and the address information of the requested data includes row address information; if it is determined that the data requested by the request instruction is a cold data stream, according to the request For the address information of the data, replace the address information in any third address in the row indicated by the row address information with the address information of the requested data in the second information table.
  • the data requested by the request instruction can be Is detected as a hot data stream and misses in the cache, and then the attribute in the first information table is identified as the second address corresponding to any first address in the first information table according to step S202, and is determined as the data requested by the request instruction Target address, so that when replacing the data in the Cache, only the data that can be replaced will be replaced, and the data that cannot be replaced will not be replaced. Therefore, the situation of replacing the cold data flow with the hot data flow in the Cache can be effectively reduced The probability of occurrence.
  • the data processing method further includes S208.
  • the memory controller resets all attribute identifiers in the rows that are all second identifiers to the first identifier.
  • the attribute identifier of any row in the first information table is all the second identifier, it can be determined that the data of the corresponding second address in the cache of each first address in the row cannot be replaced. The data corresponding to the stored row will become fixed data. In this way, if the data accessed by the processor is no longer the hot data stream stored in the current Cache, then the processor will need to continuously read data from memory when accessing The efficiency of Cache will not be used. Therefore, when the attribute identifiers of a row in the first information table are all the second identifiers, all the attribute identifiers of the row can be reset to the first identifier, so that the data stored in the Cache is replaced and a new one is restarted Wheel detection.
  • the request instruction by receiving a request instruction, the request instruction carries the address information of the requested data, and the address information of the requested data includes the row address information; if it is determined that the data requested by the request instruction is not stored in the cache, and The data requested by the request instruction is a hot data stream.
  • the first information table is queried to determine the target address of the requested data in the Cache, where the target address is the attribute identifier in the first information table as the first identifier The second address corresponding to any one of the first addresses; when the attribute identifiers of any row in the first information table are all the second identifiers, the memory controller resets all attribute identifiers in the rows that are all the second identifiers to The first logo.
  • the attribute in the first information table is identified as the second address corresponding to any one of the first addresses in the first identifier, and is determined as the target address of the hot data stream not hit in the cache.
  • the computer includes a hardware structure and / or a software module corresponding to each function.
  • the present application can be implemented in a combination of hardware and computer software. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
  • the computer may be divided into function modules according to the above method examples.
  • each function module may be divided corresponding to each function, or two or more functions may be integrated into one processing module.
  • the above integrated modules can be implemented in the form of hardware or software function modules. It should be noted that the division of the modules in the embodiment of the present invention is schematic, and is only a division of logical functions. In actual implementation, there may be another division manner.
  • FIG. 13 shows a possible structural schematic diagram of the data processing device involved in the above embodiment.
  • the data processing device 1300 includes: a receiving unit 1301 and a processing unit 1302 ⁇ RESET ⁇ 1303 ⁇ And reset unit 1303.
  • the receiving unit 1301 is used to support the data processing device 1300 to execute S201 in FIG. 2;
  • the processing unit 1302 is used to support the data processing device 1300 to execute S202-S203 in FIG. 2, or S205 in FIG. 8, or S207 in FIG. 9.
  • the reset unit 1303 is used to support the data processing device 1300 to execute S204 in FIG. 6, or S206 in FIG. 8, or S208 in FIG. 11.
  • the above data processing device 1300 may be the computer system 100 shown in FIG. 1, and at least one unit in the data processing device 1300 may be implemented in software, hardware, or a combination of software and hardware.
  • FIG. 14 shows a possible structural schematic diagram of the data processing apparatus 1400 involved in the foregoing embodiment.
  • the data processing device 1400 includes a memory 1401 and a processor 1402.
  • the processor 1402 is used to control and manage the operation of the data processing device.
  • the processor 1402 is used to support the data processing device to execute S201-S203 in FIG. 2, S201-S204 in FIG. 6, and S201-S206 in FIG. 8. , S201-S207 in FIG. 9, S201-S208 in FIG. 11, and / or other processes used in the techniques described herein.
  • the memory 1401 is used to store program codes and data corresponding to the data processing method performed by the data processing device 1400 according to any of the data processing methods provided above.
  • the data processing device 1400 may be the computer system 100 shown in FIG. 1.
  • the description of all relevant contents of the components involved in FIG. 1 above may be referred to the functional description of the corresponding component in FIG. 14, which will not be repeated here.
  • the chip 1500 includes: a processor 1501, a memory controller 1502, and a cache memory Cache 1503, where the processor 1501 is used to send a request instruction; the memory controller 1502 is used to execute S201-S203 in FIG. 2, S201-S204 in FIG. 6, S201-S206 in FIG. 8, S201-S207 in FIG. 9, S201-S208 in FIG. 11; cache Cache1503 is used in Support cache access to improve the read and write performance of the system.
  • the chip 1500 may be a chipset in the computer system 100 shown in FIG. 1. The description of all relevant contents of the components involved in FIG. 1 above can be referred to the functional description of the corresponding component in FIG. 15, which will not be repeated here.
  • the steps of the method or algorithm described in conjunction with the disclosure of the present application may be implemented by hardware, or by a processor executing software instructions.
  • Software instructions can be composed of corresponding software modules, which can be stored in random access memory (Random Access Memory, RAM), flash memory, erasable programmable read-only memory (Erasable Programmable ROM, EPROM), electrically erasable Programmably read only memory (Electrically EPROM, EEPROM), registers, hard disk, removable hard disk, CD-ROM or any other form of storage medium well known in the art.
  • An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and can write information to the storage medium.
  • the storage medium may also be an integral part of the processor.
  • the processor and the storage medium may be located in the ASIC.
  • the ASIC may be located in the core network interface device.
  • the processor and the storage medium may also exist as discrete components in the core network interface device.
  • Computer-readable media includes computer storage media and communication media, where communication media includes any medium that facilitates transfer of a computer program from one place to another.
  • the storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

Provided are a data processing method and device, relating to the technical field of computers, and resolving the issue of the prior art in which independent detection mechanisms of hot and cold data streams cause cold data streams to frequently replace hot data streams in a cache. The method comprises: receiving a request instruction, the request instruction carrying address information of data being requested; if the data being requested by the request instruction has not been stored in a cache and the data being requested by the request instruction is a hot data stream, querying, on the basis of the address information of the data being requested, a first information table, to determine in the cache a target address of the data being requested, wherein a first identifier is used to indicate that data corresponding to a second address can be replaced, and the target address is a second address corresponding to any one of the first addresses that has an attribute identified as a first identifier in the first information table; and copying the data being requested by the request instruction to the target address in the cache.

Description

一种数据处理方法和装置Data processing method and device 技术领域Technical field
本申请实施例涉及计算机技术领域,尤其涉及一种数据处理方法和装置。The embodiments of the present application relate to the field of computer technology, and in particular, to a data processing method and device.
背景技术Background technique
高速缓冲存储器Cache用于存储频繁使用的数据以利于快速访问,当采用Cache后,在Cache中保存着内存中部分内容的副本,中央处理器(Central Processing Unit,CPU)在读写数据时,首先访问Cache,只有当Cache中无CPU所需的数据时,CPU才去访问内存,并将包含此存储单元的整个数据块传到Cache中,使得以后的若干次对内存访问可转化为对Cache的访问。若Cache存储器已满,则需在替换控制部件的控制下,根据某种替换算法/策略,用此块信息替换掉Cache中的原来的某块信息。The cache memory is used to store frequently used data to facilitate quick access. When Cache is used, a copy of some content in the memory is saved in the Cache. When reading and writing data, the Central Processing Unit (CPU) first To access the Cache, the CPU only accesses the memory when there is no data required by the CPU in the Cache, and transfers the entire data block containing the storage unit to the Cache, so that several subsequent memory accesses can be converted to the Cache access. If the Cache memory is full, it is necessary to use the block information to replace the original block of information in the Cache according to a replacement algorithm / strategy under the control of the replacement control component.
现有的Cache替换策略中,热数据流(经常被访问的数据)和冷数据流(不经常被访问的数据)的检测是相互独立的,各有一套检测机制,消耗的资源较多,而且这种独立的检测机制将导致Cache中冷数据流替换热数据流的情况经常发生,降低了数据处理的效率。In the existing Cache replacement strategy, the detection of hot data streams (data that is frequently accessed) and cold data streams (data that is not frequently accessed) are independent of each other, and each has a set of detection mechanisms, which consumes more resources, and This independent detection mechanism will often cause cold data streams to replace hot data streams in the Cache, reducing the efficiency of data processing.
发明内容Summary of the invention
本申请实施例提供一种数据处理方法和装置,能够关联热数据流和冷数据流的检测机制,两者相互协作,能够有效降低Cache中冷数据流替换热数据流的情况发生的概率。Embodiments of the present application provide a data processing method and device, which can associate a detection mechanism of a hot data stream and a cold data stream, and the two cooperate with each other, which can effectively reduce the probability of the cold data stream replacing the hot data stream in the cache.
为达到上述目的,本申请实施例采用如下技术方案:To achieve the above purpose, the embodiments of the present application adopt the following technical solutions:
本申请实施例的第一方面,提供一种数据处理方法,该方法包括:接收请求指令,该请求指令中携带请求数据的地址信息;确定该请求指令请求的数据是否已经被保存在高速缓冲存储器Cache中,以及确定该请求指令请求的数据是否为热数据流,若确定该请求指令请求的数据未保存在上述Cache中,且该请求指令请求的数据为热数据流,根据上述请求数据的地址信息,查询第一信息表,确定上述请求数据在Cache中的目标地址,其中,该热数据流是指访问频率大于或等于预设阈值的数据;上述第一信息表包括一个或多个第一地址,该第一地址与Cache中的第二地址一一对应,上述第一信息表还包括与每个第一地址对应的属性标识,该属性标识包括第一标识和第二标识,该第一标识用于指示对应的第二地址上的数据可以被替换,该第二标识用于指示对应的第二地址上的数据不可以被替换,上述目标地址为上述第一信息表中属性标识为第一标识的任意一个第一地址对应的第二地址;将上述请求指令请求的数据复制至上述Cache中的上述目标地址上。基于本方案,通过将第一信息表中属性标识为第一标识的任意一个第一地址对应的第二地址,确定为未保存在Cache中的热数据流的目标地址,从而在对Cache中的数据进行替换时,仅会替换可以被替换的数据,不会将不能被替换的数据替换掉,因此可以降低Cache中冷数据流替换热数据流的情况发生的概率。A first aspect of an embodiment of the present application provides a data processing method. The method includes: receiving a request instruction, where the request instruction carries address information of the requested data; and determining whether the data requested by the request instruction has been saved in the cache memory In the Cache, and to determine whether the data requested by the request instruction is a hot data stream, if it is determined that the data requested by the request instruction is not stored in the above Cache, and the data requested by the request instruction is a hot data stream, according to the address of the requested data Information, query the first information table to determine the target address of the requested data in the cache, where the hot data stream refers to data whose access frequency is greater than or equal to a preset threshold; the first information table includes one or more first Address, the first address corresponds one-to-one with the second address in the cache, the first information table further includes an attribute identifier corresponding to each first address, the attribute identifier includes a first identifier and a second identifier, the first The identifier is used to indicate that the data at the corresponding second address can be replaced, and the second identifier is used to indicate the corresponding second The data at the address cannot be replaced. The target address is the second address corresponding to any first address whose attribute identifier is the first identifier in the first information table; copy the data requested by the request instruction to the Cache. On the above target address. Based on this solution, by identifying the second address corresponding to any first address of the first identifier in the attribute of the first information table, it is determined as the target address of the hot data stream not stored in the cache, so that the When data is replaced, only the data that can be replaced will be replaced, and the data that cannot be replaced will not be replaced, so the probability of the cold data stream replacing the hot data stream in the Cache can be reduced.
结合第一方面,在一种可能的实现方式中,上述方法还包括:若上述请求指令请求的数据成功复制至上述Cache中的上述目标地址上,将上述第一信息表中与上述目标地址对应的第一地址的属性标识重置为第二标识。基于本方案,通过将未在Cache中命中的热数据流成功复制至Cache上,并将第一信息表中与目标地址对应的第一地址属性标识重置为第二标识,从而使得该请求数据(热数据流)被标识为不可以被替换的数据,能够有效的降级冷数据流替换热数据流的情况发生的概率。With reference to the first aspect, in a possible implementation manner, the method further includes: if the data requested by the request instruction is successfully copied to the target address in the cache, the first information table corresponds to the target address The attribute identifier of the first address is reset to the second identifier. Based on this solution, by successfully copying the hot data stream not hit in the Cache to the Cache, and resetting the first address attribute identifier corresponding to the target address in the first information table to the second identifier, the request data (Hot data stream) The data identified as non-replaceable data can effectively degrade the probability that the cold data stream replaces the hot data stream.
结合第一方面和上述可能的实现方式,在另一种可能的实现方式中,上述请求数据的地址信息包含行地址信息,上述第一信息表包括一个或多个行,每个行中包括一个或多个第一地址,上述根据请求数据的地址信息,查询第一信息表,确定上述请求数据的目标地址,包括:在上述第一信息表中查找上述行地址信息指示的行;在该行地址信息指示的行中,选取任意一个属性标识为第一标识的第一地址,确定该第一地址对应的Cache中的第二地址为上述目标地址。基于本方案,能够将行地址信息指示的行中的任一属性标识为第一标识的第一地址确定为目标地址,从而在对Cache中的数据进行替换时,仅替换可以被替换的数据,不会将不能被替换的数据替换掉,能够在提高数据处理效率的同时,降低Cache中冷数据流替换热数据流的情况发生的概率。With reference to the first aspect and the foregoing possible implementation manner, in another possible implementation manner, the address information of the request data includes row address information, and the first information table includes one or more rows, each of which includes one Or a plurality of first addresses, querying the first information table according to the address information of the request data, and determining the target address of the request data, including: searching the row indicated by the row address information in the first information table; in the row In the row indicated by the address information, select any one of the attribute addresses as the first address of the first identifier, and determine that the second address in the Cache corresponding to the first address is the target address. Based on this solution, the first address that identifies any attribute in the row indicated by the row address information as the first identifier can be determined as the target address, so that when the data in the cache is replaced, only the data that can be replaced is replaced, The data that cannot be replaced will not be replaced, and the efficiency of data processing can be improved while reducing the probability of the cold data stream replacing the hot data stream in the cache.
结合第一方面和上述可能的实现方式,在另一种可能的实现方式中,上述方法还包括:若确定上述请求指令请求的数据保存在上述Cache中,且上述请求指令请求的数据为热数据流,查找该请求数据在Cache中的第二地址;将上述第一信息表中与该第二地址对应的第一地址的属性标识重置为第二标识。基于本方案,通过将热数据流在Cache中的第二地址对应的第一信息表中的第一地址重置为第二标识,从而使得该热数据流被标识为不可以被替换的数据,能够降低Cache中冷数据流替换热数据流的情况发生的概率。With reference to the first aspect and the foregoing possible implementation manners, in another possible implementation manner, the method further includes: if it is determined that the data requested by the request instruction is stored in the cache, and the data requested by the request instruction is hot data Search for the second address of the requested data in the cache; reset the attribute identifier of the first address corresponding to the second address in the first information table to the second identifier. Based on this solution, by resetting the first address in the first information table corresponding to the second address of the hot data stream in the Cache to the second identifier, the hot data stream is identified as data that cannot be replaced, It can reduce the probability that the cold data stream replaces the hot data stream in the cache.
结合第一方面和上述可能的实现方式,在另一种可能的实现方式中,上述方法还包括:若确定上述请求指令请求的数据为冷数据流,根据上述请求数据的地址信息,在上述第二信息表中将任意一个第三地址中的地址信息替换为上述请求数据的地址信息;其中,该冷数据流是指访问频率小于上述预设阈值的数据;该第二信息表包含一个或多个第三地址,该第三地址包括一个地址信息。基于本方案,能够将第二信息表中任意一个第三地址中的地址信息替换为请求数据的地址信息,以使得该请求指令访问频率较高时,该请求指令请求的数据可以被检测为热数据流。With reference to the first aspect and the foregoing possible implementation manner, in another possible implementation manner, the method further includes: if it is determined that the data requested by the request instruction is a cold data stream, according to the address information of the request data, the The second information table replaces the address information in any third address with the address information of the above-mentioned request data; wherein, the cold data stream refers to data whose access frequency is less than the preset threshold; the second information table contains one or more A third address, the third address includes address information. Based on this solution, the address information in any third address in the second information table can be replaced with the address information of the request data, so that when the access frequency of the request instruction is high, the data requested by the request instruction can be detected as hot data flow.
结合第一方面和上述可能的实现方式,在另一种可能的实现方式中,上述第二信息表包括一个或多个行,每个行中包括一个或多个第三地址,上述根据上述请求数据的地址信息,在上述第二信息表中将任意一个第三地址中的地址信息替换为上述请求数据的地址信息,包括:根据上述请求数据的地址信息,在上述第二信息表中将上述行地址信息指示的行中的任意一个第三地址中的地址信息替换为上述请求数据的地址信息。基于本方案,能够在提高数据处理效率的同时,确保请求指令访问频率较高时,该请求指令请求的数据可以被检测为热数据流。With reference to the first aspect and the foregoing possible implementation manner, in another possible implementation manner, the second information table includes one or more rows, and each row includes one or more third addresses. For the address information of the data, replace the address information in any third address with the address information of the request data in the second information table, including: according to the address information of the request data, replace the above information in the second information table The address information in any third address in the line indicated by the line address information is replaced with the address information of the above-mentioned request data. Based on this solution, while improving the efficiency of data processing, it can be ensured that when the access frequency of the request instruction is high, the data requested by the request instruction can be detected as a hot data stream.
结合第一方面和上述可能的实现方式,在另一种可能的实现方式中,若上述第一信息表中任意一行的属性标识全部为第二标识,将该全部为第二标识的行中的所有属性标识重置为第一标识。基于本方案,能够在第一信息表中某一行的属性标识全为第 二标识时,将该行的属性标识全部重置为第一标识,重新开始新一轮的检测,以提高Cache的高效性。With reference to the first aspect and the foregoing possible implementation manners, in another possible implementation manner, if the attribute identifiers of any row in the first information table are all second identifiers, the rows in which all are second identifiers All attribute identifiers are reset to the first identifier. Based on this solution, when the attribute identifier of a row in the first information table is all the second identifier, the attribute identifier of the row can be reset to the first identifier, and a new round of detection can be restarted to improve the efficiency of the cache Sex.
结合第一方面和上述可能的实现方式,在另一种可能的实现方式中,上述方法还包括:根据上述请求数据的地址信息在第二信息表中查找上述行地址信息指示的行;若该请求数据的地址信息与上述第二信息表中上述行地址信息指示的行中的任意一个第三地址包括的地址信息相同,确定该请求指令请求的数据为热数据流;若上述请求数据的地址信息与上述第二信息表中上述行地址信息指示的行中的全部第三地址包括的地址信息均不同,确定该请求指令请求的数据为冷数据流。基于本方案,能够根据第二信息表确定请求指令请求的数据为热数据流或冷数据流。With reference to the first aspect and the above possible implementation manner, in another possible implementation manner, the above method further includes: searching for the row indicated by the above row address information in the second information table according to the address information of the above request data; if the The address information of the requested data is the same as the address information included in any third address in the row indicated by the row address information in the second information table, and it is determined that the data requested by the request instruction is a hot data stream; if the address of the requested data The information is different from the address information included in all the third addresses in the row indicated by the row address information in the second information table, and it is determined that the data requested by the request instruction is a cold data stream. Based on this solution, it can be determined according to the second information table that the data requested by the request instruction is a hot data stream or a cold data stream.
本申请实施例的第二方面,提供一种芯片,该芯片包括处理器、内存控制器以及高速缓冲存储器Cache,其中,上述处理器,用于发送请求指令,该请求指令中携带请求数据的地址信息;上述内存控制器,用于接收上述处理器发送的上述请求指令;确定该请求指令请求的数据是否已经被保存在高速缓冲存储器Cache中,以及确定该请求指令请求的数据是否为热数据流,若确定该请求指令请求的数据未保存在上述Cache中,且该请求指令请求的数据为热数据流,根据上述请求数据的地址信息,查询第一信息表,确定上述请求数据在Cache中的目标地址,其中,该热数据流是指访问频率大于或等于预设阈值的数据;上述第一信息表包括一个或多个第一地址,该第一地址与Cache中的第二地址一一对应,上述第一信息表还包括与每个第一地址对应的属性标识,该属性标识包括第一标识和第二标识,该第一标识用于指示对应的第二地址上的数据可以被替换,该第二标识用于指示对应的第二地址上的数据不可以被替换,上述目标地址为上述第一信息表中属性标识为第一标识的任意一个第一地址对应的第二地址;将上述请求指令请求的数据复制至上述Cache中的上述目标地址上。A second aspect of an embodiment of the present application provides a chip including a processor, a memory controller, and a cache memory, wherein the processor is used to send a request instruction, and the request instruction carries the address of the requested data Information; the memory controller, used to receive the request command sent by the processor; determine whether the data requested by the request command has been saved in the cache memory, and determine whether the data requested by the request command is a hot data stream If it is determined that the data requested by the request instruction is not stored in the Cache, and the data requested by the request instruction is a hot data stream, query the first information table according to the address information of the request data to determine the requested data in the Cache Target address, where the hot data stream refers to data with an access frequency greater than or equal to a preset threshold; the first information table includes one or more first addresses, and the first addresses correspond one-to-one with the second addresses in the cache , The above-mentioned first information table further includes an attribute identifier corresponding to each first address, and the attribute identifier The identification includes a first identification and a second identification. The first identification is used to indicate that the data at the corresponding second address can be replaced, and the second identification is used to indicate that the data at the corresponding second address cannot be replaced. The target address is a second address corresponding to any first address whose attribute identifier is the first identifier in the first information table; copy the data requested by the request instruction to the target address in the cache.
结合第二方面,在一种可能的实现方式中,上述内存控制器,还用于若上述请求指令请求的数据成功复制至上述Cache中的上述目标地址上,将上述第一信息表中与上述目标地址对应的第一地址的属性标识重置为第二标识。With reference to the second aspect, in a possible implementation manner, the memory controller is further configured to, if the data requested by the request instruction is successfully copied to the target address in the cache, add the first information table to the The attribute identifier of the first address corresponding to the target address is reset to the second identifier.
结合第二方面和上述可能的实现方式,在另一种可能的实现方式中,上述请求数据的地址信息包含行地址信息,上述第一信息表包括一个或多个行,每个行中包括一个或多个第一地址,上述内存控制器,还用于在上述第一信息表中查找上述行地址信息指示的行;在该行地址信息指示的行中,选取任意一个属性标识为第一标识的第一地址,确定该第一地址对应的Cache中的第二地址为上述目标地址。With reference to the second aspect and the foregoing possible implementation manner, in another possible implementation manner, the address information of the request data includes row address information, and the first information table includes one or more rows, and each row includes one Or a plurality of first addresses, the memory controller is also used to search for the row indicated by the row address information in the first information table; select any attribute identifier as the first identifier in the row indicated by the row address information For the first address, determine that the second address in the Cache corresponding to the first address is the target address.
结合第二方面和上述可能的实现方式,在另一种可能的实现方式中,上述内存控制器,还用于若确定上述请求指令请求的数据保存在上述Cache中,且上述请求指令请求的数据为热数据流,查找该请求数据在Cache中的第二地址;将上述第一信息表中与该第二地址对应的第一地址的属性标识重置为第二标识。With reference to the second aspect and the foregoing possible implementation manners, in another possible implementation manner, the memory controller is further configured to determine that the data requested by the request instruction is stored in the cache and the data requested by the request instruction For hot data flow, search for the second address of the requested data in the Cache; reset the attribute identifier of the first address corresponding to the second address in the first information table to the second identifier.
结合第二方面和上述可能的实现方式,在另一种可能的实现方式中,上述内存控制器,还用于若确定上述请求指令请求的数据为冷数据流,根据上述请求数据的地址信息,在上述第二信息表中将任意一个第三地址中的地址信息替换为上述请求数据的地址信息;其中,该冷数据流是指访问频率小于上述预设阈值的数据;该第二信息表包含一个或多个第三地址,该第三地址包括一个地址信息。With reference to the second aspect and the foregoing possible implementation manners, in another possible implementation manner, the memory controller is further configured to determine that the data requested by the request instruction is a cold data stream, based on the address information of the request data, In the second information table, replace the address information in any third address with the address information of the request data; wherein, the cold data stream refers to data whose access frequency is less than the preset threshold; the second information table contains One or more third addresses, the third address including address information.
结合第二方面和上述可能的实现方式,在另一种可能的实现方式中,上述内存控制器,具体用于根据上述请求数据的地址信息,在上述第二信息表中将上述行地址信息指示的行中的任意一个第三地址中的地址信息替换为上述请求数据的地址信息。With reference to the second aspect and the foregoing possible implementation manner, in another possible implementation manner, the memory controller is specifically configured to indicate the row address information in the second information table according to the address information of the request data The address information in any third address in the row of is replaced with the address information of the above request data.
结合第二方面和上述可能的实现方式,在另一种可能的实现方式中,上述内存控制器,还用于若上述第一信息表中任意一行的属性标识全部为第二标识,将该全部为第二标识的行中的所有属性标识重置为第一标识。With reference to the second aspect and the foregoing possible implementation manner, in another possible implementation manner, the foregoing memory controller is further configured to, if the attribute identifiers of any row in the first information table are all second identifiers, Reset all attribute identifiers in the row of the second identifier to the first identifier.
结合第二方面和上述可能的实现方式,在另一种可能的实现方式中,上述内存控制器,还用于根据上述请求数据的地址信息在第二信息表中查找上述行地址信息指示的行;若该请求数据的地址信息与上述第二信息表中上述行地址信息指示的行中的任意一个第三地址包括的地址信息相同,确定该请求指令请求的数据为热数据流;若上述请求数据的地址信息与上述第二信息表中上述行地址信息指示的行中的全部第三地址包括的地址信息均不同,确定该请求指令请求的数据为冷数据流。With reference to the second aspect and the foregoing possible implementation manner, in another possible implementation manner, the foregoing memory controller is further configured to search for the row indicated by the row address information in the second information table according to the address information of the request data If the address information of the requested data is the same as the address information included in any third address in the row indicated by the row address information in the second information table, it is determined that the data requested by the request instruction is a hot data stream; if the above request The address information of the data is different from the address information included in all the third addresses in the row indicated by the row address information in the second information table, and it is determined that the data requested by the request instruction is a cold data stream.
上述第二方面以及第二方面的各种实现方式的效果描述可以参考第一方面相应效果的描述,在此不再赘述。For the description of the second aspect and the effects of various implementation manners of the second aspect, reference may be made to the description of the corresponding effects of the first aspect, and details are not described herein again.
本申请实施例的第三方面,提供了一种服务器,该服务器的结构中包括处理器和存储器,该存储器用于与处理器耦合,保存该服务器必要的程序指令和数据,该处理器用于执行存储器中存储的程序指令,使得该服务器执行上述方法。In a third aspect of the embodiments of the present application, a server is provided. The structure of the server includes a processor and a memory. The memory is used to couple with the processor to store necessary program instructions and data of the server. The processor is used to execute The program instructions stored in the memory cause the server to execute the above method.
本申请实施例的第四方面,提供一种计算机存储介质,所述计算机存储介质中存储有计算机程序代码,当所述计算机程序代码在处理器上运行时,使得所述处理器执行第一方面或第一方面的可能的实现方式中任一所述的数据处理方法。According to a fourth aspect of the embodiments of the present application, a computer storage medium is provided, in which computer program code is stored, and when the computer program code runs on a processor, the processor is caused to execute the first aspect Or the data processing method described in any one of the possible implementation manners of the first aspect.
本申请实施例的第五方面,提供了一种计算机程序产品,该程序产品储存有上述处理器执行的计算机软件指令,该计算机软件指令包含用于执行上述方面所述方案的程序。A fifth aspect of the embodiments of the present application provides a computer program product that stores computer software instructions executed by the processor, and the computer software instructions include a program for executing the solution described in the above aspect.
本申请实施例的第六方面,提供了一种装置,该装置以芯片的产品形态存在,该装置的结构中包括处理器和存储器,该存储器用于与处理器耦合,保存该装置必要的程序指令和数据,该处理器用于执行存储器中存储的程序指令,使得该装置执行上述方法中数据处理装置的功能。According to a sixth aspect of the embodiments of the present application, an apparatus is provided. The apparatus exists in the form of a chip product. The structure of the apparatus includes a processor and a memory. The memory is used to couple with the processor to store necessary programs of the apparatus Instruction and data, the processor is used to execute the program instructions stored in the memory, so that the device performs the function of the data processing device in the above method.
附图说明BRIEF DESCRIPTION
图1为本申请实施例提供的一种计算机系统架构图;FIG. 1 is an architectural diagram of a computer system provided by an embodiment of the present application;
图2为本申请实施例提供的一种数据处理方法的流程图;2 is a flowchart of a data processing method provided by an embodiment of the present application;
图3为本申请实施例提供的一种第二信息表的示意图;3 is a schematic diagram of a second information table provided by an embodiment of this application;
图4为本申请实施例提供的一种第一信息表的示意图;4 is a schematic diagram of a first information table provided by an embodiment of this application;
图5为本申请实施例提供的一种数据处理方法的应用示意图;5 is an application schematic diagram of a data processing method provided by an embodiment of the present application;
图6为本申请实施例提供的另一种数据处理方法的流程图;6 is a flowchart of another data processing method provided by an embodiment of the present application;
图7为本申请实施例提供的另一种数据处理方法的应用示意图;7 is an application schematic diagram of another data processing method provided by an embodiment of the present application;
图8为本申请实施例提供的另一种数据处理方法的流程图;8 is a flowchart of another data processing method provided by an embodiment of the present application;
图9为本申请实施例提供的另一种数据处理方法的流程图;9 is a flowchart of another data processing method provided by an embodiment of the present application;
图10为本申请实施例提供的另一种数据处理方法的应用示意图;10 is a schematic diagram of application of another data processing method provided by an embodiment of the present application;
图11为本申请实施例提供的另一种数据处理方法的流程图;11 is a flowchart of another data processing method provided by an embodiment of this application;
图12为本申请实施例提供的另一种数据处理方法的应用示意图;12 is an application schematic diagram of another data processing method provided by an embodiment of the present application;
图13为本申请实施例提供的一种数据处理装置的组成示意图;13 is a schematic diagram of the composition of a data processing device provided by an embodiment of the present application;
图14为本申请实施例提供的另一种数据处理装置的组成示意图;14 is a schematic diagram of the composition of another data processing device provided by an embodiment of the present application;
图15为本申请实施例提供的一种芯片的组成示意图。15 is a schematic diagram of the composition of a chip provided by an embodiment of the present application.
具体实施方式detailed description
本申请实施例提供一种数据处理方法,该方法可以应用于如图1所示的计算机系统100中,图1所示的计算机系统可以包括处理器101、内存控制器102、第一级存储器103以及第二级存储器104。An embodiment of the present application provides a data processing method, which can be applied to the computer system 100 shown in FIG. 1. The computer system shown in FIG. 1 may include a processor 101, a memory controller 102, and a first-level memory 103之间 的 Secondary storage 104.
处理器101,是计算机系统100的控制中心,用于运行计算机系统100的操作系统与计算机100上的应用程序(包括系统应用程序和第三方应用程序)。The processor 101 is a control center of the computer system 100, and is used to run an operating system of the computer system 100 and applications (including system applications and third-party applications) on the computer 100.
本申请实施例中,处理器101具体可以为中央处理器(central processing unit,CPU),其可以实现或执行结合本申请实施例公开的内容所描述的各种示例性的逻辑方框,模块和电路;处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等,本申请实施例对此不进行限定。In the embodiments of the present application, the processor 101 may specifically be a central processing unit (CPU), which may implement or execute various exemplary logical blocks, modules, and modules described in conjunction with the contents disclosed in the embodiments of the present application. The circuit; the processor may also be a combination that realizes a calculation function, for example, including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc. This embodiment of the present application does not limit this.
内存控制器102,用于对第一级存储器和第二级存储器中的数据进行管理。示例性的,该内存控制器可以为缓存控制器,用于对缓存中的数据进行管理。The memory controller 102 is used to manage data in the first-level storage and the second-level storage. Exemplarily, the memory controller may be a cache controller, which is used to manage data in the cache.
第一级存储器103,用于缓存第二级存储器中的数据,还用于支持高速缓存访问。示例性的,该第一级存储器103可以为处理器和内存之间的高速缓冲存储器Cache,用于提升系统的读写性能。Cache中的数据可以是内存中的一部分数据。进一步的,若Cache包含待访问数据,则处理器101可以从Cache中获取待访问数据,而不用从内存中获取待访问数据,从而加快了读取速度。需要说明的是,本申请下述实施例中均以第一级存储器为高速缓冲存储器Cache为例进行说明。The first-level memory 103 is used to cache data in the second-level memory, and is also used to support cache access. Exemplarily, the first-level memory 103 may be a cache memory Cache between the processor and the memory, which is used to improve the read and write performance of the system. The data in the cache can be part of the data in the memory. Further, if the Cache contains data to be accessed, the processor 101 can obtain the data to be accessed from the Cache instead of obtaining the data to be accessed from the memory, thereby speeding up the reading speed. It should be noted that, in the following embodiments of the present application, the first-level memory is used as the cache memory Cache as an example for description.
第二级存储器104,用于存储所有的指令和数据。示例性的,该第二级存储器104可以为计算机系统100的内存。The second level memory 104 is used to store all instructions and data. Exemplarily, the second-level memory 104 may be the memory of the computer system 100.
本申请实施例中,第二级存储器104具体可以包括易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM);该存储器也可以包括非易失性存储器(non-volatile memory),例如只读存储器(Read Only Memory,ROM);该存储器还可以包括上述种类的存储器的组合。In the embodiment of the present application, the second-level memory 104 may specifically include volatile memory (volatile memory), such as random-access memory (RAM); the memory may also include non-volatile memory (non-volatile memory). volatile memory), such as a read-only memory (Read Only Memory, ROM); the memory may also include a combination of the above types of memory.
可理解的是,图1仅为示例性说明,实际应用中,计算机系统100可以包括比图1所示更多或者更少的部件,图1所示结构不对本申请实施例提供的计算机系统构成任何限制。It is understandable that FIG. 1 is only an exemplary description. In practical applications, the computer system 100 may include more or fewer components than those shown in FIG. 1, and the structure shown in FIG. 1 does not constitute the computer system provided by the embodiments of the present application. Any restrictions.
为了解决背景技术中,热数据流和冷数据流的检测机制相互独立,导致Cache中冷数据流替换热数据流的情况经常发生,降低了数据处理的效率的问题,本申请实施例提供了一种数据处理方法,该方法能够关联热数据流和冷数据流的检测机制,两者相互协作,降低了Cache中冷数据流替换热数据流的情况发生的概率。In order to solve the problem that the detection mechanism of the hot data stream and the cold data stream are independent of each other in the background technology, the situation that the cold data stream replaces the hot data stream in the Cache often occurs, which reduces the efficiency of data processing. A data processing method. This method can associate the detection mechanism of the hot data stream and the cold data stream. The two cooperate with each other to reduce the probability that the cold data stream replaces the hot data stream in the cache.
结合图1、如图2所示,本申请实施例提供的数据处理方法可以包括步骤S201-S203。With reference to FIG. 1 and FIG. 2, the data processing method provided in this embodiment of the present application may include steps S201-S203.
S201、内存控制器接收请求指令。S201. The memory controller receives the request instruction.
其中,上述请求指令中携带请求数据的地址信息,该请求数据的地址为逻辑地址。Wherein, the above request instruction carries the address information of the request data, and the address of the request data is a logical address.
示例性,内存控制器可以接收处理器发送的请求指令,该请求指令可以是处理器 发送的任一次访问请求。Exemplarily, the memory controller may receive a request instruction sent by the processor, and the request instruction may be any access request sent by the processor.
示例性的,上述请求指令可以为处理器发送的读请求或写请求,该读请求或写请求用于在第一级存储器和/或第二级存储器中读取或写入数据。Exemplarily, the above request instruction may be a read request or a write request sent by the processor, and the read request or the write request is used to read or write data in the first-level memory and / or the second-level memory.
示例性的,上述请求指令中携带的请求数据的地址信息可以包含行地址信息,该行地址信息可以是按照预设规则划分的行地址信息,例如可以对数据的属性进行分类划分行,本申请实施例对此并不进行限定,在此仅是示例性说明。示例性的,该行地址信息可以记为RowID。Exemplarily, the address information of the request data carried in the above request instruction may include row address information, and the row address information may be row address information divided according to a preset rule, for example, the attributes of the data may be classified into rows. This application The embodiment does not limit this, and here is only an exemplary description. Exemplarily, the row address information may be recorded as RowID.
S202、若确定请求指令请求的数据未保存在Cache中,且请求指令请求的数据为热数据流,根据请求数据的地址信息,查询第一信息表,确定请求数据在Cache中的目标地址。S202. If it is determined that the data requested by the request instruction is not stored in the cache and the data requested by the request instruction is a hot data stream, query the first information table according to the address information of the requested data to determine the target address of the requested data in the cache.
其中,热数据流是指访问频率大于或等于预设阈值的数据,即处理器经常访问的数据,本申请实施例对于该预设阈值的具体取值并不进行限定,具体可根据实际应用确定。The hot data stream refers to data whose access frequency is greater than or equal to a preset threshold, that is, data that the processor frequently accesses. The specific value of the preset threshold is not limited in this embodiment of the present application, and can be determined according to actual applications. .
示例性的,本申请实施例中确定请求指令请求的数据是否为热数据流的方法可以通过多种方式实现,例如,可以将预设时间内请求数据的访问次数与预设访问次数进行比较,若预设时间内请求数据的访问次数大于或等于预设访问次数,可以确定该请求数据为热数据流;再例如,可以通过统计请求数据的访问频率,将请求数据的访问频率与预设阈值进行比较,若请求数据的访问频率大于或等于预设阈值,可以确定该请求数据为热数据流;再例如,可以通过查找第二信息表中已请求数据的地址信息,若请求数据的地址信息与第二信息表中任意一个已请求数据的地址信息匹配,可以确定该请求数据为热数据流,本申请实施例对于确定请求数据是否为热数据流的具体方法并不进行限定,在此仅是示例性说明。Exemplarily, the method for determining whether the data requested by the request instruction is a hot data stream in the embodiment of the present application may be implemented in various ways, for example, the number of accesses of the requested data within a preset time may be compared with the preset number of accesses, If the number of accesses to the requested data within a preset time is greater than or equal to the preset number of accesses, the requested data can be determined to be a hot data stream; for another example, the access frequency of the requested data can be compared with the preset threshold by counting the access frequency of the requested data For comparison, if the access frequency of the requested data is greater than or equal to the preset threshold, the requested data can be determined to be a hot data stream; for another example, the address information of the requested data in the second information table can be found by searching for the address information of the requested data It matches the address information of any requested data in the second information table, and it can be determined that the requested data is a hot data stream. The embodiment of the present application does not limit the specific method for determining whether the requested data is a hot data stream. It is an example.
示例性的,上述第二信息表可以包含一个或多个第三地址,每个第三地址包括一个地址信息,上述通过查找第二信息表确定请求指令请求的数据是否为热数据流具体可以包括:根据请求数据的地址信息在第二信息表中查找,若请求数据的地址信息与第二信息表中的任意一个第三地址包括的地址信息相同,确定请求指令请求的数据为热数据流;若请求数据的地址信息与第二信息表中的全部第三地址包括的地址信息均不同,确定请求指令请求的数据为冷数据流。Exemplarily, the second information table may include one or more third addresses, and each third address includes address information. The above-mentioned determination of whether the data requested by the request instruction is a hot data stream by searching the second information table may specifically include : Search in the second information table according to the address information of the requested data. If the address information of the requested data is the same as the address information included in any third address in the second information table, determine that the data requested by the request instruction is a hot data stream; If the address information of the requested data is different from the address information included in all the third addresses in the second information table, it is determined that the data requested by the request instruction is a cold data stream.
示例性的,该第二信息表可以包括一个或多个行,每个行包括一个或多个第三地址,如图3所示,第二信息表包括多个行,每行包括8个信息空间,每个信息空间记录了对应8个地址(第三地址)包含的地址信息,图3中标记为黑色的第三地址中存储有已请求数据的地址信息,该标记为白色的第三地址中存储空地址信息。本申请实施例对于第二信息表的具体规格并不进行限定,在此仅以每行包括8个信息空间为例进行说明。Exemplarily, the second information table may include one or more rows, and each row includes one or more third addresses. As shown in FIG. 3, the second information table includes multiple rows, and each row includes 8 pieces of information. Each information space records address information corresponding to 8 addresses (third address). The third address marked as black in FIG. 3 stores the address information of the requested data, and the third address marked as white Store empty address information. The embodiment of the present application does not limit the specific specifications of the second information table. Here, only eight information spaces are included in each row as an example for description.
进一步的,本申请实施例可以通过将请求数据的地址信息与第二信息表中的第三地址包括的地址信息进行匹配,若请求数据的地址信息包括行地址信息,且请求数据的地址信息与第二信息表中该行地址信息指示的行中的任意一个第三地址包括的地址信息相同,可以认为该请求指令请求的数据为处理器经常访问的数据,确定该请求指令请求的数据为热数据流;如果请求数据的地址信息与第二信息表中该行地址信息指 示的行中的所有第三地址包括的地址信息均不同,可以认为该请求指令请求的数据并不是处理器经常访问的数据,确定该请求指令请求的数据为冷数据流。Further, in this embodiment of the present application, the address information of the requested data can be matched with the address information included in the third address in the second information table. If the address information of the requested data includes row address information, and the address information of the requested data is Any third address in the row indicated by the row of address information in the second information table includes the same address information. It can be considered that the data requested by the request instruction is data frequently accessed by the processor, and the data requested by the request instruction is determined to be hot Data flow; if the address information of the requested data is different from the address information included in all the third addresses in the row indicated by the row of address information in the second information table, it can be considered that the data requested by the request instruction is not frequently accessed by the processor Data, it is determined that the data requested by the request instruction is a cold data stream.
示例性的,上述目标地址是指请求指令请求的数据在Cache中的目标地址。可以理解的,本申请实施例中请求指令请求的数据与请求数据均为同一个数据。Exemplarily, the above target address refers to the target address in the cache of the data requested by the request instruction. It can be understood that the data requested by the request instruction and the requested data in the embodiment of the present application are the same data.
示例性的,上述第一信息表用于记录当前可以被使用的Cache资源,该第一信息表可以包括一个或多个第一地址,该第一地址与Cache中的第二地址一一对应,该第一信息表还可以包括与每个第一地址对应的属性标识,该属性标识包括第一标识和第二标识,该第一标识用于指示对应的第二地址上的数据可以被替换,该第二标识用于指示对应的第二地址上的数据不可以被替换。Exemplarily, the above-mentioned first information table is used to record the currently available Cache resources. The first information table may include one or more first addresses, and the first addresses correspond one-to-one with the second addresses in the Cache. The first information table may further include an attribute identifier corresponding to each first address. The attribute identifier includes a first identifier and a second identifier. The first identifier is used to indicate that data on the corresponding second address can be replaced. The second identifier is used to indicate that the data at the corresponding second address cannot be replaced.
示例性的,上述请求数据的目标地址可以为第一信息表中属性标识为第一标识的任意一个第一地址对应的第二地址。可以理解的,可以将第一信息表中任意一个属性标识为第一标识的第一地址对应的第二地址确定为目标地址,由于属性标识为第一标识的第一地址在Cache中对应的第二地址上存储的数据是可以被替换的数据,因此该请求数据的目标地址上存储的数据是可以被替换的数据,可以将请求数据存储在该目标地址上,替换该目标地址上原有的数据。Exemplarily, the target address of the foregoing request data may be a second address corresponding to any first address whose attribute identifier is the first identifier in the first information table. Understandably, the second address corresponding to the first address of any attribute identified as the first identification in the first information table may be determined as the target address, because the first address whose attribute is identified as the first identification corresponds to the first The data stored at the second address is data that can be replaced, so the data stored at the target address of the requested data is data that can be replaced, and the requested data can be stored at the target address to replace the original data at the target address .
进一步的,该第一信息表可以包括一个或多个行,每个行包括一个或多个第一地址,如图4所示,每个行中包括8个信息空间,每个信息空间记录了对应8个地址(第一地址)的属性标识,每个第一地址对应的属性标识可以为第一标识,也可以为第二标识,该第一标识可以记为0,第二标识可以记为1,属性标识为0表示该第一地址在Cache中对应的第二地址上的数据可以被替换,属性标识为1表示该第一地址在Cache中对应的第二地址上的数据不可以被替换,其中,本申请实施例中的热数据流在第一信息表中对应的第一地址可以被标识为1。本申请实施例对于第一信息表的规格以及第一标识和第二标识的具体表现形式并不进行限定,在此仅以第一信息表中每行包括8个信息空间、第一标识记为0、第二标识记为1为例进行说明。Further, the first information table may include one or more rows, and each row includes one or more first addresses. As shown in FIG. 4, each row includes 8 information spaces, and each information space records Attribute identifiers corresponding to 8 addresses (first addresses), the attribute identifier corresponding to each first address may be the first identifier or the second identifier, the first identifier may be recorded as 0, and the second identifier may be recorded as 1. The attribute ID of 0 means that the data of the first address in the corresponding second address in the Cache can be replaced, and the attribute ID of 1 means that the data of the first address in the corresponding second address in the Cache cannot be replaced Where the first address corresponding to the hot data stream in the embodiment of the present application in the first information table may be identified as 1. The embodiment of the present application does not limit the specifications of the first information table and the specific expression forms of the first identifier and the second identifier. Here, only each row in the first information table includes 8 information spaces, and the first identifier is recorded as 0, the second mark is 1 as an example for description.
示例性的,上述请求数据的目标地址可以为第一信息表中行地址信息指示的行中,属性标识为第一标识的任意一个第一地址对应的第二地址。可以理解的,可以将第一信息表中上述行地址信息对应的行中,任意一个属性标识为第一标识的第一地址对应的第二地址确定为目标地址,由于属性标识为0的第一地址在Cache中对应的第二地址上存储的数据是可以被替换的数据,因此该请求数据的目标地址上存储的数据是可以被替换的数据。Exemplarily, the target address of the foregoing request data may be a row indicated by row address information in the first information table, and the attribute identifier is a second address corresponding to any first address of the first identifier. Understandably, the second address corresponding to the first address whose first attribute is identified as the first identification in the row corresponding to the above-mentioned row address information in the first information table may be determined as the target address, since the first attribute identified as 0 The data stored at the second address corresponding to the address in the cache is data that can be replaced, so the data stored at the target address of the requested data is data that can be replaced.
示例性的,上述根据请求数据的地址信息,查询第一信息表,确定请求数据在Cache中的目标地址,可以包括:在第一信息表中查找行地址信息指示的行,在该行地址信息指示的行中,选取任意一个属性标识为第一标识的第一地址,确定该第一地址对应的Cache中的第二地址为目标地址。Exemplarily, the above querying the first information table according to the address information of the requested data to determine the target address of the requested data in the cache may include: searching the first information table for the row indicated by the row address information, where the row address information In the indicated line, select any one of the attribute addresses as the first address of the first identifier, and determine that the second address in the Cache corresponding to the first address is the target address.
例如,如图5所示,根据请求指令携带的行地址RowID,若行地址为2,在该行地址RowID为2指示的行中,随机选取该行中属性标识为0的任意一个第一地址(位置),如图5,属性标识为0的第一地址有5个,可以在这5个属性标识为0的第一地址(位置)中随机选取一个第一地址(位置),如图5中RowID为2指示的行中列标识为1的第一地址(虚线框中标识为0的位置),并将该第一地址在Cache中对应 的第二地址确定为目标地址。由于属性标识为0的第一地址在Cache中对应的第二地址上的数据可以被替换,属性标识为1的第一地址在Cache中对应的第二地址上的数据不可以被替换,因此本申请实施例通过选择属性标识为0的任意一个第一地址对应的第二地址为目标地址,可以确保所选择的目标地址上的存储的数据是可以被替换的数据,而不会是不可以被替换的数据。For example, as shown in FIG. 5, according to the row address RowID carried in the request instruction, if the row address is 2, in the row indicated by the row address RowID 2, randomly select any first address in the row whose attribute ID is 0 (Location), as shown in Fig. 5, there are 5 first addresses with attribute identification 0, and a first address (location) can be randomly selected from the 5 first addresses (location) with attribute identification 0, as shown in Fig. 5 The rowID indicates a first address with a column ID of 1 in the row indicated by 2 (the position identified as 0 in the dotted frame), and the second address corresponding to the first address in the cache is determined as the target address. Since the data of the first address with the attribute ID of 0 at the corresponding second address in the Cache can be replaced, the data of the first address with the attribute ID of 1 at the corresponding second address of the Cache cannot be replaced, so this In the embodiment of the application, by selecting the second address corresponding to any one of the first addresses with the attribute identifier of 0 as the target address, it can be ensured that the data stored on the selected target address is data that can be replaced, not not Replaced data.
可以理解的,第一信息表中属性标识为0的第一地址在Cache中对应的第二地址上的数据为可以被替换的数据,第一信息表中属性标识为1的第一地址在Cache中对应的第二地址上的数据为不可以被替换的数据,其中,热数据流可以被标识为1,本申请实施例中的数据处理方法可以将第一信息表中属性标识为0的任意一个第一地址在Cache中对应的第二地址确定为目标地址,即将标识为0的数据替换掉,而不会将标识为1的数据替换掉。因此,在对Cache中的数据进行替换时,仅会替换可以被替换的数据,不会将标识为1的不能被替换的数据替换掉,故采用本申请实施例中的数据处理方法可以降低现有技术中存在的冷数据流替换热数据流的情况发生的概率。It is understandable that the data of the first address in the first information table with the attribute ID of 0 in the corresponding second address in the Cache is data that can be replaced, and the first address in the first information table with the attribute ID of 1 in the Cache The data at the corresponding second address in the data is data that cannot be replaced, wherein the hot data stream can be identified as 1, and the data processing method in this embodiment of the present application can identify any attribute in the first information table as 0 A second address corresponding to a first address in the Cache is determined to be the target address, that is, the data identified as 0 is replaced, and the data identified as 1 is not replaced. Therefore, when replacing the data in the cache, only the data that can be replaced will be replaced, and the data that is marked as 1 that cannot be replaced will not be replaced, so the data processing method in the embodiment of the present application can reduce the current There is a probability that a cold data stream replaces a hot data stream in the technology.
S203、内存控制器将请求指令请求的数据复制至Cache中的目标地址上。S203. The memory controller copies the data requested by the request instruction to the target address in the cache.
示例性的,该目标地址是Cache中存储的可以被替换的数据的第二地址。上述请求指令请求的数据未保存在Cache中且为热数据流,因此可以将该请求数据从内存复制至Cache中的目标地址上。由于该目标地址是第一信息表中属性标识为第一标识的任意一个第一地址对应的第二地址,因此在将请求的数据从内存复制至Cache上的目标地址时,是将该目标地址上原来存储的可以被替换的数据替换为请求数据,而且在替换时,仅会替换可以被替换的数据,不会将标识为1的不能被替换的数据替换掉。Exemplarily, the target address is a second address of data that can be replaced in the cache. The data requested by the above request instruction is not stored in the cache and is a hot data stream, so the requested data can be copied from the memory to the target address in the cache. Since the target address is the second address corresponding to any first address whose attribute identifier is the first identifier in the first information table, when copying the requested data from the memory to the target address on the cache, the target address The previously stored data that can be replaced is replaced with the request data, and during the replacement, only the data that can be replaced will be replaced, and the data that is identified as 1 that cannot be replaced will not be replaced.
示例性的,步骤S203之前还可以包括:内存控制器根据请求数据的地址信息从内存中获取该请求数据。Exemplarily, before step S203, it may further include: the memory controller obtains the requested data from the memory according to the address information of the requested data.
本申请实施例提供的数据处理方法,通过接收请求指令,该请求指令中携带请求数据的地址信息;若确定请求指令请求的数据未保存在Cache中,且请求指令请求的数据为热数据流,根据请求数据的地址信息,查询第一信息表,确定请求数据在Cache中的目标地址,其中,该目标地址为第一信息表中属性标识为第一标识的任意一个第一地址对应的第二地址;将请求指令请求的数据复制至Cache中的目标地址上。本申请实施例通过将第一信息表中属性标识为第一标识的任意一个第一地址对应的第二地址,确定为未在Cache中命中的热数据流的目标地址,从而在对Cache中的数据进行替换时,仅会替换可以被替换的数据,不会将不能被替换的数据替换掉,因此可以有效降低Cache中冷数据流替换热数据流的情况发生的概率。In the data processing method provided in the embodiment of the present application, by receiving a request instruction, the request instruction carries the address information of the requested data; if it is determined that the data requested by the request instruction is not stored in the cache, and the data requested by the request instruction is a hot data stream, According to the address information of the requested data, query the first information table to determine the target address of the requested data in the cache, where the target address is the second corresponding to any one of the first addresses whose attribute identifier is the first identifier in the first information table Address; copy the data requested by the request instruction to the target address in the Cache. In the embodiment of the present application, by identifying the attribute in the first information table as the second address corresponding to any first address of the first identifier, the target address of the hot data stream not hit in the cache is determined, so that the When data is replaced, only the data that can be replaced will be replaced, and the data that cannot be replaced will not be replaced. Therefore, the probability of the cold data stream replacing the hot data stream in the cache can be effectively reduced.
本申请还提供一实施例,如图6所示,若步骤S203将请求的数据成功复制至Cache上,上述方法还包括步骤S204;若请求的数据未成功复制至片上,返回失败消息。This application also provides an embodiment. As shown in FIG. 6, if step S203 successfully copies the requested data to the cache, the above method further includes step S204; if the requested data is not successfully copied to the chip, a failure message is returned.
S204、内存控制器将第一信息表中与目标地址对应的第一地址的属性标识重置为第二标识。S204. The memory controller resets the attribute identifier of the first address corresponding to the target address in the first information table to the second identifier.
示例性的,如图7所示,在请求数据成功复制至Cache上后,将第一信息表中与目标地址对应的第一地址的属性标识重置为1,因此该请求数据(热数据流)在第一信息表中对应的第一地址的属性标识为不可以被替换的第二标识。Exemplarily, as shown in FIG. 7, after the request data is successfully copied to the Cache, the attribute identifier of the first address corresponding to the target address in the first information table is reset to 1, so the request data (hot data stream ) The attribute identifier of the corresponding first address in the first information table is a second identifier that cannot be replaced.
示例性的,该重置为第二标识的请求数据为不可以被替换的数据,因此,在下一 次请求指令请求的数据为热数据流,且在Cache中未命中时,不能将上述重置为第二标识的请求数据替换掉,从而降低了Cache中冷数据流替换热数据流的情况发生的概率。Exemplarily, the request data reset to the second identifier is data that cannot be replaced. Therefore, when the data requested by the next request instruction is a hot data stream and is not hit in the cache, the above cannot be reset to The requested data of the second identifier is replaced, thereby reducing the probability that the cold data stream replaces the hot data stream in the cache.
如此一来,可以通过第二信息表确定请求指令请求的数据为热数据流或冷数据流,通过第一信息表中的属性标识确定Cache中的资源是否可以被替换,并且在确定请求指令请求的数据未保存在Cache中且为热数据流时,将请求指令请求的数据成功复制至Cache中可以被替换的第二地址(目标地址)上后,将第一信息表中与目标地址对应的第一地址的属性标识重置为不可以被替换的第二标识,从而使得冷数据流和热数据流的检测机制统一协调;而且由于本申请实施例在对Cache中的数据进行替换时,仅替换标识为0的可以被替换的数据,而不会替换标识为1的不可以被替换的数据,因此可以有效的降级冷数据流替换热数据流的情况发生的概率。In this way, the second information table can be used to determine whether the data requested by the request instruction is a hot data stream or a cold data stream, the attribute identifier in the first information table can be used to determine whether the resources in the cache can be replaced, and the request instruction Is not stored in the cache and is a hot data stream, after successfully copying the data requested by the request instruction to the second address (target address) in the cache that can be replaced, the first information table corresponds to the target address The attribute identifier of the first address is reset to a second identifier that cannot be replaced, so that the detection mechanism of the cold data stream and the hot data stream are unified and coordinated; and because the embodiment of the present application replaces the data in the cache, only The data with the identifier 0 can be replaced, but the data with the identifier 1 cannot be replaced. Therefore, the probability that the cold data stream can replace the hot data stream can be effectively reduced.
本申请实施例提供的数据处理方法,通过接收请求指令,该请求指令中携带请求数据的地址信息;若确定请求指令请求的数据未保存在Cache中,且请求指令请求的数据为热数据流,根据请求数据的地址信息,查询第一信息表,确定请求数据在Cache中的目标地址,其中,该目标地址为第一信息表中属性标识为第一标识的任意一个第一地址对应的第二地址;将请求指令请求的数据复制至Cache中的目标地址上;将第一信息表中与目标地址对应的第一地址的属性标识重置为第二标识。本申请实施例通过将第一信息表中属性标识为第一标识的任意一个第一地址对应的第二地址,确定为未在cache中命中的热数据流的目标地址,从而在对Cache中的数据进行替换时,仅会替换可以被替换的数据,不会将不能被替换的数据替换掉,因此可以有效降低Cache中冷数据流替换热数据流的情况发生的概率。In the data processing method provided by the embodiment of the present application, by receiving a request instruction, the request instruction carries the address information of the requested data; if it is determined that the data requested by the request instruction is not stored in the cache, and the requested data is a hot data stream According to the address information of the requested data, query the first information table to determine the target address of the requested data in the cache, where the target address is the second corresponding to any one of the first addresses whose attribute identifier is the first identifier in the first information table Address; copy the data requested by the request instruction to the target address in the Cache; reset the attribute identifier of the first address corresponding to the target address in the first information table to the second identifier. In the embodiment of the present application, the attribute in the first information table is identified as the second address corresponding to any one of the first addresses in the first identifier, and is determined as the target address of the hot data stream not hit in the cache. When data is replaced, only the data that can be replaced will be replaced, and the data that cannot be replaced will not be replaced. Therefore, the probability of the cold data stream replacing the hot data stream in the cache can be effectively reduced.
本申请还提供一实施例,如图8所示,该数据处理方法还包括S205-S206。This application also provides an embodiment. As shown in FIG. 8, the data processing method further includes S205-S206.
S205、若确定请求指令请求的数据保存在Cache中,且请求指令请求的数据为热数据流,查找请求数据在Cache中的第二地址。S205. If it is determined that the data requested by the request instruction is stored in the cache, and the data requested by the request instruction is a hot data stream, search for the second address of the requested data in the cache.
示例性的,在请求指令请求的数据保存在在Cache中且为热数据流的情况下,可以根据该请求指令中携带的请求数据的地址信息查找该请求数据在Cache中的第二地址,该第二地址与第一信息表中的第一地址对应。Exemplarily, in the case that the data requested by the request instruction is stored in the cache and is a hot data stream, the second address of the request data in the cache may be found according to the address information of the request data carried in the request instruction, the The second address corresponds to the first address in the first information table.
S206、内存控制器将第一信息表中与第二地址对应的第一地址的属性标识重置为第二标识。S206. The memory controller resets the attribute identifier of the first address corresponding to the second address in the first information table to the second identifier.
示例性的,请求数据为热数据流且在Cache中命中时,可以根据该请求数据在Cache中的第二地址,在第一信息表中查找与该第二地址对应的第一地址,并将该第一地址重置为第二标识。示例性的,在将第一信息表中与第二地址对应的第一地址的属性标识重置前,该第二地址对应的第一地址的属性标识可以是第一标识,也可以是第二标识,无论重置前该目标地址对应的第一地址的属性标识是第一标识还是第二标识,均需将该属性标识重置为第二标识。Exemplarily, when the request data is a hot data stream and hits in the Cache, the first address corresponding to the second address may be searched in the first information table according to the second address of the request data in the Cache, and The first address is reset to the second identification. Exemplarily, before resetting the attribute identifier of the first address corresponding to the second address in the first information table, the attribute identifier of the first address corresponding to the second address may be the first identifier or the second ID, regardless of whether the attribute ID of the first address corresponding to the target address before resetting is the first ID or the second ID, the attribute ID needs to be reset to the second ID.
可以理解的,将第一信息表中与第二地址对应的第一地址的属性标识重置为第二标识后,该请求数据为不可以被替换的数据。Understandably, after resetting the attribute identifier of the first address corresponding to the second address in the first information table to the second identifier, the request data is data that cannot be replaced.
示例性的,根据请求数据在Cache中的第二地址,在第一信息表中将该第二地址对应的第一地址的属性标识置1,该属性标识为1表示该第二地址上存储的数据不可 以被替换掉,因此,在下一次请求指令请求的数据为热数据流,且保存在Cache中时,不能将上述重置为第二标识的请求数据替换掉。Exemplarily, according to the second address of the request data in the cache, the attribute identifier of the first address corresponding to the second address is set to 1 in the first information table, and the attribute identifier is 1 indicating that the second address is stored on the second address The data cannot be replaced. Therefore, when the data requested by the next request instruction is a hot data stream and is stored in the cache, the above-mentioned request data reset to the second identification cannot be replaced.
如此一来,可以通过第二信息表确定请求指令请求的数据为热数据流或冷数据流,通过第一信息表中的属性标识确定Cache中的资源是否可以被替换,并且在确定请求指令请求的数据保存在Cache中且为热数据流时,可以将第一信息表中对应地址的属性标识重置为不可以被替换的第二标识,从而使得冷数据流和热数据流的检测机制统一协调;而且由于本申请实施例在对Cache中的数据进行替换时,仅替换标识为0的可以被替换的数据,而不会替换标识为1的不可以被替换的数据,因此可以有效的降级冷数据流替换热数据流的情况发生的概率。In this way, the second information table can be used to determine whether the data requested by the request instruction is a hot data stream or a cold data stream, and the attribute identifier in the first information table can be used to determine whether the resources in the Cache can be replaced, and then determine the request instruction request When the data is stored in the cache and is a hot data stream, the attribute identifier of the corresponding address in the first information table can be reset to a second identifier that cannot be replaced, so that the detection mechanism of the cold data stream and the hot data stream is unified Coordination; and because the embodiments of the present application replace the data in the Cache, only the data with the identifier 0 can be replaced, and the data with the identifier 1 can not be replaced, so it can be effectively downgraded The probability of a cold data stream replacing a hot data stream.
本申请实施例提供的数据处理方法,通过接收请求指令,该请求指令中携带请求数据的地址信息;若确定请求指令请求的数据保存在Cache中,且请求指令请求的数据为热数据流,查找请求数据在Cache中的第二地址;将第一信息表中与第二地址对应的第一地址的属性标识重置为第二标识。本申请实施例通过将热数据流在Cache中的第二地址对应的第一信息表中的第一地址重置为第二标识,能够在对Cache中的数据进行替换时,不会将该第一信息表中属性标识为第二标识的数据流替换掉,因此可以有效降低Cache中冷数据流替换热数据流的情况发生的概率。In the data processing method provided by the embodiment of the present application, by receiving the request instruction, the request instruction carries the address information of the requested data; if it is determined that the data requested by the request instruction is stored in the Cache and the requested data is a hot data stream, search for Request the second address of the data in the Cache; reset the attribute identifier of the first address corresponding to the second address in the first information table to the second identifier. In the embodiment of the present application, by resetting the first address in the first information table corresponding to the second address of the hot data stream in the cache to the second identifier, the data in the cache can be replaced without replacing the first address The data stream whose attribute identifier is the second identifier in the information table is replaced, so the probability of the cold data stream replacing the hot data stream in the cache can be effectively reduced.
本申请还提供一实施例,如图9所示,该数据处理方法还包括S207。This application also provides an embodiment. As shown in FIG. 9, the data processing method further includes S207.
S207、若确定请求指令请求的数据为冷数据流,内存控制器根据请求数据的地址信息,在第二信息表中将任意一个第三地址中的地址信息替换为请求数据的地址信息。S207. If it is determined that the data requested by the request instruction is a cold data stream, the memory controller replaces the address information in any third address in the second information table with the address information of the requested data in the second information table.
其中,冷数据流是指访问频率小于预设阈值的数据,即处理器不经常访问(访问次数较少)的数据,本申请实施例对于该预设阈值的具体取值并不进行限定,具体可根据实际应用确定。The cold data stream refers to data whose access frequency is less than a preset threshold, that is, data that the processor does not access frequently (less access times), and the specific value of the preset threshold is not limited in the embodiment of the present application. It can be determined according to the actual application.
示例性的,上述根据请求数据的地址信息,在第二信息表中将任意一个第三地址中的地址信息替换为所述请求数据的地址信息可以包括:根据请求数据的地址信息,在第二信息表中将行地址信息指示的行中的任意一个第三地址中的地址信息替换为请求数据的地址信息。例如,如图10所示,若确定请求指令请求的数据为冷数据流(不经常访问的数据),可以将行地址信息指示的行中的任意一个第三地址替换为该请求数据的地址信息,以使得该请求指令访问频率较高时,该请求指令请求的数据可以被检测为热数据流。Exemplarily, replacing the address information in any third address with the address information of the request data in the second information table according to the address information of the request data may include: according to the address information of the request data, in the second In the information table, the address information in any third address in the row indicated by the row address information is replaced with the address information of the requested data. For example, as shown in FIG. 10, if it is determined that the data requested by the request instruction is a cold data stream (infrequently accessed data), any third address in the row indicated by the row address information may be replaced with the address information of the requested data , So that when the access frequency of the request instruction is relatively high, the data requested by the request instruction can be detected as a hot data stream.
示例性的,将行地址信息指示的行中的任意一个第三地址包括的指令地址信息替换为该请求数据的指令地址信息可以包括:若该行地址信息指示的行中的任意一个第三地址存储有已请求数据的地址信息,可以将该第三地址中存储的已请求数据的地址信息替换为该请求指令请求的数据的地址信息;若该行地址信息指示的行中的任意一个第三地址中存储空地址信息,可以将该第三地址中存储的空地址信息替换为该请求指令请求的数据的地址信息。Exemplarily, replacing the instruction address information included in any third address in the row indicated by the row address information with the instruction address information of the request data may include: if any third address in the row indicated by the row address information If the address information of the requested data is stored, the address information of the requested data stored in the third address can be replaced with the address information of the data requested by the request instruction; if any one of the rows indicated by the address information of the row is third The address stores empty address information, and the empty address information stored in the third address can be replaced with the address information of the data requested by the request instruction.
示例性的,将行地址信息指示的行中的任意一个第三地址包括的指令地址信息替换为该请求数据的指令地址信息后,若该请求指令再次发起请求,该请求指令请求的数据未保存在Cache中且为热数据流,可以采用步骤S201-S204的方式对该请求数据进行处理;若该请求指令请求的数据成功复制至Cache后,该请求指令再次发起请求 时,该请求指令请求的数据保存在Cache中且为热数据流,可以采用步骤S205-S206的数据处理方式,将第一信息表中与第二地址对应的第一地址的属性标识重置为第二标识。该数据处理过程中可以降低冷数据流替换热数据流的情况发生的概率。Exemplarily, after replacing the instruction address information included in any third address in the row indicated by the row address information with the instruction address information of the request data, if the request instruction initiates a request again, the data requested by the request instruction is not saved In the Cache and is a hot data stream, the request data can be processed in steps S201-S204; if the data requested by the request instruction is successfully copied to the Cache, when the request instruction initiates a request again, the request instruction requests the The data is stored in the cache and is a hot data stream. The data processing method of steps S205-S206 can be used to reset the attribute identifier of the first address corresponding to the second address in the first information table to the second identifier. During the data processing, the probability of the cold data stream replacing the hot data stream can be reduced.
本申请实施例提供的数据处理方法,通过接收请求指令,该请求指令中携带请求数据的地址信息,请求数据的地址信息包含行地址信息;若确定请求指令请求的数据为冷数据流,根据请求数据的地址信息,在第二信息表中将行地址信息指示的行中的任意一个第三地址中的地址信息替换为请求数据的地址信息。本申请实施例通过将第二信息表中行地址信息指示的行中的任意一个第三地址中的地址信息替换为请求数据的地址信息,能够在该请求指令再次发起时,请求指令请求的数据可以被检测为热数据流,且在Cache中未命中,再根据步骤S202将第一信息表中属性标识为第一标识的任意一个第一地址对应的第二地址,确定为该请求指令请求的数据的目标地址,从而在对Cache中的数据进行替换时,仅会替换可以被替换的数据,不会将不能被替换的数据替换掉,因此可以有效降低Cache中冷数据流替换热数据流的情况发生的概率。In the data processing method provided in the embodiment of the present application, by receiving a request instruction, the request instruction carries address information of the requested data, and the address information of the requested data includes row address information; if it is determined that the data requested by the request instruction is a cold data stream, according to the request For the address information of the data, replace the address information in any third address in the row indicated by the row address information with the address information of the requested data in the second information table. In the embodiment of the present application, by replacing the address information in any third address in the row indicated by the row address information in the second information table with the address information of the requested data, when the request instruction is initiated again, the data requested by the request instruction can be Is detected as a hot data stream and misses in the cache, and then the attribute in the first information table is identified as the second address corresponding to any first address in the first information table according to step S202, and is determined as the data requested by the request instruction Target address, so that when replacing the data in the Cache, only the data that can be replaced will be replaced, and the data that cannot be replaced will not be replaced. Therefore, the situation of replacing the cold data flow with the hot data flow in the Cache can be effectively reduced The probability of occurrence.
本申请还提供一实施例,如图11所示,该数据处理方法还包括S208。This application also provides an embodiment. As shown in FIG. 11, the data processing method further includes S208.
S208、若第一信息表中任意一行的属性标识全部为第二标识,内存控制器将该全部为第二标识的行中的所有属性标识重置为第一标识。S208. If the attribute identifiers of any row in the first information table are all second identifiers, the memory controller resets all attribute identifiers in the rows that are all second identifiers to the first identifier.
示例性的,如图12所示,若第一信息表中的任意一行的属性标识全部为1,则将该全部为1的一行重置为0,再开始新一轮的检测和处理。Exemplarily, as shown in FIG. 12, if the attribute identifiers of any row in the first information table are all 1, then reset the row of all 1s to 0, and then start a new round of detection and processing.
示例性的,若第一信息表中的任意一行的属性标识全部为第二标识,可以确定该行中每个第一地址在Cache中对应的第二地址的数据均不可以被替换,Cache中存储的该行对应的数据将成为固定数据,如此一来,如果处理器访问的数据不再是当前Cache中存储的热数据流,那么处理器在访问时将需要不断的从内存中读取数据,Cache的高效性将不能得到利用。因此,可以通过在第一信息表中某一行的属性标识全为第二标识时,将该行的属性标识全部重置为第一标识,从而使Cache中存储的数据被替换,重新开始新一轮的检测。Exemplarily, if the attribute identifier of any row in the first information table is all the second identifier, it can be determined that the data of the corresponding second address in the cache of each first address in the row cannot be replaced. The data corresponding to the stored row will become fixed data. In this way, if the data accessed by the processor is no longer the hot data stream stored in the current Cache, then the processor will need to continuously read data from memory when accessing The efficiency of Cache will not be used. Therefore, when the attribute identifiers of a row in the first information table are all the second identifiers, all the attribute identifiers of the row can be reset to the first identifier, so that the data stored in the Cache is replaced and a new one is restarted Wheel detection.
本申请实施例提供的数据处理方法,通过接收请求指令,该请求指令中携带请求数据的地址信息,请求数据的地址信息包含行地址信息;若确定请求指令请求的数据未保存在Cache中,且请求指令请求的数据为热数据流,根据请求数据的地址信息,查询第一信息表,确定请求数据在Cache中的目标地址,其中,该目标地址为第一信息表中属性标识为第一标识的任意一个第一地址对应的第二地址;当第一信息表中任意一行的属性标识全部为第二标识时,内存控制器将该全部为第二标识的行中的所有属性标识重置为第一标识。本申请实施例通过将第一信息表中属性标识为第一标识的任意一个第一地址对应的第二地址,确定为未在cache中命中的热数据流的目标地址,从而在对Cache中的数据进行替换时,仅会替换可以被替换的数据,不会将不能被替换的数据替换掉,因此可以有效降低Cache中冷数据流替换热数据流的情况发生的概率;而且能够在第一信息表中某一行的属性标识全部为第二标识时,将该行的属性标识重置为第一标识,开始新一轮的检测,提高Cache的高效性。In the data processing method provided by the embodiment of the present application, by receiving a request instruction, the request instruction carries the address information of the requested data, and the address information of the requested data includes the row address information; if it is determined that the data requested by the request instruction is not stored in the cache, and The data requested by the request instruction is a hot data stream. According to the address information of the requested data, the first information table is queried to determine the target address of the requested data in the Cache, where the target address is the attribute identifier in the first information table as the first identifier The second address corresponding to any one of the first addresses; when the attribute identifiers of any row in the first information table are all the second identifiers, the memory controller resets all attribute identifiers in the rows that are all the second identifiers to The first logo. In the embodiment of the present application, the attribute in the first information table is identified as the second address corresponding to any one of the first addresses in the first identifier, and is determined as the target address of the hot data stream not hit in the cache. When the data is replaced, only the data that can be replaced will be replaced, and the data that cannot be replaced will not be replaced. Therefore, the probability of the cold data flow replacing the hot data flow in the Cache can be effectively reduced; When the attribute identifier of a row in the table is all the second identifier, reset the attribute identifier of the row to the first identifier, start a new round of detection, and improve the efficiency of the cache.
上述主要从方法步骤的角度对本发明实施例提供的方案进行了介绍。可以理解的是,计算机为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。 本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件和计算机软件的结合形式来实现。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。The above mainly introduces the solutions provided by the embodiments of the present invention from the perspective of method steps. It can be understood that, in order to realize the above-mentioned functions, the computer includes a hardware structure and / or a software module corresponding to each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of the examples described in the embodiments disclosed herein, the present application can be implemented in a combination of hardware and computer software. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
本申请实施例可以根据上述方法示例对计算机进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本发明实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the embodiments of the present application, the computer may be divided into function modules according to the above method examples. For example, each function module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or software function modules. It should be noted that the division of the modules in the embodiment of the present invention is schematic, and is only a division of logical functions. In actual implementation, there may be another division manner.
在采用对应各个功能划分各个功能模块的情况下,图13示出了上述实施例中所涉及的数据处理装置的一种可能的结构示意图,该数据处理装置1300包括:接收单元1301、处理单元1302和重置单元1303。接收单元1301用于支持数据处理装置1300执行图2中的S201;处理单元1302用于支持数据处理装置1300执行图2中的S202-S203、或图8中的S205、或图9中的S207。重置单元1303用于支持数据处理装置1300执行图6中的S204、或图8中的S206、或图11中的S208。其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。结合图1所示,上述数据处理装置1300可以为图1所示的计算机系统100,该数据处理装置1300中的至少一个单元可以软件、硬件或软件与硬件结合的方式实现。In the case where each functional module is divided corresponding to each function, FIG. 13 shows a possible structural schematic diagram of the data processing device involved in the above embodiment. The data processing device 1300 includes: a receiving unit 1301 and a processing unit 1302和 RESET 单元 1303。 And reset unit 1303. The receiving unit 1301 is used to support the data processing device 1300 to execute S201 in FIG. 2; the processing unit 1302 is used to support the data processing device 1300 to execute S202-S203 in FIG. 2, or S205 in FIG. 8, or S207 in FIG. 9. The reset unit 1303 is used to support the data processing device 1300 to execute S204 in FIG. 6, or S206 in FIG. 8, or S208 in FIG. 11. Wherein, all relevant content of each step involved in the above method embodiments can be referred to the function description of the corresponding function module, which will not be repeated here. With reference to FIG. 1, the above data processing device 1300 may be the computer system 100 shown in FIG. 1, and at least one unit in the data processing device 1300 may be implemented in software, hardware, or a combination of software and hardware.
在采用集成的单元的情况下,图14示出了上述实施例中所涉及的数据处理装置1400的一种可能的结构示意图。该数据处理装置1400包括:存储器1401和处理器1402。处理器1402用于对数据处理装置的动作进行控制管理,例如,处理器1402用于支持数据处理装置执行图2中的S201-S203、图6中的S201-S204、图8中的S201-S206、图9中的S201-S207、图11中的S201-S208,和/或用于本文所描述的技术的其它过程。存储器1401,用于存储数据处理装置1400执行上文所提供的任一数据处理方法所对应的程序代码和数据。该数据处理装置1400可以为图1所示的计算机系统100,上述图1涉及的各部件的所有相关内容的描述均可以援引到图14对应部件的功能描述,在此不再赘述。In the case of using an integrated unit, FIG. 14 shows a possible structural schematic diagram of the data processing apparatus 1400 involved in the foregoing embodiment. The data processing device 1400 includes a memory 1401 and a processor 1402. The processor 1402 is used to control and manage the operation of the data processing device. For example, the processor 1402 is used to support the data processing device to execute S201-S203 in FIG. 2, S201-S204 in FIG. 6, and S201-S206 in FIG. 8. , S201-S207 in FIG. 9, S201-S208 in FIG. 11, and / or other processes used in the techniques described herein. The memory 1401 is used to store program codes and data corresponding to the data processing method performed by the data processing device 1400 according to any of the data processing methods provided above. The data processing device 1400 may be the computer system 100 shown in FIG. 1. The description of all relevant contents of the components involved in FIG. 1 above may be referred to the functional description of the corresponding component in FIG. 14, which will not be repeated here.
本申请实施例还提供一种芯片,如图15所示,该芯片1500包括:包括处理器1501、内存控制器1502以及高速缓冲存储器Cache1503,其中,处理器1501用于发送请求指令;内存控制器1502用于执行图2中的S201-S203、图6中的S201-S204、图8中的S201-S206、图9中的S201-S207、图11中的S201-S208;高速缓冲存储器Cache1503用于支持高速缓存访问,提升系统的读写性能。该芯片1500可以为图1所示的计算机系统100中的芯片组,上述图1涉及的各部件的所有相关内容的描述均可以援引到图15对应部件的功能描述,在此不再赘述。An embodiment of the present application further provides a chip. As shown in FIG. 15, the chip 1500 includes: a processor 1501, a memory controller 1502, and a cache memory Cache 1503, where the processor 1501 is used to send a request instruction; the memory controller 1502 is used to execute S201-S203 in FIG. 2, S201-S204 in FIG. 6, S201-S206 in FIG. 8, S201-S207 in FIG. 9, S201-S208 in FIG. 11; cache Cache1503 is used in Support cache access to improve the read and write performance of the system. The chip 1500 may be a chipset in the computer system 100 shown in FIG. 1. The description of all relevant contents of the components involved in FIG. 1 above can be referred to the functional description of the corresponding component in FIG. 15, which will not be repeated here.
结合本申请公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于随机存取存储器(Random Access Memory,RAM)、闪存、可擦除可编程只读存储器(Erasable Programmable ROM,EPROM)、电可擦可编程只读存储器(Electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、只读光盘(CD-ROM) 或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。另外,该ASIC可以位于核心网接口设备中。当然,处理器和存储介质也可以作为分立组件存在于核心网接口设备中。The steps of the method or algorithm described in conjunction with the disclosure of the present application may be implemented by hardware, or by a processor executing software instructions. Software instructions can be composed of corresponding software modules, which can be stored in random access memory (Random Access Memory, RAM), flash memory, erasable programmable read-only memory (Erasable Programmable ROM, EPROM), electrically erasable Programmably read only memory (Electrically EPROM, EEPROM), registers, hard disk, removable hard disk, CD-ROM or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium may also be an integral part of the processor. The processor and the storage medium may be located in the ASIC. In addition, the ASIC may be located in the core network interface device. Of course, the processor and the storage medium may also exist as discrete components in the core network interface device.
本领域技术人员应该可以意识到,在上述一个或多个示例中,本发明所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention may be implemented by hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media includes computer storage media and communication media, where communication media includes any medium that facilitates transfer of a computer program from one place to another. The storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.
以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本发明的保护范围之内。The specific embodiments described above further describe the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific embodiments of the present invention and are not intended to limit the scope of the present invention. The scope of protection, any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present invention, shall be included in the scope of protection of the present invention.

Claims (17)

  1. 一种数据处理方法,其特征在于,所述方法包括:A data processing method, characterized in that the method includes:
    接收请求指令,所述请求指令中携带请求数据的地址信息;Receiving a request instruction, where the request instruction carries the address information of the requested data;
    确定所述请求指令请求的数据是否已经被保存在高速缓冲存储器Cache中,以及确定所述请求指令请求的数据是否为热数据流,若确定所述请求指令请求的数据未保存在所述Cache中,且所述请求指令请求的数据为热数据流,根据所述请求数据的地址信息,查询第一信息表,确定所述请求数据在Cache中的目标地址,其中,所述热数据流是指访问频率大于或等于预设阈值的数据;所述第一信息表包括一个或多个第一地址,所述第一地址与Cache中的第二地址一一对应,所述第一信息表还包括与每个第一地址对应的属性标识,所述属性标识包括第一标识和第二标识,所述第一标识用于指示对应的第二地址上的数据可以被替换,所述第二标识用于指示对应的第二地址上的数据不可以被替换,所述目标地址为所述第一信息表中属性标识为第一标识的任意一个第一地址对应的第二地址;Determine whether the data requested by the request instruction has been saved in the cache memory, and determine whether the data requested by the request instruction is a hot data stream, if it is determined that the data requested by the request instruction is not saved in the Cache , And the data requested by the request instruction is a hot data stream, query the first information table according to the address information of the request data, and determine the target address of the requested data in the cache, where the hot data stream refers to Data whose access frequency is greater than or equal to a preset threshold; the first information table includes one or more first addresses, the first address corresponds one-to-one with the second address in the cache, and the first information table further includes An attribute identifier corresponding to each first address. The attribute identifier includes a first identifier and a second identifier. The first identifier is used to indicate that data on the corresponding second address can be replaced. The second identifier is used To indicate that the data on the corresponding second address cannot be replaced, the target address is any first place where the attribute identifier in the first information table is the first identifier Corresponding to the second address;
    将所述请求指令请求的数据复制至所述Cache中的所述目标地址上。Copy the data requested by the request instruction to the target address in the cache.
  2. 根据权利要求1所述的数据处理方法,其特征在于,所述方法还包括:The data processing method according to claim 1, wherein the method further comprises:
    若所述请求指令请求的数据成功复制至所述Cache中的所述目标地址上,将所述第一信息表中与所述目标地址对应的第一地址的属性标识重置为第二标识。If the data requested by the request instruction is successfully copied to the target address in the Cache, the attribute identifier of the first address corresponding to the target address in the first information table is reset to the second identifier.
  3. 根据权利要求1或2所述的数据处理方法,其特征在于,所述请求数据的地址信息包含行地址信息,所述第一信息表包括一个或多个行,每个行中包括一个或多个第一地址,所述根据所述请求数据的地址信息,查询第一信息表,确定所述请求数据在Cache中的目标地址,包括:The data processing method according to claim 1 or 2, wherein the address information of the requested data includes row address information, the first information table includes one or more rows, and each row includes one or more rows A first address, the querying the first information table according to the address information of the request data to determine the target address of the request data in the cache includes:
    在所述第一信息表中查找所述行地址信息指示的行;Searching the row indicated by the row address information in the first information table;
    在所述行地址信息指示的行中,选取任意一个属性标识为第一标识的第一地址,确定该第一地址对应的Cache中的第二地址为所述目标地址。In the row indicated by the row address information, select any one of the first addresses whose attribute identifier is the first identifier, and determine that the second address in the Cache corresponding to the first address is the target address.
  4. 根据权利要求1-3任一项所述的数据处理方法,其特征在于,所述方法还包括:The data processing method according to any one of claims 1 to 3, wherein the method further comprises:
    若确定所述请求指令请求的数据保存在所述Cache中,且所述请求指令请求的数据为热数据流,查找所述请求数据在Cache中的第二地址;If it is determined that the data requested by the request instruction is stored in the cache, and the data requested by the request instruction is a hot data stream, look up the second address of the requested data in the cache;
    将所述第一信息表中与所述第二地址对应的第一地址的属性标识重置为第二标识。Reset the attribute identifier of the first address corresponding to the second address in the first information table to the second identifier.
  5. 根据权利要求1-4任一项所述的数据处理方法,其特征在于,所述方法还包括:The data processing method according to any one of claims 1 to 4, wherein the method further comprises:
    若确定所述请求指令请求的数据为冷数据流,根据所述请求数据的地址信息,在所述第二信息表中将任意一个第三地址中的地址信息替换为所述请求数据的地址信息;其中,所述冷数据流是指访问频率小于所述预设阈值的数据;所述第二信息表包含一个或多个第三地址,所述第三地址包括一个地址信息。If it is determined that the data requested by the request instruction is a cold data stream, according to the address information of the requested data, the address information in any third address is replaced with the address information of the requested data in the second information table ; Wherein, the cold data stream refers to data whose access frequency is less than the preset threshold; the second information table includes one or more third addresses, and the third address includes one address information.
  6. 根据权利要求5所述的数据处理方法,其特征在于,所述第二信息表包括一个或多个行,每个行中包括一个或多个第三地址,所述根据所述请求数据的地址信息,在所述第二信息表中将任意一个第三地址中的地址信息替换为所述请求数据的地址信息,包括:The data processing method according to claim 5, wherein the second information table includes one or more rows, each row includes one or more third addresses, and the address according to the request data Information, replacing the address information in any third address with the address information of the requested data in the second information table includes:
    根据所述请求数据的地址信息,在所述第二信息表中将所述行地址信息指示的行中的任意一个第三地址中的地址信息替换为所述请求数据的地址信息。According to the address information of the request data, the address information in any third address in the row indicated by the row address information is replaced with the address information of the request data in the second information table.
  7. 根据权利要求1-6任一项所述的数据处理方法,其特征在于,若所述第一信息表中任意一行的属性标识全部为第二标识,将该全部为第二标识的行中的所有属性标识重置为第一标识。The data processing method according to any one of claims 1 to 6, characterized in that, if the attribute identifiers of any row in the first information table are all second identifiers, the attributes in the rows that are all second identifiers All attribute identifiers are reset to the first identifier.
  8. 根据权利要求1-7任一项所述的数据处理方法,其特征在于,所述确定所述请求指令请求的数据是否为热数据流,包括:The data processing method according to any one of claims 1-7, wherein the determining whether the data requested by the request instruction is a hot data stream includes:
    根据所述请求数据的地址信息在第二信息表中查找所述行地址信息指示的行;Searching the row indicated by the row address information in the second information table according to the address information of the request data;
    若所述请求数据的地址信息与所述第二信息表中所述行地址信息指示的行中的任意一个第三地址包括的地址信息相同,确定所述请求指令请求的数据为所述热数据流;If the address information of the request data is the same as the address information included in any third address in the row indicated by the row address information in the second information table, it is determined that the data requested by the request instruction is the hot data flow;
    若所述请求数据的地址信息与所述第二信息表中所述行地址信息指示的行中的全部第三地址包括的地址信息均不同,确定所述请求指令请求的数据为冷数据流。If the address information of the request data is different from the address information included in all the third addresses in the row indicated by the row address information in the second information table, it is determined that the data requested by the request instruction is a cold data stream.
  9. 一种芯片,其特征在于,所述芯片包括处理器、内存控制器以及高速缓冲存储器Cache,其中,A chip, characterized in that the chip includes a processor, a memory controller and a cache memory Cache, wherein,
    所述处理器,用于发送请求指令,所述请求指令中携带请求数据的地址信息;The processor is used to send a request instruction, and the request instruction carries address information of the requested data;
    所述内存控制器,用于接收所述处理器发送的所述请求指令;确定所述请求指令请求的数据是否已经被保存在高速缓冲存储器Cache中,以及确定所述请求指令请求的数据是否为热数据流,若确定所述请求指令请求的数据未保存在所述Cache中,且所述请求指令请求的数据为热数据流,根据所述请求数据的地址信息,查询第一信息表,确定所述请求数据在Cache中的目标地址,其中,所述热数据流是指访问频率大于或等于预设阈值的数据;所述第一信息表包括一个或多个第一地址,所述第一地址与Cache中的第二地址一一对应,所述第一信息表还包括与每个第一地址对应的属性标识,所述属性标识包括第一标识和第二标识,所述第一标识用于指示对应的第二地址上的数据可以被替换,所述第二标识用于指示对应的第二地址上的数据不可以被替换,所述目标地址为所述第一信息表中属性标识为第一标识的任意一个第一地址对应的第二地址;将所述请求指令请求的数据复制至所述Cache中的所述目标地址上。The memory controller is configured to receive the request instruction sent by the processor; determine whether the data requested by the request instruction has been saved in the cache memory, and determine whether the data requested by the request instruction is Hot data stream, if it is determined that the data requested by the request instruction is not stored in the cache, and the data requested by the request instruction is a hot data stream, query the first information table according to the address information of the requested data to determine The target address of the requested data in the cache, wherein the hot data stream refers to data whose access frequency is greater than or equal to a preset threshold; the first information table includes one or more first addresses, the first The addresses correspond one-to-one with the second addresses in the cache. The first information table further includes an attribute identifier corresponding to each first address. The attribute identifier includes a first identifier and a second identifier. The first identifier is used In order to indicate that the data at the corresponding second address can be replaced, the second identifier is used to indicate that the data at the corresponding second address cannot be replaced. Identification of the first attribute information table is any one of a first identifier corresponding to the first address a second address; copy of the requested data to the instruction request on the destination address of the Cache.
  10. 根据权利要求9所述的芯片,其特征在于,The chip according to claim 9, characterized in that
    所述内存控制器,还用于若所述请求指令请求的数据成功复制至所述Cache中的所述目标地址上,将所述第一信息表中与所述目标地址对应的第一地址的属性标识重置为第二标识。The memory controller is further configured to, if the data requested by the request instruction is successfully copied to the target address in the cache, copy the first address corresponding to the target address in the first information table The attribute identification is reset to the second identification.
  11. 根据权利要求9或10所述的芯片,其特征在于,所述请求数据的地址信息包含行地址信息,所述第一信息表包括一个或多个行,每个行中包括一个或多个第一地址,The chip according to claim 9 or 10, wherein the address information of the request data includes row address information, the first information table includes one or more rows, and each row includes one or more An address,
    所述内存控制器,还用于在所述第一信息表中查找所述行地址信息指示的行;在所述行地址信息指示的行中,选取任意一个属性标识为第一标识的第一地址,确定该第一地址对应的Cache中的第二地址为所述目标地址。The memory controller is also used to search for the row indicated by the row address information in the first information table; among the rows indicated by the row address information, select any one of the attribute identifiers as the first Address, it is determined that the second address in the cache corresponding to the first address is the target address.
  12. 根据权利要求9-11任一项所述的芯片,其特征在于,The chip according to any one of claims 9-11, characterized in that
    所述内存控制器,还用于若确定所述请求指令请求的数据保存在所述Cache中,且所述请求指令请求的数据为热数据流,查找所述请求数据在Cache中的第二地址;将所述第一信息表中与所述第二地址对应的第一地址的属性标识重置为第二标识。The memory controller is further configured to, if it is determined that the data requested by the request instruction is stored in the cache, and the data requested by the request instruction is a hot data stream, search for the second address of the requested data in the cache Reset the attribute identifier of the first address corresponding to the second address in the first information table to the second identifier.
  13. 根据权利要求9-12任一项所述的芯片,其特征在于,The chip according to any one of claims 9-12, characterized in that
    所述内存控制器,还用于若确定所述请求指令请求的数据为冷数据流,根据所述请求数据的地址信息,在所述第二信息表中将任意一个第三地址中的地址信息替换为所述请求数据的地址信息;其中,所述冷数据流是指访问频率小于所述预设阈值的数据;所述第二信息表包含一个或多个第三地址,所述第三地址包括一个地址信息。The memory controller is further configured to, if it is determined that the data requested by the request instruction is a cold data stream, according to the address information of the requested data, address information in any third address in the second information table Replaced by the address information of the requested data; wherein, the cold data stream refers to data whose access frequency is less than the preset threshold; the second information table includes one or more third addresses, and the third address Include an address information.
  14. 根据权利要求13所述的芯片,其特征在于,所述第二信息表包括一个或多个行,每个行中包括一个或多个第三地址,The chip according to claim 13, wherein the second information table includes one or more rows, and each row includes one or more third addresses,
    所述内存控制器,具体用于根据所述请求数据的地址信息,在所述第二信息表中将所述行地址信息指示的行中的任意一个第三地址中的地址信息替换为所述请求数据的地址信息。The memory controller is specifically configured to replace the address information in any third address in the row indicated by the row address information with the address information of the request data in the second information table by the The address information of the requested data.
  15. 根据权利要求9-14任一项所述的芯片,其特征在于,The chip according to any one of claims 9 to 14, wherein
    所述内存控制器,还用于若所述第一信息表中任意一行的属性标识全部为第二标识,将该全部为第二标识的行中的所有属性标识重置为第一标识。The memory controller is further configured to, if the attribute identifiers of any row in the first information table are all second identifiers, reset all the attribute identifiers in the rows that are all second identifiers to the first identifier.
  16. 根据权利要求9-15任一项所述的芯片,其特征在于,The chip according to any one of claims 9 to 15, wherein
    所述内存控制器,还用于根据所述请求数据的地址信息在第二信息表中查找所述行地址信息指示的行;若所述请求数据的地址信息与所述第二信息表中所述行地址信息指示的行中的任意一个第三地址包括的地址信息相同,确定所述请求指令请求的数据为所述热数据流;若所述请求数据的地址信息与所述第二信息表中所述行地址信息指示的行中的全部第三地址包括的地址信息均不同,确定所述请求指令请求的数据为冷数据流。The memory controller is further configured to search for the row indicated by the row address information in the second information table according to the address information of the requested data; if the address information of the requested data is different from that in the second information table Any third address in the row indicated by the address information includes the same address information, and it is determined that the data requested by the request instruction is the hot data stream; if the address information of the requested data is the same as the second information table All third addresses in the row indicated by the row address information in the row include different address information, and it is determined that the data requested by the request instruction is a cold data stream.
  17. 一种计算机存储介质,所述计算机存储介质中存储有计算机程序代码,其特征在于,当所述计算机程序代码在处理器上运行时,使得所述处理器执行如权利要求1-8任一项所述的数据处理方法。A computer storage medium storing computer program code in the computer storage medium, characterized in that when the computer program code runs on a processor, the processor is caused to execute any one of claims 1-8 The data processing method.
PCT/CN2018/110111 2018-10-12 2018-10-12 Data processing method and device WO2020073328A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/110111 WO2020073328A1 (en) 2018-10-12 2018-10-12 Data processing method and device
CN201880097522.4A CN112673359A (en) 2018-10-12 2018-10-12 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/110111 WO2020073328A1 (en) 2018-10-12 2018-10-12 Data processing method and device

Publications (1)

Publication Number Publication Date
WO2020073328A1 true WO2020073328A1 (en) 2020-04-16

Family

ID=70163731

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/110111 WO2020073328A1 (en) 2018-10-12 2018-10-12 Data processing method and device

Country Status (2)

Country Link
CN (1) CN112673359A (en)
WO (1) WO2020073328A1 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102331986A (en) * 2010-07-12 2012-01-25 阿里巴巴集团控股有限公司 Database cache management method and database server
CN102609360A (en) * 2012-01-12 2012-07-25 华为技术有限公司 Data processing method, data processing device and data processing system
CN102902628A (en) * 2012-09-18 2013-01-30 记忆科技(深圳)有限公司 Flash memory and method and system for automatically separating cold and hot data based on same
CN103246615A (en) * 2013-04-24 2013-08-14 深圳市江波龙电子有限公司 Method and device for data management in flash memory device
US20140289477A1 (en) * 2013-03-25 2014-09-25 International Business Machines Corporation Lightweight primary cache replacement scheme using associated cache
CN105224473A (en) * 2015-09-15 2016-01-06 浪潮(北京)电子信息产业有限公司 The update method that a kind of solid state hard disc is data cached and device
CN108073527A (en) * 2016-11-07 2018-05-25 华为技术有限公司 It is a kind of to cache the method and apparatus replaced

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102331986A (en) * 2010-07-12 2012-01-25 阿里巴巴集团控股有限公司 Database cache management method and database server
CN102609360A (en) * 2012-01-12 2012-07-25 华为技术有限公司 Data processing method, data processing device and data processing system
CN102902628A (en) * 2012-09-18 2013-01-30 记忆科技(深圳)有限公司 Flash memory and method and system for automatically separating cold and hot data based on same
US20140289477A1 (en) * 2013-03-25 2014-09-25 International Business Machines Corporation Lightweight primary cache replacement scheme using associated cache
CN103246615A (en) * 2013-04-24 2013-08-14 深圳市江波龙电子有限公司 Method and device for data management in flash memory device
CN105224473A (en) * 2015-09-15 2016-01-06 浪潮(北京)电子信息产业有限公司 The update method that a kind of solid state hard disc is data cached and device
CN108073527A (en) * 2016-11-07 2018-05-25 华为技术有限公司 It is a kind of to cache the method and apparatus replaced

Also Published As

Publication number Publication date
CN112673359A (en) 2021-04-16

Similar Documents

Publication Publication Date Title
US11099769B1 (en) Copying data without accessing the data
US11113199B2 (en) Low-overhead index for a flash cache
CN108139966B (en) Method for managing address conversion bypass cache and multi-core processor
WO2018121430A1 (en) File storage and indexing method, apparatus, media, device and method for reading files
WO2017107948A1 (en) File write-aggregation and read-aggregation method and system, and client
WO2009065309A1 (en) Method and system for storing the program and system for the program demanding
WO2014094421A1 (en) Data processing method and virtual machine management platform
WO2018086075A1 (en) Storage system and system garbage collection method
US10936500B1 (en) Conditional cache persistence in database systems
WO2020125630A1 (en) File reading
WO2021062982A1 (en) Method and apparatus for managing hmb memory, and computer device and storage medium
CN113835639B (en) I/O request processing method, device, equipment and readable storage medium
CN108228088B (en) Method and apparatus for managing storage system
WO2020063355A1 (en) Method and device for buffering data blocks, computer device, and computer-readable storage medium
CN114860627A (en) Method for dynamically generating page table based on address information
CN113377689B (en) Routing table item searching and storing method and network chip
WO2019011311A1 (en) Data access method and apparatus
WO2020073328A1 (en) Data processing method and device
KR102071072B1 (en) Method for managing of memory address mapping table for data storage device
JP2018536230A (en) Cache access
CN114442961B (en) Data processing method, device, computer equipment and storage medium
CN109478163B (en) System and method for identifying a pending memory access request at a cache entry
US20150177987A1 (en) Augmenting memory capacity for key value cache
US20230117060A1 (en) Read-write method and apparatus, electronic device, and readable memory medium
CN107506156B (en) Io optimization method of block device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18936332

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18936332

Country of ref document: EP

Kind code of ref document: A1