WO2017008563A1 - Data processing method and device, and storage medium - Google Patents

Data processing method and device, and storage medium Download PDF

Info

Publication number
WO2017008563A1
WO2017008563A1 PCT/CN2016/081615 CN2016081615W WO2017008563A1 WO 2017008563 A1 WO2017008563 A1 WO 2017008563A1 CN 2016081615 W CN2016081615 W CN 2016081615W WO 2017008563 A1 WO2017008563 A1 WO 2017008563A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
memory
cache
address information
feature parameter
Prior art date
Application number
PCT/CN2016/081615
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 深圳市中兴微电子技术有限公司
Publication of WO2017008563A1 publication Critical patent/WO2017008563A1/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/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication

Definitions

  • the present invention relates to data reading and writing technology, and in particular, to a data processing method, a device thereof, and a storage medium.
  • the network transmission chip In order to reduce the cost, the network transmission chip generally uses Double Data Rate Synchronous Dynamic Random Access Memory (DDR SDRAM) to store data to meet the storage bandwidth and cache capacity requirements.
  • DDR SDRAM Double Data Rate Synchronous Dynamic Random Access Memory
  • the read/write efficiency of the DDR SDRAM and the cache utilization rate cannot be effectively improved. Therefore, a method is needed to solve the above problem.
  • the embodiments of the present invention provide a data processing method, a device thereof, and a storage medium, which can effectively improve the read/write efficiency of the memory and the cache utilization rate.
  • An embodiment of the present invention provides a data processing method, where the method includes:
  • the first cache feature parameter corresponding to the memory is adjusted according to the read address information, and the second cache feature parameter corresponding to the bank is adjusted.
  • the method further includes:
  • the first cache feature parameter and the second cache feature parameter both represent a cache usage amount; correspondingly,
  • the adjusting the first cache feature parameter corresponding to the memory according to the write address information, and adjusting the second cache feature parameter corresponding to the storage body includes:
  • the method further includes:
  • the first cache feature parameter and the second cache feature parameter are both characterized Cache usage; correspondingly,
  • the adjusting the first cache feature parameter corresponding to the memory according to the read address information, and adjusting the second cache feature parameter corresponding to the storage body includes:
  • the embodiment of the invention further provides a data processing device, the data processing device comprising:
  • a first acquiring unit configured to acquire a first cache feature parameter corresponding to the at least one memory
  • a second acquiring unit configured to acquire a second cache feature parameter corresponding to the at least one bank; the at least one bank is disposed in the at least one memory;
  • the adjusting unit is configured to: when it is determined that the first data is written into the at least one of the at least one memory, adjust the first cache feature parameter corresponding to the memory according to the write address information, and adjust the second corresponding to the storage body Cache feature parameters;
  • the data processing device further includes:
  • a first determining unit configured to determine a first target memory according to the first cache feature parameter corresponding to the at least one memory
  • a second determining unit configured to determine a first target storage body according to a second cache feature parameter corresponding to the at least one storage body; the first target storage body is disposed in the first target storage;
  • a third determining unit configured to determine the write address information according to the address information corresponding to the first target memory and the first target storage body, so as to store the first data in the write address The first target storage in the first target memory indicated by the information.
  • the first cache feature parameter and the second cache feature parameter both represent a cache usage amount; correspondingly,
  • the adjusting unit is further configured to: adjust, according to the first target memory indicated by the write address information, a buffer usage amount corresponding to the first target memory; and first, according to the write address information
  • the target storage body reduces the cache usage amount corresponding to the first target storage body.
  • the data processing device further includes:
  • a receiving unit configured to receive the read address information
  • a processing unit configured to acquire the second target storage indicated by the read address information and the second target storage in the second target storage.
  • the first cache feature parameter and the second cache feature parameter both represent a cache usage amount; correspondingly,
  • the adjusting unit is further configured to increase a buffer usage amount corresponding to the second target memory according to the second target memory indicated by the read address information; and second according to the read address information
  • the target storage body increases the cache usage amount corresponding to the second target storage medium.
  • the data processing method and the device and the storage medium according to the embodiments of the present invention are capable of adjusting the first cache feature parameter corresponding to the memory according to the storage change of the data, and adjusting the second cache feature parameter corresponding to the storage body, thereby maximally
  • the average use of each set of memory, as well as the banks in each set of memory, improves memory utilization while improving memory read and write efficiency.
  • FIG. 1 is a schematic flowchart 1 of an implementation process of a data processing method according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a step of determining write address information according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram 1 of a data processing apparatus according to an embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of a specific implementation process of a data processing method according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a connection between a data processing device and other devices in a specific application according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram of a probability curve according to an embodiment of the present invention.
  • FIG. 7 is a second schematic structural diagram of a data processing apparatus according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram 3 of a data processing apparatus according to an embodiment of the present invention.
  • DDR SDRAM chips In order to match data traffic, electronic devices usually use multiple sets of DDR SDRAM chips. For example, at 200 Gbps data traffic, electronic devices use eight sets of DDR SDRAM chips; here, due to the characteristics of DDR SDRAM chips, pre-charging is required when switching in the same bank. And activation, so the read and write efficiency is reduced; in order to solve the problem of reduced read and write efficiency caused by pre-charging and activation, the existing method often uses the inter-bank polling method to pre-charge and activate the bank of the pre-executed command in advance. Operation, which in turn hides the time taken for pre-charging and activation operations.
  • a splicing method is mentioned, that is, a message in which the length of the tail piece does not satisfy the slice length is spliced with the first slice of the next message to ensure that the length of the slice is fixed, and then The processing is further performed to achieve the purpose of improving the read/write efficiency and cache utilization of the DDR SDRAM.
  • the above method of polling and splicing between banks improves the efficiency of reading and writing, it also has great drawbacks.
  • the inter-bank polling can hide the time of pre-charging and activation operations, if the electronic device uses multiple sets of DDR SDRAM chips, it is impossible to solve the problem of improving cache utilization only by inter-bank polling. For example, when an electronic device uses two sets of DDR SDRAM chips, it uses an average of two sets of DDRs by inter-bank polling. SDRAM chip, but because the message is prioritized, the high-priority message is preferentially scheduled. Assuming that the high-priority message is mainly stored in the DDR SDRAM chip numbered 0, the high-priority message is followed.
  • the available buffer of the DDR SDRAM chip numbered 0 will be increased. If the buffer address is determined by polling between banks, there is no switching between DDR SDRAMs, that is, the polling mode between banks does not poll. To the bank in the DDR SDRAM chip numbered 0, the DDR SDRAM chip numbered 0 is not fully utilized, so the cache utilization of the DDR SDRAM chip numbered 0 is reduced.
  • the splicing operation is required when the message is written, and can only be processed after the splicing is completed. Therefore, the efficiency of the message writing is reduced; specifically, the processing period of the packet is not required to be spliced.
  • the processing period of the splicing operation is T1
  • the message writing time after the splicing operation becomes T0+T1
  • the time becomes longer thus affecting the line rate processing of the message; further, in the message After being read out, it needs to be spliced, and this part of the processing logic also takes time. Therefore, the splicing method prolongs the processing period of the entire message, that is, the processing period of reading and writing of the message is prolonged.
  • an embodiment of the present invention provides a data processing method, an apparatus, and a storage medium.
  • the basic idea of the embodiment of the present invention is: acquiring a first cache feature parameter corresponding to the at least one memory; acquiring a second cache feature parameter corresponding to the at least one bank; the at least one bank is disposed in the at least one memory; Determining, when the first data is written in the at least one memory in the at least one memory, adjusting the first cache feature parameter corresponding to the memory according to the write address information, and adjusting the second cache feature parameter corresponding to the bank; When the second data is read out from the at least one of the at least one memory, the first cache feature parameter corresponding to the memory is adjusted according to the read address information, and the corresponding bank is adjusted.
  • the second cache feature parameter is: acquiring a first cache feature parameter corresponding to the at least one memory; acquiring a second cache feature parameter corresponding to the at least one bank; the at least one bank is disposed in the at least one memory; Determining, when the first data is written in the at least one memory in the at least one memory, adjusting the first cache feature parameter corresponding to
  • FIG. 1 is a schematic flowchart of an implementation of a data processing method according to an embodiment of the present invention; applied to a data processing device; as shown in FIG. 1, the method includes:
  • Step 101 Acquire a first cache feature parameter corresponding to at least one memory.
  • Step 102 Acquire a second cache feature parameter corresponding to at least one bank; the at least one bank is disposed in the at least one memory;
  • Step 103 When it is determined that the first data is written into the at least one memory in the at least one memory, adjusting the first cache feature parameter corresponding to the memory according to the write address information, and adjusting the second cache feature corresponding to the storage body parameter;
  • Step 104 When it is determined that the second data is read out in at least one of the at least one memory, adjusting the first cache feature parameter corresponding to the memory according to the read address information, and adjusting the second cache corresponding to the storage body Characteristic Parameters.
  • the memory may be specifically DDR, or DDR SDRAM.
  • the electronic device is provided with or connected to a data processing device, and the data processing device is provided with or connected with N sets of memories, and each group of memories is provided with M banks (Bank), wherein, N and M A positive integer greater than or equal to 1; for example, the data processing apparatus is connected with N sets of DDR SDRAM, each set of DDR SDRAMs includes M banks; at this time, the data processing apparatus acquires the first of each set of DDR SDRAMs.
  • the data processing device also acquires the second cache feature parameters of the M banks corresponding to each group of DDR SDRAM, a total of M ⁇ N; thus, when the first data is pre-stored in at least one And determining, by the data processing device, the write address information corresponding to the first data according to the N first cache feature parameters and the M ⁇ N second cache feature parameters acquired by the data processing device; , as shown in FIG. 2, the step of determining write address information corresponding to the pre-written data includes:
  • Step 201 Determine a first target memory according to the first cache feature parameter corresponding to the at least one memory
  • Step 202 Determine a first target storage body according to a second cache feature parameter corresponding to the at least one storage unit; the first target storage body is disposed in the first target storage;
  • Step 203 Determine the write address information according to the address information corresponding to the first target memory and the first target storage body, so as to store the first data in the first indication of the write address information.
  • the first target storage body is a storage body corresponding to the first target storage, that is, the first target storage medium is disposed in the first target storage; further, to ensure The first target storage body is a storage body in the first target storage, that is, in order to prevent the data processing device from acquiring a second cache feature parameter corresponding to a storage body that is not the first target storage,
  • the step 202 may also be specifically:
  • the first target bank is output.
  • the write address information is determined according to the determined first target storage body and the first target storage, so as to write the first data into the first target corresponding to the write address information.
  • the first target bank of memory is used to store the write address information.
  • the data processing device further receives the read address information; further, after the data processing device receives the read address information, parsing the read address information, and according to The parsing result acquires the second target storage indicated by the read address information and the second target storage in the second target storage.
  • the first cache feature parameter corresponding to the first target memory finds a change; similarly, when the second data is read from the second target bank in the second target memory, it is apparent that the The first cache feature parameter corresponding to the second target storage and the second cache feature parameter corresponding to the second target storage are found to be changed; therefore, to enable the data processing device to acquire an accurate cache of the memory and the storage body
  • the feature parameter which is convenient for the new data to be written, determines the new write address information that matches the current cache feature according to the latest cache feature parameter, and the embodiment of the present invention also needs to adjust the cache feature parameters of the memory and the storage body.
  • the first cache feature parameter and the second cache feature parameter both represent a cache usage amount; correspondingly,
  • the adjusting the first cache feature parameter corresponding to the memory according to the write address information, and adjusting the second cache feature parameter corresponding to the storage body includes:
  • the adjusting the first cache feature parameter corresponding to the memory according to the read address information, and adjusting the second cache feature parameter corresponding to the storage body includes:
  • the buffer usage amount corresponding to the first target memory may be reduced according to the data amount of the first data written, and the corresponding corresponding to the first target storage body may be adjusted. Cache usage; further, data according to the read second data The amount of the cache usage corresponding to the second target storage is increased, and the cache usage corresponding to the second target storage volume is increased.
  • the data processing method in the embodiment of the present invention can adjust the first cache feature parameter corresponding to the memory according to the storage change of the data, and adjust the second cache feature parameter corresponding to the storage body, thereby maximizing the average use of each group.
  • the memory, and the banks in each group of memories improve the utilization of the memory; moreover, when the memory is DDR SDRAM, the embodiment of the present invention can hide the pre-charging time and activation time of the same line of the DDR SDRAM. In turn, the read and write efficiency of DDR SDRAM is improved.
  • the embodiment of the present invention further provides a data processing device.
  • the data processing device includes:
  • the first obtaining unit 31 is configured to acquire a first cache feature parameter corresponding to the at least one memory
  • the second obtaining unit 32 is configured to acquire a second cache feature parameter corresponding to the at least one bank; the at least one bank is disposed in the at least one memory;
  • the adjusting unit 33 is configured to: when it is determined that the first data is written into the at least one memory in the at least one memory, adjust the first cache feature parameter corresponding to the memory according to the write address information, and adjust the corresponding body of the storage body Two cache feature parameters;
  • the data processing apparatus further includes:
  • the first determining unit 34 is configured to determine, according to the first cache feature parameter corresponding to the at least one memory, a first target memory;
  • the second determining unit 35 is configured to determine a first target storage body according to the second cache feature parameter corresponding to the at least one storage body; the first target storage body is disposed in the first target storage In the device;
  • the third determining unit 36 is configured to determine the write address information according to the address information corresponding to the first target memory and the first target storage body, so as to store the first data in the write The first target bank in the first target memory indicated by the address information.
  • the first cache feature parameter and the second cache feature parameter both represent a cache usage amount; correspondingly,
  • the adjusting unit 33 is further configured to: adjust, according to the first target memory indicated by the write address information, a buffer usage amount corresponding to the first target memory; and according to the instruction indicated by the write address information a target bank, which reduces the cache usage of the first target bank.
  • the data processing apparatus further includes:
  • the receiving unit 37 is configured to receive the read address information
  • the processing unit 38 is configured to acquire the second target storage indicated by the read address information and the second target storage in the second target storage.
  • the first cache feature parameter and the second cache feature parameter both represent a cache usage amount; correspondingly,
  • the adjusting unit 33 is further configured to increase a buffer usage amount corresponding to the second target memory according to the second target memory indicated by the read address information; and according to the instruction indicated by the read address information
  • the second target storage body increases the cache usage amount corresponding to the second target storage medium.
  • the first acquiring unit 31, the second obtaining unit 32, the adjusting unit 33, the first determining unit 34, the second determining unit 35, the third determining unit 36, the receiving unit 37, and the processing unit 38 may each be Central Processing Unit (CPU, Central Processing Unit), or digital The signal processing (DSP, Digital Signal Processor), or Field Programmable Gate Array (FPGA) is implemented; the CPU, DSP, and FPGA can be built in the data processing device.
  • CPU Central Processing Unit
  • DSP Digital Signal Processor
  • FPGA Field Programmable Gate Array
  • the embodiment of the invention further provides a computer readable storage medium, the storage medium comprising a set of instructions for executing the data processing method according to the first embodiment.
  • the foregoing device embodiments are merely illustrative.
  • the division of the unit is only a logical function division, and may be implemented in actual implementation.
  • the way of division such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed.
  • the manner in which the data processing apparatus is divided is different from that in the first embodiment.
  • the memory is specifically a DDR SDRAM; the data processing method runs in a data processing device; as shown in FIG. 5, the data processing device 51 is shown in FIG. Connected to the DDR controller 52; the DDR controller 52 is coupled to the DDR SDRAM group 53; that is, the data processing device 51 is coupled to the DDR SDRAM group 53 via the DDR controller 52; the DDR SDRAM The group includes one or more sets of DDR SDRAMs, and each set of DDR SDRAMs includes one or more banks.
  • the read and write operations of the message data are implemented by the DDR SDRAM group, and all The message data is in accordance with the processing flow read and then read; specifically, as shown in FIG. 4, the method includes:
  • Step 401 The DDR controller receives the first packet, and slices the received first packet according to requirements, and divides the first packet into one or more first fragments of the same length.
  • Step 402 The DDR controller sends one or more first fragments to the data processing device. And triggering the data processing device to count the cache usage of each group of DDR SDRAMs in the DDR SDRAM group, and counting the buffer usage of each bank in each group of DDR SDRAMs;
  • Step 403 The data processing apparatus determines, according to the buffer usage of each group of DDR SDRAMs in the DDR SDRAM group, and the buffer usage of each bank in each group of DDR SDRAMs, the first target DDR SDRAM is determined. And the first target bank in the first target DDR SDRAM;
  • the data processing apparatus determines a probability curve corresponding to the cache usage amount according to a preset rule, and further, causes the data processing apparatus to use a cache usage amount of each group of DDR SDRAMs in the DDR SDRAM group. And a buffer usage of each bank in each group of DDR SDRAMs, and a probability curve corresponding to the cache usage amount to determine a first target DDR SDRAM, and a first target bank in the first target DDR SDRAM.
  • FIG. 6 is a schematic diagram of a probability curve according to an embodiment of the present invention. As shown in FIG. 6, the greater the amount of cache usage, the smaller the probability that the set of DDR SDRAMs are selected; when the cache usage exceeds a certain maximum threshold, such as a maximum value (maxth) ), the set of DDR SDRAM will not be selected.
  • a certain maximum threshold such as a maximum value (maxth)
  • the data processing apparatus determines a first target DDR SDRAM according to a buffer usage amount of each group of DDR SDRAMs in the DDR SDRAM group; further, the data processing apparatus is configured according to the first The buffer usage of each bank in the target DDR SDRAM determines the first target bank. At this time, the first target bank is the bank in the first target DDR SDRAM.
  • Step 404 The data processing apparatus determines, according to the first target DDR SDRAM and address information corresponding to the first target bank, write address information.
  • Step 405 The data processing apparatus sends the write address information to a DDR controller, and writes one or more first fragments in the first packet to the write by using the DDR controller. Entering the first target bank of the first target DDR SDRAM corresponding to the address information;
  • Step 406 After the first message is written into the DDR SDRAM group according to the write address information, the DDR controller triggers the data processing device to determine the first target DDR SDRAM and the a first target bank, adjusting a cache usage amount corresponding to the first target DDR SDRAM, and adjusting a cache usage amount corresponding to the first target bank;
  • the first target DDR SDRAM determined by the data processing device may be specifically an identification number corresponding to the target DDR SDRAM, which is called a DDR SDRAM number; similarly, the data processing device
  • the first target bank that is determined may also be specifically an identification number corresponding to the target bank, which is called a bank number; thus, the data processing device determines the first target DDR SDRAM by using the DDR SDRAM number, and the first number is obtained by the Bank number.
  • the first target bank is determined in the target DDR SDRAM.
  • Step 407 When the first message needs to be read, the data processing device receives the read address information sent by the DDR controller, parses the read address information, and obtains the information according to the analysis result. a second target DDR SDRAM corresponding to the read address information, and a second target bank corresponding to the second target DDR SDRAM;
  • the read message is also the first message, and the first message is written into the DDR SDRAM group according to the write address information
  • the read address information and the The write address information is the same;
  • the second target DDR SDRAM is the same as the first target DDR SDRAM, and the second target bank is the same as the first target bank.
  • Step 408 The DDR controller reads each first fragment from the DDR SDRAM group according to the read address information, and combines each first fragment into a complete first packet, and outputs the first a message;
  • the data processing device sends the second target DDR SDRAM and the second target bank determined by itself to the DDR controller, thereby causing the DDR controller to be
  • the second target DDR SDRAM and the second target bank read out the first fragments, and combine the first fragments into a complete first message to output the first message.
  • Step 409 After determining that the first message is read, the DDR controller triggers the data processing device to use the second target DDR SDRAM corresponding to the read address information, and the second target DDR.
  • the second target bank corresponding to the SDRAM adjusts a cache usage amount corresponding to the second target DDR SDRAM, and adjusts a cache usage amount corresponding to the second target bank to release a cache space corresponding to the read address information.
  • the data processing device can obtain the latest cache usage of each group of DDR SDRAMs in the DDR SDRAM group, and each group of DDR SDRAMs.
  • the latest cache usage of each bank and based on the latest cache usage, determine the new write address information that matches the current cache usage, thus maximizing the average use of each set of DDR SDRAM, and
  • Each bank in each group of DDR SDRAMs improves the cache utilization of the DDR SDRAM group and improves the read and write efficiency of the DDR SDRAM group.
  • the embodiment of the present invention further provides a data processing apparatus.
  • the data processing apparatus includes:
  • the packet processing module 71 is configured to receive one or more first fragments sent by the DDR controller, and is further configured to send the one or more first fragments to the DDR processing module and the bank processing module;
  • the packet processing module 71 is further configured to acquire and read an address.
  • the DDR processing module 72 is configured to receive one or more first fragments sent by the packet processing module 71, and trigger the self-stated cache usage of each group of DDR SDRAMs in the DDR SDRAM group, and determine according to a preset rule. And outputting the first target DDR SDRAM corresponding to the one or more first fragments, and then sending the determined first target DDR SDRAM to the address module;
  • the DDR processing module 72 includes: a DDR statistics sub-module 721, a DDR selection probability sub-module 722, and a DDR synthesis judging sub-module 723; a DDR statistical sub-module and a DDR selection probability sub-
  • the number of modules corresponds to the number of groups of DDR SDRAM; specifically,
  • the DDR statistics sub-module 721 is configured to track and count the cache usage of each group of DDR SDRAMs in the DDR SDRAM group; here, in a preferred embodiment, there are several sets of DDR SDRAMs, and several DDR statistical sub-modules are required; Each DDR statistic sub-module 721 is configured to track and count the cache usage of a certain group of DDR SDRAMs in the DDR SDRAM group; and then track and count the cache usage of all DDR SDRAMs in the DDR SDRAM group through the plurality of sets of DDR statistic sub-modules 721.
  • the DDR statistics sub-module is further configured to: when the first message is written into the DDR SDRAM group, adjust a buffer usage of the first target DDR SDRAM corresponding to the write address information, specifically And increasing a buffer usage amount corresponding to the first target DDR SDRAM; and configured to adjust the second target DDR SDRAM corresponding to the read address information when the second packet is read out of the DDR SDRAM group Cache usage, specifically reducing the second target DDR corresponding to the read address information SDRAM cache usage.
  • the DDR selection probability sub-module 722 is configured to select a probability curve and control logic according to the buffer usage of each group of DDR SDRAMs in the DDR SDRAM group; and configured to use the buffer usage of each group of DDR SDRAMs in the DDR SDRAM group.
  • a probability curve and control logic determining a probability value corresponding to each set of DDR SDRAMs; further configured to determine whether a certain set of DDR SDRAMs corresponding to the probability values are based on probability values corresponding to each set of DDR SDRAMs and control logic Specifically, the larger the cache usage of a certain group of DDR SDRAMs, the smaller the probability of being selected; in a preferred embodiment, the DDR selection probability sub-module 722 has a one-to-one correspondence with the DDR statistics sub-module 721, that is, Each DDR selection probability sub-module 722 and DDR statistical sub-module 721 corresponds to one DDR SDRAM group, and each set of DDR SDRAM corresponds to a probability curve.
  • the DDR selection probability sub-module only functions at the slice input, and is invalid when the slice is output; that is, when the first data is written into the DDR SDRAM group, the DDR selection probability sub-module functions; When the second data is read out of the DDR SDRAM group, the DDR selection probability sub-module does not function.
  • the DDR comprehensive judgment sub-module 723 is configured to select the first target DDR SDRAM according to the information indicating whether the DDR SDRAM of the group is selected and the judgment logic of the DDR selection probability sub-module output; specifically, selecting the first target DDR SDRAM Corresponding DDR SDRAM number; configured to send the first target DDR SDRAM to the bank processing module and the address module; specifically, send the DDR SDRAM number corresponding to the first target DDR SDRAM to the bank processing module and the address module
  • the DDR comprehensive judgment sub-module 723 is only provided with one, that is, the plurality of DDR selection probability sub-modules 722 and the plurality of DDR statistical sub-modules 721 correspond to one DDR comprehensive judgment sub-module 723.
  • the DDR integrated judgment sub-module functions only at the time of slice input, and is invalid when the slice is output; that is, when the first data is written into the DDR SDRAM group, the DDR integrated judgment sub-module functions.
  • the DDR comprehensive judgment submodule When the second data is read out of the DDR SDRAM group, the DDR comprehensive judgment submodule The block does not work.
  • the currently selected DDR SDRAM numbers are combined and processed according to a selection algorithm to determine a unique first target DDR SDRAM, and The determined first target DDR SDRAM is sent to the bank processing module and the address module; for example, determining the DDR SDRAM number corresponding to the unique first target DDR SDRAM, and transmitting the DDR SDRAM number corresponding to the unique first target DDR SDRAM To the bank processing module and address module.
  • the selection algorithm may be a polling scheduling (RR) algorithm, a congestion management algorithm (WFQ), or the like.
  • the bank processing module 73 is configured to receive one or more first fragments sent by the packet processing module 71, and trigger itself to track and count the buffer usage of each bank in the DDR SDRAM group; Determining, by the first target DDR SDRAM, a first target bank corresponding to the one or more first fragments in the first target DDR SDRAM according to a preset rule, and further, the first target bank Send to the address module;
  • the usage amount is further configured to: when the second message is read out of the DDR SDRAM group, adjust a buffer usage amount of the second target bank corresponding to the read address information, specifically reduce the readout The cache usage of the second target bank corresponding to the address information.
  • the bank processing module 73 includes: a bank statistics sub-module 731, a bank selection probability sub-module 732, a bank comprehensive judgment sub-module 733, and a multi-path selection sub-module (MUX) 734; As shown in FIG.
  • each bank corresponds to a Bank statistical sub-module 731 and a Bank selection probability sub-module 732; however, if one bank of each group of DDR SDRAMs has a bank corresponding to the Bank statistical sub-module 731, Bank selection probability
  • the sub-module 732 is bound into a group; all the banks in each group of DDR SDRAM correspond to one bank comprehensive judgment sub-module, and all the bank comprehensive judgment sub-modules correspond to one multi-path selection sub-module 734; Body,
  • the Bank Statistics sub-module 731 is configured to track and count the buffer usage of each bank in the DDR SDRAM group; further, to be configured to adjust and write the first message when the first message is written to the DDR SDRAM group
  • the buffer usage of the first target bank corresponding to the address information specifically increasing the buffer usage amount corresponding to the first target bank; and further configured to adjust when the second packet is read out of the DDR SDRAM group
  • the buffer usage amount of the second target bank corresponding to the read address information specifically reduces the buffer usage amount of the second target bank corresponding to the read address information.
  • the number of DDR SDRAM groups used is different, and the number of banks in each group of DDR SDRAM is different, and the number of Bank statistical sub-modules and Bank selection probability sub-modules are different.
  • the Bank selection probability sub-module is similar to the Bank statistical sub-module; assuming that the system uses 8 sets of DDR SDRAM, each group of DDR SDRAM has 8 banks, then a total of 64 Bank statistical sub-modules are needed.
  • the 64 Bank statistical sub-modules are not completely independent, but each 8 bank statistics modules are bound into a group, corresponding to a group of DDR SDRAM.
  • each time a first fragment is written the buffer usage of the bank to which the first fragment belongs is increased by one; conversely, when the fragment is output, the usage of the bank to which the fragment belongs is subtracted by one.
  • the Bank selection probability sub-module 732 is configured to select a probability curve according to the buffer usage of each bank in the DDR SDRAM group; and is further configured to determine a probability value corresponding to each bank according to the buffer usage of each bank and the probability curve. And configured to determine, according to the probability value corresponding to each bank, whether a certain bank corresponding to the probability value is selected; specifically, the larger the buffer usage of a certain group of banks, the smaller the probability of being selected; here,
  • the Bank Select Probability sub-module only works when the slice is input, and is invalid when the slice is output; that is, when the first data is written into the DDR SDRAM group, the Bank Select Probability sub-module functions; when the second When the data is read out of the DDR SDRAM group, the Bank Selection Probability sub-module does not work.
  • each bank or each group of DDR SDRAM or all groups of DDR SDRAM corresponds to a probability curve.
  • the Bank comprehensive judgment sub-module 733 is configured to determine, according to the information indicating whether the Bank is selected by the Bank selection probability sub-module and its own judgment logic, to determine the first suspect target bank; and to configure the first suspect target bank to be determined.
  • a multiplex selection sub-module 734 configured to receive the first target DDR SDRAM and the first suspected target bank; further configured to receive, according to the received first suspect target bank, the first target DDR SDRAM Determining a first target bank in a target DDR SDRAM; specifically, determining a bank number corresponding to the first target bank in the first target DDR SDRAM; and configured to send the first target bank to the address module.
  • the Bank comprehensive judgment sub-module receives the input information of a plurality of banks belonging to a group of DDR SDRAMs, and combines the information corresponding to the last selected bank according to a selection algorithm, such as RR polling, WFQ. Etc., determine the currently selected bank number, that is, the bank number corresponding to the first suspected target bank. If there are multiple sets of DDR SDRAM, there will be a corresponding number of Bank numbers. At this time, a plurality of Bank numbers, that is, a bank number corresponding to the plurality of first suspect target banks are sent to the multiplex selection sub-module; and then the multiplex selection sub-module needs to output the first target DDR SDRAM according to the DDR processing module. Corresponding DDR SDRAM number, the bank number corresponding to the first target bank is determined in the first target DDR SDRAM.
  • the address module 74 is configured to receive the first target DDR SDRAM, and the first target bank in the first target DDR SDRAM, and determine the write according to the first target DDR SDRAM and the first target bank. Address information; also configured to write the address address The information is sent to the DDR control module.
  • the packet processing module 71, the DDR processing module 72, the bank processing module 73, and the address module 74 may each be a central processing unit (CPU) or a digital signal processor (DSP). Or a Field Programmable Gate Array (FPGA), etc.; the CPU, DSP, and FPGA can be built in the data processing apparatus.
  • CPU central processing unit
  • DSP digital signal processor
  • FPGA Field Programmable Gate Array
  • the data processing method and apparatus can maximize the average utilization of the cache space, and avoid excessive use or under-use of a certain group or some DDR SDRAMs, and the case of one or some banks in the DDR SDRAM.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • These computer program instructions can also be stored in a bootable computer or other programmable data processing
  • the apparatus is readable in a computer readable memory in a particular manner such that instructions stored in the computer readable memory produce an article of manufacture comprising instruction means implemented in one or more flows and/or block diagrams of the flowchart The function specified in the box or in multiple boxes.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • the embodiment of the present invention can adjust the first cache feature parameter corresponding to the memory according to the storage change of the data, and adjust the second cache feature parameter corresponding to the storage body, thereby maximizing the average use of each set of memory, and each set of memory
  • the memory bank improves the utilization of the memory and improves the read and write efficiency of the memory.

Abstract

A data processing method and device, and a storage medium. The method comprises: acquiring a first buffer characteristic parameter corresponding to at least one memory (101); acquiring a second buffer characteristic parameter corresponding to at least one memory bank, the at least one memory bank being provided in the at least one memory (102); when it is determined that there is first data written into the at least one memory bank in the at least one memory, adjusting the first buffer characteristic parameter corresponding to the memory and adjusting the second buffer characteristic parameter corresponding to the memory bank, according to information about an address into which the first data is written (103); and when it is determined that there is second data read out of the at least one memory bank in the at least one memory, adjusting the first buffer characteristic parameter corresponding to the memory and adjusting the second buffer characteristic parameter corresponding to the memory bank, according to information about the address out of which the second data is read (104).

Description

一种数据处理方法及其装置、存储介质Data processing method and device thereof, storage medium 技术领域Technical field
本发明涉及数据读写技术,尤其涉及一种数据处理方法及其装置、存储介质。The present invention relates to data reading and writing technology, and in particular, to a data processing method, a device thereof, and a storage medium.
背景技术Background technique
随着网络容量和数据业务的发展,数据流量快速增长;而在数据流量快速增长的情况下,报文处理过程中,为满足服务质量(QoS,Quality of Service)的要求,对数据缓存的缓存容量和缓存带宽的要求变得越来越高。With the development of network capacity and data services, data traffic grows rapidly. In the case of rapid data traffic growth, in the process of packet processing, in order to meet the requirements of QoS (Quality of Service), the data cache is cached. Capacity and cache bandwidth requirements are getting higher and higher.
为了降低成本,网络传输芯片一般使用双倍速率同步动态随机存储器(DDR SDRAM,Double Data Rate Synchronous Dynamic Random Access Memory)存储数据,以满足存储带宽和缓存容量的需求。但是,现有方式中,并不能有效提高DDR SDRAM的读写效率以及缓存利用率,因此,亟需一种方法以解决上述问题。In order to reduce the cost, the network transmission chip generally uses Double Data Rate Synchronous Dynamic Random Access Memory (DDR SDRAM) to store data to meet the storage bandwidth and cache capacity requirements. However, in the existing method, the read/write efficiency of the DDR SDRAM and the cache utilization rate cannot be effectively improved. Therefore, a method is needed to solve the above problem.
发明内容Summary of the invention
为解决现有存在的技术问题,本发明实施例提供了一种数据处理方法及其装置、存储介质,能有效提升存储器的读写效率以及缓存利用率。In order to solve the existing technical problems, the embodiments of the present invention provide a data processing method, a device thereof, and a storage medium, which can effectively improve the read/write efficiency of the memory and the cache utilization rate.
本发明实施例的技术方案是这样实现的:The technical solution of the embodiment of the present invention is implemented as follows:
本发明实施例提供了一种数据处理方法,所述方法包括:An embodiment of the present invention provides a data processing method, where the method includes:
获取至少一个存储器对应的第一缓存特征参数;Obtaining a first cache feature parameter corresponding to the at least one memory;
获取至少一个存储体对应的第二缓存特征参数;所述至少一个存储体设置于所述至少一个存储器中;Obtaining a second cache feature parameter corresponding to the at least one bank; the at least one bank is disposed in the at least one memory;
当确定存在第一数据写入所述至少一个存储器中的至少一个存储体中 时,根据写入地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数;Determining that the presence of the first data is written into the at least one of the at least one memory Adjusting, according to the write address information, the first cache feature parameter corresponding to the memory, and adjusting the second cache feature parameter corresponding to the storage body;
当确定存在第二数据被读出所述至少一个存储器中的至少一个存储体中时,根据读出地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数。When it is determined that the second data is read out of the at least one of the at least one memory, the first cache feature parameter corresponding to the memory is adjusted according to the read address information, and the second cache feature parameter corresponding to the bank is adjusted.
上述方案中,所述方法还包括:In the above solution, the method further includes:
根据所述至少一个存储器对应的第一缓存特征参数确定出第一目标存储器;Determining a first target memory according to the first cache feature parameter corresponding to the at least one memory;
根据至少一个存储体对应的第二缓存特征参数确定出第一目标存储体;所述第一目标存储体设置于所述第一目标存储器中;Determining, according to the second cache feature parameter corresponding to the at least one storage body, the first target storage body; the first target storage body being disposed in the first target storage;
根据所述第一目标存储器和所述第一目标存储体对应的地址信息确定出所述写入地址信息,以便于将所述第一数据存储于所述写入地址信息指示的第一目标存储器中的第一目标存储体中。Determining the write address information according to the address information corresponding to the first target memory and the first target storage body, so as to store the first data in the first target storage indicated by the write address information In the first target bank.
上述方案中,所述第一缓存特征参数和所述第二缓存特征参数均表征缓存使用量;对应地,In the above solution, the first cache feature parameter and the second cache feature parameter both represent a cache usage amount; correspondingly,
所述根据写入地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数,包括:The adjusting the first cache feature parameter corresponding to the memory according to the write address information, and adjusting the second cache feature parameter corresponding to the storage body, includes:
根据所述写入地址信息所指示的第一目标存储器,调小所述第一目标存储器对应的缓存使用量;以及根据所述写入地址信息所指示的第一目标存储体,调小所述第一目标存储体对应的缓存使用量。Reducing a cache usage amount corresponding to the first target memory according to the first target memory indicated by the write address information; and reducing the small target according to the first target storage indicated by the write address information The cache usage corresponding to the first target bank.
上述方案中,所述方法还包括:In the above solution, the method further includes:
接收所述读出地址信息;Receiving the read address information;
获取所述读出地址信息所指示的第二目标存储器以及所述第二目标存储器中的第二目标存储体。And acquiring a second target storage indicated by the read address information and a second target storage in the second target storage.
上述方案中,所述第一缓存特征参数和所述第二缓存特征参数均表征 缓存使用量;对应地,In the above solution, the first cache feature parameter and the second cache feature parameter are both characterized Cache usage; correspondingly,
所述根据读出地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数,包括:The adjusting the first cache feature parameter corresponding to the memory according to the read address information, and adjusting the second cache feature parameter corresponding to the storage body, includes:
根据所述读出地址信息所指示的第二目标存储器,调大所述第二目标存储器对应的缓存使用量;以及根据所述读出地址信息所指示的第二目标存储体,调大所述第二目标存储体对应的缓存使用量。And increasing, according to the second target memory indicated by the read address information, a buffer usage amount corresponding to the second target memory; and increasing the size according to the second target storage body indicated by the read address information The cache usage corresponding to the second target bank.
本发明实施例还提供了一种数据处理装置,所述数据处理装置包括:The embodiment of the invention further provides a data processing device, the data processing device comprising:
第一获取单元,配置为获取至少一个存储器对应的第一缓存特征参数;a first acquiring unit, configured to acquire a first cache feature parameter corresponding to the at least one memory;
第二获取单元,配置为获取至少一个存储体对应的第二缓存特征参数;所述至少一个存储体设置于所述至少一个存储器中;a second acquiring unit, configured to acquire a second cache feature parameter corresponding to the at least one bank; the at least one bank is disposed in the at least one memory;
调整单元,配置为当确定存在第一数据写入所述至少一个存储器中的至少一个存储体中时,根据写入地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数;The adjusting unit is configured to: when it is determined that the first data is written into the at least one of the at least one memory, adjust the first cache feature parameter corresponding to the memory according to the write address information, and adjust the second corresponding to the storage body Cache feature parameters;
还配置为当确定存在第二数据被读出所述至少一个存储器中的至少一个存储体中时,根据读出地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数。And configured to: when it is determined that the second data is read out of the at least one of the at least one memory, adjust the first cache feature parameter corresponding to the memory according to the read address information, and adjust the second cache corresponding to the bank Characteristic Parameters.
上述方案中,所述数据处理装置还包括:In the above solution, the data processing device further includes:
第一确定单元,配置为根据所述至少一个存储器对应的第一缓存特征参数确定出第一目标存储器;a first determining unit, configured to determine a first target memory according to the first cache feature parameter corresponding to the at least one memory;
第二确定单元,配置为根据至少一个存储体对应的第二缓存特征参数确定出第一目标存储体;所述第一目标存储体设置于所述第一目标存储器中;a second determining unit, configured to determine a first target storage body according to a second cache feature parameter corresponding to the at least one storage body; the first target storage body is disposed in the first target storage;
第三确定单元,配置为根据所述第一目标存储器和所述第一目标存储体对应的地址信息确定出所述写入地址信息,以便于将所述第一数据存储于所述写入地址信息指示的第一目标存储器中的第一目标存储体中。 a third determining unit, configured to determine the write address information according to the address information corresponding to the first target memory and the first target storage body, so as to store the first data in the write address The first target storage in the first target memory indicated by the information.
上述方案中,所述第一缓存特征参数和所述第二缓存特征参数均表征缓存使用量;对应地,In the above solution, the first cache feature parameter and the second cache feature parameter both represent a cache usage amount; correspondingly,
所述调整单元,还配置为根据所述写入地址信息所指示的第一目标存储器,调小所述第一目标存储器对应的缓存使用量;以及根据所述写入地址信息所指示的第一目标存储体,调小所述第一目标存储体对应的缓存使用量。The adjusting unit is further configured to: adjust, according to the first target memory indicated by the write address information, a buffer usage amount corresponding to the first target memory; and first, according to the write address information The target storage body reduces the cache usage amount corresponding to the first target storage body.
上述方案中,所述数据处理装置还包括:In the above solution, the data processing device further includes:
接收单元,配置为接收所述读出地址信息;a receiving unit configured to receive the read address information;
处理单元,配置为获取所述读出地址信息所指示的第二目标存储器以及所述第二目标存储器中的第二目标存储体。And a processing unit configured to acquire the second target storage indicated by the read address information and the second target storage in the second target storage.
上述方案中,所述第一缓存特征参数和所述第二缓存特征参数均表征缓存使用量;对应地,In the above solution, the first cache feature parameter and the second cache feature parameter both represent a cache usage amount; correspondingly,
所述调整单元,还配置为根据所述读出地址信息所指示的第二目标存储器,调大所述第二目标存储器对应的缓存使用量;以及根据所述读出地址信息所指示的第二目标存储体,调大所述第二目标存储体对应的缓存使用量。The adjusting unit is further configured to increase a buffer usage amount corresponding to the second target memory according to the second target memory indicated by the read address information; and second according to the read address information The target storage body increases the cache usage amount corresponding to the second target storage medium.
本发明实施例所述的数据处理方法及其装置、存储介质,能够根据数据的存储变化情况调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数,进而最大化地平均地使用每组存储器,以及每组存储器中的存储体,提高了存储器的利用率,同时提升了存储器的读写效率。The data processing method and the device and the storage medium according to the embodiments of the present invention are capable of adjusting the first cache feature parameter corresponding to the memory according to the storage change of the data, and adjusting the second cache feature parameter corresponding to the storage body, thereby maximally The average use of each set of memory, as well as the banks in each set of memory, improves memory utilization while improving memory read and write efficiency.
附图说明DRAWINGS
图1为本发明实施例数据处理方法的实现流程示意图一;1 is a schematic flowchart 1 of an implementation process of a data processing method according to an embodiment of the present invention;
图2为本发明实施例确定写入地址信息的步骤的流程示意图;2 is a schematic flowchart of a step of determining write address information according to an embodiment of the present invention;
图3为本发明实施例数据处理装置的结构示意图一; 3 is a schematic structural diagram 1 of a data processing apparatus according to an embodiment of the present invention;
图4为本发明实施例数据处理方法的具体实现流程示意图;4 is a schematic flowchart of a specific implementation process of a data processing method according to an embodiment of the present invention;
图5为本发明实施例具体应用中数据处理装置与其他装置的连接结构示意图;FIG. 5 is a schematic structural diagram of a connection between a data processing device and other devices in a specific application according to an embodiment of the present invention; FIG.
图6为本发明实施例概率曲线示意图;6 is a schematic diagram of a probability curve according to an embodiment of the present invention;
图7为本发明实施例数据处理装置的结构示意图二;FIG. 7 is a second schematic structural diagram of a data processing apparatus according to an embodiment of the present invention; FIG.
图8为本发明实施例数据处理装置的结构示意图三。FIG. 8 is a schematic structural diagram 3 of a data processing apparatus according to an embodiment of the present invention.
具体实施方式detailed description
为了匹配数据流量,通常电子设备会使用多组DDR SDRAM芯片,比如在200Gbps的数据流量下,电子设备使用8组DDR SDRAM芯片;这里,由于DDR SDRAM芯片的特性,在同一Bank换行时需要预充电和激活,所以导致读写效率降低;为解决由于预充电和激活而导致的读写效率降低的问题,现有方式常采用Bank间轮询方法,提前对预执行命令的Bank进行预充电和激活操作,进而隐藏预充电和激活操作所用时间。进一步地,为了方便管理缓存地址,很多网络传输芯片都将接收到的报文切割为固定长度的分片;但实际上,网络传输芯片处理的报文长度是不定的,将报文切割成固定长度的分片进行存储的方式不仅有可能浪费缓存空间,而且还可能会浪费存储器的存取带宽。因此在公开号为CN201110057810的专利中提到了一种拼接的方法,即将尾部分片长度不满足分片长度的报文与下一报文的首分片进行拼接,以确保分片长度固定,随后再进行处理,从而达到提高DDR SDRAM的读写效率和缓存利用率的目的。In order to match data traffic, electronic devices usually use multiple sets of DDR SDRAM chips. For example, at 200 Gbps data traffic, electronic devices use eight sets of DDR SDRAM chips; here, due to the characteristics of DDR SDRAM chips, pre-charging is required when switching in the same bank. And activation, so the read and write efficiency is reduced; in order to solve the problem of reduced read and write efficiency caused by pre-charging and activation, the existing method often uses the inter-bank polling method to pre-charge and activate the bank of the pre-executed command in advance. Operation, which in turn hides the time taken for pre-charging and activation operations. Further, in order to facilitate the management of the cache address, many network transmission chips cut the received message into fixed-length fragments; in fact, the length of the message processed by the network transmission chip is indefinite, and the message is cut into fixed. The way in which the length of the slice is stored not only may waste the cache space, but may also waste the access bandwidth of the memory. Therefore, in the patent publication CN201110057810, a splicing method is mentioned, that is, a message in which the length of the tail piece does not satisfy the slice length is spliced with the first slice of the next message to ensure that the length of the slice is fixed, and then The processing is further performed to achieve the purpose of improving the read/write efficiency and cache utilization of the DDR SDRAM.
但是上述通过Bank间轮询方法和拼接的方法虽然提高了读写效率,但是也存在很大的弊端。具体地,所述Bank间轮询虽然可以隐藏预充电和激活操作的时间,但是如果电子设备使用了多组DDR SDRAM芯片,仅仅通过Bank间轮询是不能解决提高缓存利用率的。例如,当电子设备使用2组DDR SDRAM芯片,写入时通过Bank间轮询的方式平均利用2组DDR  SDRAM芯片,但由于报文区分优先级,因此,高优先级的报文优先被调度出去;假设高优先级报文主要存储在编号为0的DDR SDRAM芯片中,则随着高优先级报文被调度出去,编号为0的DDR SDRAM芯片的可用缓存将增加,此时若采用Bank间轮询的方式确定缓存地址,由于DDR SDRAM间没有切换,即Bank间轮询的方式并不会轮询到所述编号为0的DDR SDRAM芯片中的Bank,因此编号为0的DDR SDRAM芯片并未得到充分地利用,所以降低了编号为0的DDR SDRAM芯片的缓存利用率。However, although the above method of polling and splicing between banks improves the efficiency of reading and writing, it also has great drawbacks. Specifically, although the inter-bank polling can hide the time of pre-charging and activation operations, if the electronic device uses multiple sets of DDR SDRAM chips, it is impossible to solve the problem of improving cache utilization only by inter-bank polling. For example, when an electronic device uses two sets of DDR SDRAM chips, it uses an average of two sets of DDRs by inter-bank polling. SDRAM chip, but because the message is prioritized, the high-priority message is preferentially scheduled. Assuming that the high-priority message is mainly stored in the DDR SDRAM chip numbered 0, the high-priority message is followed. The available buffer of the DDR SDRAM chip numbered 0 will be increased. If the buffer address is determined by polling between banks, there is no switching between DDR SDRAMs, that is, the polling mode between banks does not poll. To the bank in the DDR SDRAM chip numbered 0, the DDR SDRAM chip numbered 0 is not fully utilized, so the cache utilization of the DDR SDRAM chip numbered 0 is reduced.
进一步地,对于拼接的方法,报文写入时需要拼接操作,只有等拼接完成后才能被处理,因此,降低了报文写入时的效率;具体地,假设不需要拼接时报文的处理周期为T0,拼接操作的处理周期为T1,而拼接操作后在进行报文写入时间则变为T0+T1,时间变长,如此,影响了报文的线速处理;进一步地,在报文被读出后需要进行解拼接,而这部分处理逻辑也是需要时间的,因此,拼接的方法延长了整个报文处理的周期,即延长了报文读写的处理周期。Further, for the splicing method, the splicing operation is required when the message is written, and can only be processed after the splicing is completed. Therefore, the efficiency of the message writing is reduced; specifically, the processing period of the packet is not required to be spliced. For T0, the processing period of the splicing operation is T1, and the message writing time after the splicing operation becomes T0+T1, and the time becomes longer, thus affecting the line rate processing of the message; further, in the message After being read out, it needs to be spliced, and this part of the processing logic also takes time. Therefore, the splicing method prolongs the processing period of the entire message, that is, the processing period of reading and writing of the message is prolonged.
因此,为解决上述问题,本发明实施例提供了一种数据处理方法及其装置、存储介质;为了能够更加详尽地了解本发明的特点与技术内容,下面结合附图对本发明的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本发明。Therefore, in order to solve the above problems, an embodiment of the present invention provides a data processing method, an apparatus, and a storage medium. In order to understand the features and technical contents of the present invention in more detail, the implementation of the present invention will be described in detail below with reference to the accompanying drawings. The attached drawings are for illustrative purposes only and are not intended to limit the invention.
本发明实施例的基本思想是:获取至少一个存储器对应的第一缓存特征参数;获取至少一个存储体对应的第二缓存特征参数;所述至少一个存储体设置于所述至少一个存储器中;当确定存在第一数据写入所述至少一个存储器中的至少一个存储体中时,根据写入地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数;当确定存在第二数据被读出所述至少一个存储器中的至少一个存储体中时,根据读出地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的 第二缓存特征参数。The basic idea of the embodiment of the present invention is: acquiring a first cache feature parameter corresponding to the at least one memory; acquiring a second cache feature parameter corresponding to the at least one bank; the at least one bank is disposed in the at least one memory; Determining, when the first data is written in the at least one memory in the at least one memory, adjusting the first cache feature parameter corresponding to the memory according to the write address information, and adjusting the second cache feature parameter corresponding to the bank; When the second data is read out from the at least one of the at least one memory, the first cache feature parameter corresponding to the memory is adjusted according to the read address information, and the corresponding bank is adjusted. The second cache feature parameter.
实施例一 Embodiment 1
图1为本发明实施例数据处理方法的实现流程示意图;应用于数据处理装置;如图1所示,所述方法包括:1 is a schematic flowchart of an implementation of a data processing method according to an embodiment of the present invention; applied to a data processing device; as shown in FIG. 1, the method includes:
步骤101:获取至少一个存储器对应的第一缓存特征参数;Step 101: Acquire a first cache feature parameter corresponding to at least one memory.
步骤102:获取至少一个存储体对应的第二缓存特征参数;所述至少一个存储体设置于所述至少一个存储器中;Step 102: Acquire a second cache feature parameter corresponding to at least one bank; the at least one bank is disposed in the at least one memory;
步骤103:当确定存在第一数据写入所述至少一个存储器中的至少一个存储体中时,根据写入地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数;Step 103: When it is determined that the first data is written into the at least one memory in the at least one memory, adjusting the first cache feature parameter corresponding to the memory according to the write address information, and adjusting the second cache feature corresponding to the storage body parameter;
步骤104:当确定存在第二数据被读出所述至少一个存储器中的至少一个存储体中时,根据读出地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数。Step 104: When it is determined that the second data is read out in at least one of the at least one memory, adjusting the first cache feature parameter corresponding to the memory according to the read address information, and adjusting the second cache corresponding to the storage body Characteristic Parameters.
本实施例中,存储器可以具体为DDR,或者DDR SDRAM。In this embodiment, the memory may be specifically DDR, or DDR SDRAM.
在一具体实施例中,电子设备设置或连接有数据处理装置,所述数据处理装置中设置或连接有N组存储器,每组存储器中设置有M个存储体(Bank),其中,N和M均为大于等于1的正整数;例如,所述数据处理装置中连接有N组DDR SDRAM,每组DDR SDRAM包含有M个Bank;此时,所述数据处理装置获取每组DDR SDRAM的第一缓存特征参数,共获取到N个;所述数据处理装置还获取每组DDR SDRAM对应的M个Bank的第二缓存特征参数,共M×N个;如此,当有第一数据预存入至少一个存储器中的至少一个Bank中时,所述数据处理装置根据自身获取到的N个第一缓存特征参数,以及M×N个第二缓存特征参数确定出第一数据对应的写入地址信息;具体地,如图2所示,确定预写入数据对应的写入地址信息的步骤包括: In a specific embodiment, the electronic device is provided with or connected to a data processing device, and the data processing device is provided with or connected with N sets of memories, and each group of memories is provided with M banks (Bank), wherein, N and M A positive integer greater than or equal to 1; for example, the data processing apparatus is connected with N sets of DDR SDRAM, each set of DDR SDRAMs includes M banks; at this time, the data processing apparatus acquires the first of each set of DDR SDRAMs. Cache feature parameters, a total of N; the data processing device also acquires the second cache feature parameters of the M banks corresponding to each group of DDR SDRAM, a total of M×N; thus, when the first data is pre-stored in at least one And determining, by the data processing device, the write address information corresponding to the first data according to the N first cache feature parameters and the M×N second cache feature parameters acquired by the data processing device; , as shown in FIG. 2, the step of determining write address information corresponding to the pre-written data includes:
步骤201:根据所述至少一个存储器对应的第一缓存特征参数确定出第一目标存储器;Step 201: Determine a first target memory according to the first cache feature parameter corresponding to the at least one memory;
步骤202:根据至少一个存储体对应的第二缓存特征参数确定出第一目标存储体;所述第一目标存储体设置于所述第一目标存储器中;Step 202: Determine a first target storage body according to a second cache feature parameter corresponding to the at least one storage unit; the first target storage body is disposed in the first target storage;
步骤203:根据所述第一目标存储器和所述第一目标存储体对应的地址信息确定出所述写入地址信息,以便于将所述第一数据存储于所述写入地址信息指示的第一目标存储器中的第一目标存储体中。Step 203: Determine the write address information according to the address information corresponding to the first target memory and the first target storage body, so as to store the first data in the first indication of the write address information. A first target bank in a target memory.
这里,值得注意的是,所述第一目标存储体为所述第一目标存储器对应的存储体,也即所述第一目标存储体设置于所述第一目标存储器中;进一步地,为确保所述第一目标存储体即为所述第一目标存储器中的存储体,也就是说,为避免所述数据处理装置获取非所述第一目标存储器的存储体对应的第二缓存特征参数,降低自身效率,本发明实施例中,所述步骤202,还可以具体为:Here, it is noted that the first target storage body is a storage body corresponding to the first target storage, that is, the first target storage medium is disposed in the first target storage; further, to ensure The first target storage body is a storage body in the first target storage, that is, in order to prevent the data processing device from acquiring a second cache feature parameter corresponding to a storage body that is not the first target storage, In the embodiment of the present invention, the step 202 may also be specifically:
在所述第一目标存储器对应的至少一个存储体中确定出至少一个存储体对应的第二缓存特征参数,并根据所述第一目标存储器中的至少一个存储体对应的第二缓存特征参数确定出第一目标存储体。Determining a second cache feature parameter corresponding to the at least one bank in the at least one bank corresponding to the first target memory, and determining, according to the second cache feature parameter corresponding to the at least one bank in the first target memory The first target bank is output.
如此,根据确定出的所述第一目标存储体以及所述第一目标存储器确定出所述写入地址信息,以便于将所述第一数据写入所述写入地址信息对应的第一目标存储器的第一目标存储体中。In this way, the write address information is determined according to the determined first target storage body and the first target storage, so as to write the first data into the first target corresponding to the write address information. The first target bank of memory.
本实施例中,所述数据处理装置还会接收到所述读出地址信息;进一步地,当所述数据处理装置接收到所述读出地址信息后,解析所述读出地址信息,并根据解析结果获取所述读出地址信息所指示的第二目标存储器以及所述第二目标存储器中的第二目标存储体。In this embodiment, the data processing device further receives the read address information; further, after the data processing device receives the read address information, parsing the read address information, and according to The parsing result acquires the second target storage indicated by the read address information and the second target storage in the second target storage.
此时,当所述第一数据写入所述第一目标存储器的第一目标存储体中后,显然会使得所述第一目标存储器对应的第一缓存特征参数、以及所述 第一目标存储体对应的第二缓存特征参数发现变化;同理,当所述第二数据从所述第二目标存储器中的第二目标存储体中被读出时,显然也会使所述第二目标存储器对应的第一缓存特征参数、以及所述第二目标存储体对应的第二缓存特征参数发现变化;因此,为使所述数据处理装置能够获取到存储器以及存储体的准确的缓存特征参数,进而便于有新的数据写入时,根据最新的缓存特征参数确定出与当前缓存特征匹配的新的写入地址信息,本发明实施例还需要调整存储器以及存储体的缓存特征参数,例如存在第一数据写入存储器中的存储体时,或者存在第二数据从存储器中的存储体中被读出时,均需要调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数,具体地,At this time, after the first data is written into the first target storage of the first target memory, it is apparent that the first cache feature parameter corresponding to the first target memory, and the The second cache feature parameter corresponding to the first target bank finds a change; similarly, when the second data is read from the second target bank in the second target memory, it is apparent that the The first cache feature parameter corresponding to the second target storage and the second cache feature parameter corresponding to the second target storage are found to be changed; therefore, to enable the data processing device to acquire an accurate cache of the memory and the storage body The feature parameter, which is convenient for the new data to be written, determines the new write address information that matches the current cache feature according to the latest cache feature parameter, and the embodiment of the present invention also needs to adjust the cache feature parameters of the memory and the storage body. For example, when there is a first data written to the bank in the memory, or when the second data is read from the bank in the memory, it is necessary to adjust the first cache feature parameter corresponding to the memory, and adjust the corresponding corresponding to the bank. Two cache feature parameters, specifically,
本实施例中,所述第一缓存特征参数和所述第二缓存特征参数均表征缓存使用量;对应地,In this embodiment, the first cache feature parameter and the second cache feature parameter both represent a cache usage amount; correspondingly,
所述根据写入地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数,包括:The adjusting the first cache feature parameter corresponding to the memory according to the write address information, and adjusting the second cache feature parameter corresponding to the storage body, includes:
根据所述写入地址信息所指示的第一目标存储器,调小所述第一目标存储器对应的缓存使用量;以及根据所述写入地址信息所指示的第一目标存储体,调小所述第一目标存储体对应的缓存使用量。Reducing a cache usage amount corresponding to the first target memory according to the first target memory indicated by the write address information; and reducing the small target according to the first target storage indicated by the write address information The cache usage corresponding to the first target bank.
进一步地,所述根据读出地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数,包括:Further, the adjusting the first cache feature parameter corresponding to the memory according to the read address information, and adjusting the second cache feature parameter corresponding to the storage body, includes:
根据所述读出地址信息所指示的第二目标存储器,调大所述第二目标存储器对应的缓存使用量;以及根据所述读出地址信息所指示的第二目标存储体,调大所述第二目标存储体对应的缓存使用量。And increasing, according to the second target memory indicated by the read address information, a buffer usage amount corresponding to the second target memory; and increasing the size according to the second target storage body indicated by the read address information The cache usage corresponding to the second target bank.
本领域技术人员应该了解,在实际应用中,可以根据写入的第一数据的数据量,调小所述第一目标存储器对应的缓存使用量,以及调小所述第一目标存储体对应的缓存使用量;进一步地,根据读出的第二数据的数据 量,调大所述第二目标存储器对应的缓存使用量,以及调大所述第二目标存储体对应的缓存使用量。It should be understood by those skilled in the art that, in an actual application, the buffer usage amount corresponding to the first target memory may be reduced according to the data amount of the first data written, and the corresponding corresponding to the first target storage body may be adjusted. Cache usage; further, data according to the read second data The amount of the cache usage corresponding to the second target storage is increased, and the cache usage corresponding to the second target storage volume is increased.
这样,本发明实施例所述的数据处理方法能够根据数据的存储变化情况调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数,进而最大化地平均地使用每组存储器,以及每组存储器中的存储体,提高了存储器的利用率;而且,当所述存储器为DDR SDRAM时,本发明实施例还能够隐藏DDR SDRAM的同Bank换行的预充电时间和激活时间,进而提高了DDR SDRAM的读写效率。In this way, the data processing method in the embodiment of the present invention can adjust the first cache feature parameter corresponding to the memory according to the storage change of the data, and adjust the second cache feature parameter corresponding to the storage body, thereby maximizing the average use of each group. The memory, and the banks in each group of memories, improve the utilization of the memory; moreover, when the memory is DDR SDRAM, the embodiment of the present invention can hide the pre-charging time and activation time of the same line of the DDR SDRAM. In turn, the read and write efficiency of DDR SDRAM is improved.
为实现实施例一所述的数据处理方法,本发明实施例还提供了一种数据处理装置,如图3所示,所述数据处理装置包括:In order to implement the data processing method of the first embodiment, the embodiment of the present invention further provides a data processing device. As shown in FIG. 3, the data processing device includes:
第一获取单元31,配置为获取至少一个存储器对应的第一缓存特征参数;The first obtaining unit 31 is configured to acquire a first cache feature parameter corresponding to the at least one memory;
第二获取单元32,配置为获取至少一个存储体对应的第二缓存特征参数;所述至少一个存储体设置于所述至少一个存储器中;The second obtaining unit 32 is configured to acquire a second cache feature parameter corresponding to the at least one bank; the at least one bank is disposed in the at least one memory;
调整单元33,配置为当确定存在第一数据写入所述至少一个存储器中的至少一个存储体中时,根据写入地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数;The adjusting unit 33 is configured to: when it is determined that the first data is written into the at least one memory in the at least one memory, adjust the first cache feature parameter corresponding to the memory according to the write address information, and adjust the corresponding body of the storage body Two cache feature parameters;
还配置为当确定存在第二数据被读出所述至少一个存储器中的至少一个存储体中时,根据读出地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数。And configured to: when it is determined that the second data is read out of the at least one of the at least one memory, adjust the first cache feature parameter corresponding to the memory according to the read address information, and adjust the second cache corresponding to the bank Characteristic Parameters.
本实施例中,所述数据处理装置还包括:In this embodiment, the data processing apparatus further includes:
第一确定单元34,配置为根据所述至少一个存储器对应的第一缓存特征参数确定出第一目标存储器;The first determining unit 34 is configured to determine, according to the first cache feature parameter corresponding to the at least one memory, a first target memory;
第二确定单元35,配置为根据至少一个存储体对应的第二缓存特征参数确定出第一目标存储体;所述第一目标存储体设置于所述第一目标存储 器中;The second determining unit 35 is configured to determine a first target storage body according to the second cache feature parameter corresponding to the at least one storage body; the first target storage body is disposed in the first target storage In the device;
第三确定单元36,配置为根据所述第一目标存储器和所述第一目标存储体对应的地址信息确定出所述写入地址信息,以便于将所述第一数据存储于所述写入地址信息指示的第一目标存储器中的第一目标存储体中。The third determining unit 36 is configured to determine the write address information according to the address information corresponding to the first target memory and the first target storage body, so as to store the first data in the write The first target bank in the first target memory indicated by the address information.
本实施例中,所述第一缓存特征参数和所述第二缓存特征参数均表征缓存使用量;对应地,In this embodiment, the first cache feature parameter and the second cache feature parameter both represent a cache usage amount; correspondingly,
所述调整单元33,还配置为根据所述写入地址信息所指示的第一目标存储器,调小所述第一目标存储器对应的缓存使用量;以及根据所述写入地址信息所指示的第一目标存储体,调小所述第一目标存储体对应的缓存使用量。The adjusting unit 33 is further configured to: adjust, according to the first target memory indicated by the write address information, a buffer usage amount corresponding to the first target memory; and according to the instruction indicated by the write address information a target bank, which reduces the cache usage of the first target bank.
本实施例中,所述数据处理装置还包括:In this embodiment, the data processing apparatus further includes:
接收单元37,配置为接收所述读出地址信息;The receiving unit 37 is configured to receive the read address information;
处理单元38,配置为获取所述读出地址信息所指示的第二目标存储器以及所述第二目标存储器中的第二目标存储体。The processing unit 38 is configured to acquire the second target storage indicated by the read address information and the second target storage in the second target storage.
本实施例中,所述第一缓存特征参数和所述第二缓存特征参数均表征缓存使用量;对应地,In this embodiment, the first cache feature parameter and the second cache feature parameter both represent a cache usage amount; correspondingly,
所述调整单元33,还配置为根据所述读出地址信息所指示的第二目标存储器,调大所述第二目标存储器对应的缓存使用量;以及根据所述读出地址信息所指示的第二目标存储体,调大所述第二目标存储体对应的缓存使用量。The adjusting unit 33 is further configured to increase a buffer usage amount corresponding to the second target memory according to the second target memory indicated by the read address information; and according to the instruction indicated by the read address information The second target storage body increases the cache usage amount corresponding to the second target storage medium.
本领域技术人员应当理解,本发明实施例的数据处理装置中各处理单元的功能,可参照前述数据处理方法的相关描述而理解。It should be understood by those skilled in the art that the functions of the processing units in the data processing apparatus of the embodiments of the present invention can be understood by referring to the related description of the foregoing data processing methods.
在实际应用中,所述第一获取单元31、第二获取单元32、调整单元33、第一确定单元34、第二确定单元35、第三确定单元36、接收单元37以及处理单元38均可由中央处理单元(CPU,Central Processing Unit)、或数字 信号处理(DSP,Digital Signal Processor)、或现场可编程门阵列(FPGA,Field Programmable Gate Array)等来实现;所述CPU、DSP、FPGA均可内置于数据处理装置中。In an actual application, the first acquiring unit 31, the second obtaining unit 32, the adjusting unit 33, the first determining unit 34, the second determining unit 35, the third determining unit 36, the receiving unit 37, and the processing unit 38 may each be Central Processing Unit (CPU, Central Processing Unit), or digital The signal processing (DSP, Digital Signal Processor), or Field Programmable Gate Array (FPGA) is implemented; the CPU, DSP, and FPGA can be built in the data processing device.
本发明实施例还提出一种计算机可读存储介质,该存储介质包括一组指令,所述指令用于执行实施例一所述的数据处理方法。The embodiment of the invention further provides a computer readable storage medium, the storage medium comprising a set of instructions for executing the data processing method according to the first embodiment.
应该理解到,在本申请所提供的实施例中,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。为进一步地说明,以下给出的具体实施例中,所述数据处理装置的划分方式与实施例一不同。It should be understood that, in the embodiments provided by the present application, the foregoing device embodiments are merely illustrative. For example, the division of the unit is only a logical function division, and may be implemented in actual implementation. The way of division, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. To further illustrate, in the specific embodiment given below, the manner in which the data processing apparatus is divided is different from that in the first embodiment.
实施例二Embodiment 2
图4为本发明实施例数据处理方法的具体实现流程示意图;本实施例中存储器具体为DDR SDRAM;所述数据处理方法运行于数据处理装置中;如图5所示,所述数据处理装置51与DDR控制器52连接;所述DDR控制器52与DDR SDRAM组53连接;也就是说,所述数据处理装置51通过所述DDR控制器52与所述DDR SDRAM组53连接;所述DDR SDRAM组中包含有一组或多组DDR SDRAM,每组DDR SDRAM包含有一个或多个Bank;本实施例中,报文数据的读写操作均是通过所述DDR SDRAM组实现的,而且,所有的报文数据都是遵循先写入后读出的处理流程的;具体地,如图4所示,所述方法包括:4 is a schematic flowchart of a specific implementation of a data processing method according to an embodiment of the present invention; in this embodiment, the memory is specifically a DDR SDRAM; the data processing method runs in a data processing device; as shown in FIG. 5, the data processing device 51 is shown in FIG. Connected to the DDR controller 52; the DDR controller 52 is coupled to the DDR SDRAM group 53; that is, the data processing device 51 is coupled to the DDR SDRAM group 53 via the DDR controller 52; the DDR SDRAM The group includes one or more sets of DDR SDRAMs, and each set of DDR SDRAMs includes one or more banks. In this embodiment, the read and write operations of the message data are implemented by the DDR SDRAM group, and all The message data is in accordance with the processing flow read and then read; specifically, as shown in FIG. 4, the method includes:
步骤401:DDR控制器接收第一报文,并将接收的所述第一报文根据需要进行切片,分割成长度相同的一个或多个第一分片;Step 401: The DDR controller receives the first packet, and slices the received first packet according to requirements, and divides the first packet into one or more first fragments of the same length.
本实施例中,即使所述第一报文的包尾长度不能满足分片长度时,也可被当作一个完整分片。In this embodiment, even if the tail length of the first packet cannot satisfy the fragment length, it can be regarded as a complete fragment.
步骤402:DDR控制器将一个或多个第一分片发送至所述数据处理装 置,并触发所述数据处理装置统计所述DDR SDRAM组中的每一组DDR SDRAM的缓存使用量,以及统计每一组DDR SDRAM中的每一个Bank的缓存使用量;Step 402: The DDR controller sends one or more first fragments to the data processing device. And triggering the data processing device to count the cache usage of each group of DDR SDRAMs in the DDR SDRAM group, and counting the buffer usage of each bank in each group of DDR SDRAMs;
步骤403:所述数据处理装置根据所述DDR SDRAM组中的每一组DDR SDRAM的缓存使用量,以及每一组DDR SDRAM中的每一个Bank的缓存使用量,确定出第一目标DDR SDRAM,以及所述第一目标DDR SDRAM中的第一目标Bank;Step 403: The data processing apparatus determines, according to the buffer usage of each group of DDR SDRAMs in the DDR SDRAM group, and the buffer usage of each bank in each group of DDR SDRAMs, the first target DDR SDRAM is determined. And the first target bank in the first target DDR SDRAM;
在实际应用中,所述数据处理装置根据预设规则确定出与缓存使用量对应的概率曲线,进而,使得所述数据处理装置根据所述DDR SDRAM组中的每一组DDR SDRAM的缓存使用量,以及每一组DDR SDRAM中的每一个Bank的缓存使用量,以及与缓存使用量对应的概率曲线确定出第一目标DDR SDRAM,以及所述第一目标DDR SDRAM中的第一目标Bank。In an actual application, the data processing apparatus determines a probability curve corresponding to the cache usage amount according to a preset rule, and further, causes the data processing apparatus to use a cache usage amount of each group of DDR SDRAMs in the DDR SDRAM group. And a buffer usage of each bank in each group of DDR SDRAMs, and a probability curve corresponding to the cache usage amount to determine a first target DDR SDRAM, and a first target bank in the first target DDR SDRAM.
图6为本发明实施例概率曲线示意图;如图6所示,缓存使用量越大,该组DDR SDRAM被选中的概率就越小;当缓存使用量超过某个最大阈值,例如最大值(maxth),该组DDR SDRAM就不会被选中。6 is a schematic diagram of a probability curve according to an embodiment of the present invention; as shown in FIG. 6, the greater the amount of cache usage, the smaller the probability that the set of DDR SDRAMs are selected; when the cache usage exceeds a certain maximum threshold, such as a maximum value (maxth) ), the set of DDR SDRAM will not be selected.
在一具体实施例中,所述数据处理装置根据所述DDR SDRAM组中的每一组DDR SDRAM的缓存使用量确定出第一目标DDR SDRAM;进一步地,所述数据处理装置根据所述第一目标DDR SDRAM中的每一个Bank的缓存使用量确定出第一目标Bank,此时,所述第一目标Bank即为所述第一目标DDR SDRAM中的Bank。In a specific embodiment, the data processing apparatus determines a first target DDR SDRAM according to a buffer usage amount of each group of DDR SDRAMs in the DDR SDRAM group; further, the data processing apparatus is configured according to the first The buffer usage of each bank in the target DDR SDRAM determines the first target bank. At this time, the first target bank is the bank in the first target DDR SDRAM.
步骤404:所述数据处理装置根据所述第一目标DDR SDRAM以及所述第一目标Bank对应的地址信息确定出写入地址信息;Step 404: The data processing apparatus determines, according to the first target DDR SDRAM and address information corresponding to the first target bank, write address information.
步骤405:所述数据处理装置将所述写入地址信息发送至DDR控制器中,通过所述DDR控制器将所述第一报文中的一个或多个第一分片写入所述写入地址信息对应的第一目标DDR SDRAM的第一目标Bank中; Step 405: The data processing apparatus sends the write address information to a DDR controller, and writes one or more first fragments in the first packet to the write by using the DDR controller. Entering the first target bank of the first target DDR SDRAM corresponding to the address information;
步骤406:当所述第一报文按照所述写入地址信息写入所述DDR SDRAM组后,所述DDR控制器触发所述数据处理装置根据确定出的所述第一目标DDR SDRAM以及所述第一目标Bank,调整所述第一目标DDR SDRAM对应的缓存使用量,以及调整所述第一目标Bank对应的缓存使用量;Step 406: After the first message is written into the DDR SDRAM group according to the write address information, the DDR controller triggers the data processing device to determine the first target DDR SDRAM and the a first target bank, adjusting a cache usage amount corresponding to the first target DDR SDRAM, and adjusting a cache usage amount corresponding to the first target bank;
本领域技术人员应该理解,在实际应用中,所述数据处理装置确定出的第一目标DDR SDRAM可以具体为目标DDR SDRAM对应的标识号,称为DDR SDRAM号;同理,所述数据处理装置确定出的第一目标Bank也可以具体为目标Bank对应的标识号,称为Bank号;如此,所述数据处理装置通过DDR SDRAM号确定出第一目标DDR SDRAM,通过Bank号在所述第一目标DDR SDRAM中确定出第一目标Bank。It should be understood by those skilled in the art that, in practical applications, the first target DDR SDRAM determined by the data processing device may be specifically an identification number corresponding to the target DDR SDRAM, which is called a DDR SDRAM number; similarly, the data processing device The first target bank that is determined may also be specifically an identification number corresponding to the target bank, which is called a bank number; thus, the data processing device determines the first target DDR SDRAM by using the DDR SDRAM number, and the first number is obtained by the Bank number. The first target bank is determined in the target DDR SDRAM.
以上步骤即为报文的写入步骤;在本实施例中,所有的报文数据都是遵循先写入,即步骤401至步骤406的过程,再读出,即步骤407至步骤409。The above steps are the steps of writing the message; in this embodiment, all the message data are followed by the first write, that is, the process from step 401 to step 406, and then read, that is, steps 407 to 409.
步骤407:当所述第一报文需要被读出时,所述数据处理装置接收到所述DDR控制器发送的读出地址信息,解析所述读出地址信息,并根据解析结果获取与所述读出地址信息对应的第二目标DDR SDRAM,以及所述第二目标DDR SDRAM对应的第二目标Bank;Step 407: When the first message needs to be read, the data processing device receives the read address information sent by the DDR controller, parses the read address information, and obtains the information according to the analysis result. a second target DDR SDRAM corresponding to the read address information, and a second target bank corresponding to the second target DDR SDRAM;
本实施例中,由于被读出的是也是第一报文,而所述第一报文是根据所述写入地址信息写入DDR SDRAM组中的,所以所述读出地址信息与所述写入地址信息相同;所述第二目标DDR SDRAM与所述第一目标DDR SDRAM相同,所述第二目标Bank与所述第一目标Bank相同。In this embodiment, since the read message is also the first message, and the first message is written into the DDR SDRAM group according to the write address information, the read address information and the The write address information is the same; the second target DDR SDRAM is the same as the first target DDR SDRAM, and the second target bank is the same as the first target bank.
步骤408:所述DDR控制器根据所述读出地址信息从所述DDR SDRAM组中读出各第一分片,并将各第一分片组合成完整的第一报文,输出所述第一报文; Step 408: The DDR controller reads each first fragment from the DDR SDRAM group according to the read address information, and combines each first fragment into a complete first packet, and outputs the first a message;
在一具体实施例中,所述数据处理装置将自身确定出的所述第二目标DDR SDRAM以及所述第二目标Bank发送至所述DDR控制器中,进而使得所述DDR控制器根据所述第二目标DDR SDRAM以及所述第二目标Bank读出各第一分片,并将各第一分片组合成完整的第一报文,以输出所述第一报文。In a specific embodiment, the data processing device sends the second target DDR SDRAM and the second target bank determined by itself to the DDR controller, thereby causing the DDR controller to be The second target DDR SDRAM and the second target bank read out the first fragments, and combine the first fragments into a complete first message to output the first message.
步骤409:当确定所述第一报文被读出后,所述DDR控制器触发所述数据处理装置根据与所述读出地址信息对应的第二目标DDR SDRAM,以及所述第二目标DDR SDRAM对应的第二目标Bank,调整所述第二目标DDR SDRAM对应的缓存使用量,以及调整所述第二目标Bank对应的缓存使用量,以释放与所述读地址信息对应的缓存空间。Step 409: After determining that the first message is read, the DDR controller triggers the data processing device to use the second target DDR SDRAM corresponding to the read address information, and the second target DDR. The second target bank corresponding to the SDRAM adjusts a cache usage amount corresponding to the second target DDR SDRAM, and adjusts a cache usage amount corresponding to the second target bank to release a cache space corresponding to the read address information.
这样,当再有报文预写入DDR SDRAM组时,能够使所述数据处理装置获取到所述DDR SDRAM组中的每一组DDR SDRAM的最新的缓存使用量,以及每一组DDR SDRAM中的每一个Bank的最新的缓存使用量,并根据最新的缓存使用量确定出与当前缓存使用量相匹配的新的写入地址信息,如此,最大化地、平均地使用每组DDR SDRAM,以及每组DDR SDRAM中的每个Bank,进而提高DDR SDRAM组的缓存利用率,提高DDR SDRAM组的读写效率。In this way, when the message is pre-written into the DDR SDRAM group, the data processing device can obtain the latest cache usage of each group of DDR SDRAMs in the DDR SDRAM group, and each group of DDR SDRAMs. The latest cache usage of each bank, and based on the latest cache usage, determine the new write address information that matches the current cache usage, thus maximizing the average use of each set of DDR SDRAM, and Each bank in each group of DDR SDRAMs improves the cache utilization of the DDR SDRAM group and improves the read and write efficiency of the DDR SDRAM group.
为实现实施例二所述的数据处理方法,本发明实施例还提供了一种数据处理装置,如图7所示,所述数据处理装置包括:In order to implement the data processing method of the second embodiment, the embodiment of the present invention further provides a data processing apparatus. As shown in FIG. 7, the data processing apparatus includes:
包处理模块71,配置为接收DDR控制器发送的一个或多个第一分片;还配置为将一个或多个第一分片发送至DDR处理模块和Bank处理模块;The packet processing module 71 is configured to receive one or more first fragments sent by the DDR controller, and is further configured to send the one or more first fragments to the DDR processing module and the bank processing module;
还配置为获取与所述读出地址信息对应的第二目标存储器以及获取所述第二目标存储器中的第二目标存储体;具体地,所述包处理模块71还配置为获取与读出地址信息对应的第二目标存储器的DDR SDRAM号,以及获取与读出地址信息对应的第二目标存储体的Bank号。 And configured to acquire a second target storage corresponding to the read address information and acquire a second target storage in the second target storage; specifically, the packet processing module 71 is further configured to acquire and read an address. The DDR SDRAM number of the second target memory corresponding to the information, and the Bank number of the second target bank corresponding to the read address information.
DDR处理模块72,配置为接收所述包处理模块71发送的一个或多个第一分片,并触发自身统计DDR SDRAM组中的每一组DDR SDRAM的缓存使用量,并根据预设规则确定出所述一个或多个第一分片对应的第一目标DDR SDRAM,进而将确定出的第一目标DDR SDRAM发送至地址模块;The DDR processing module 72 is configured to receive one or more first fragments sent by the packet processing module 71, and trigger the self-stated cache usage of each group of DDR SDRAMs in the DDR SDRAM group, and determine according to a preset rule. And outputting the first target DDR SDRAM corresponding to the one or more first fragments, and then sending the determined first target DDR SDRAM to the address module;
还配置为当第一报文写入所述DDR SDRAM组时,调整与所述写入地址信息对应的所述第一目标DDR SDRAM的缓存使用量,具体地增加所述第一目标DDR SDRAM对应的缓存使用量;还配置为当第二报文被读出所述DDR SDRAM组时,调整与所述读出地址信息对应的所述第二目标DDR SDRAM的缓存使用量,具体地减少与所述读出地址信息对应的所述第二目标DDR SDRAM的缓存使用量。And configuring, when the first message is written into the DDR SDRAM group, adjusting a cache usage amount of the first target DDR SDRAM corresponding to the write address information, specifically increasing the first target DDR SDRAM corresponding Cache usage; configured to adjust a buffer usage of the second target DDR SDRAM corresponding to the read address information when the second message is read out of the DDR SDRAM group, specifically reducing The buffer usage amount of the second target DDR SDRAM corresponding to the address information is read.
在一具体实施例中,如图8所示,所述DDR处理模块72包括:DDR统计子模块721、DDR选择概率子模块722和DDR综合判断子模块723;DDR统计子模块和DDR选择概率子模块的个数均与DDR SDRAM的组数相对应;具体地,In a specific embodiment, as shown in FIG. 8, the DDR processing module 72 includes: a DDR statistics sub-module 721, a DDR selection probability sub-module 722, and a DDR synthesis judging sub-module 723; a DDR statistical sub-module and a DDR selection probability sub- The number of modules corresponds to the number of groups of DDR SDRAM; specifically,
DDR统计子模块721,配置为跟踪并统计DDR SDRAM组中的每一组DDR SDRAM的缓存使用量;这里,在一优选实施例中,有几组DDR SDRAM,就需要几个DDR统计子模块;每一个DDR统计子模块721配置为跟踪并统计DDR SDRAM组中的某一组DDR SDRAM的缓存使用量;进而通过多组DDR统计子模块721跟踪并统计DDR SDRAM组中的所有DDR SDRAM的缓存使用量;进一步地,DDR统计子模块还配置为当第一报文写入所述DDR SDRAM组时,调整与所述写入地址信息对应的所述第一目标DDR SDRAM的缓存使用量,具体地增加所述第一目标DDR SDRAM对应的缓存使用量;还配置为当第二报文被读出所述DDR SDRAM组时,调整与所述读出地址信息对应的所述第二目标DDR SDRAM的缓存使用量,具体地减少与所述读出地址信息对应的所述第二目标DDR  SDRAM的缓存使用量。The DDR statistics sub-module 721 is configured to track and count the cache usage of each group of DDR SDRAMs in the DDR SDRAM group; here, in a preferred embodiment, there are several sets of DDR SDRAMs, and several DDR statistical sub-modules are required; Each DDR statistic sub-module 721 is configured to track and count the cache usage of a certain group of DDR SDRAMs in the DDR SDRAM group; and then track and count the cache usage of all DDR SDRAMs in the DDR SDRAM group through the plurality of sets of DDR statistic sub-modules 721. Further, the DDR statistics sub-module is further configured to: when the first message is written into the DDR SDRAM group, adjust a buffer usage of the first target DDR SDRAM corresponding to the write address information, specifically And increasing a buffer usage amount corresponding to the first target DDR SDRAM; and configured to adjust the second target DDR SDRAM corresponding to the read address information when the second packet is read out of the DDR SDRAM group Cache usage, specifically reducing the second target DDR corresponding to the read address information SDRAM cache usage.
DDR选择概率子模块722,配置为根据DDR SDRAM组中的每一组DDR SDRAM的缓存使用量选取出概率曲线以及控制逻辑;还配置为根据DDR SDRAM组中的每一组DDR SDRAM的缓存使用量、概率曲线和控制逻辑确定出与每一组DDR SDRAM对应的概率值;还配置为根据与每一组DDR SDRAM对应的概率值以及控制逻辑确定出与该概率值对应的某一组DDR SDRAM是否被选中;具体地,某一组DDR SDRAM的缓存使用量越大,被选中的概率越小;在一优选实施例中,DDR选择概率子模块722与DDR统计子模块721一一对应,也就是说,每个DDR选择概率子模块722与DDR统计子模块721均对应一个DDR SDRAM组,且每组DDR SDRAM对应一个概率曲线。这里,DDR选择概率子模块只在分片输入时起作用,分片输出时无效;也就是说,当第一数据写入所述DDR SDRAM组时,DDR选择概率子模块起作用;当所述第二数据被读出所述DDR SDRAM组时,DDR选择概率子模块不起作用。The DDR selection probability sub-module 722 is configured to select a probability curve and control logic according to the buffer usage of each group of DDR SDRAMs in the DDR SDRAM group; and configured to use the buffer usage of each group of DDR SDRAMs in the DDR SDRAM group. a probability curve and control logic determining a probability value corresponding to each set of DDR SDRAMs; further configured to determine whether a certain set of DDR SDRAMs corresponding to the probability values are based on probability values corresponding to each set of DDR SDRAMs and control logic Specifically, the larger the cache usage of a certain group of DDR SDRAMs, the smaller the probability of being selected; in a preferred embodiment, the DDR selection probability sub-module 722 has a one-to-one correspondence with the DDR statistics sub-module 721, that is, Each DDR selection probability sub-module 722 and DDR statistical sub-module 721 corresponds to one DDR SDRAM group, and each set of DDR SDRAM corresponds to a probability curve. Here, the DDR selection probability sub-module only functions at the slice input, and is invalid when the slice is output; that is, when the first data is written into the DDR SDRAM group, the DDR selection probability sub-module functions; When the second data is read out of the DDR SDRAM group, the DDR selection probability sub-module does not function.
DDR综合判断子模块723,配置为根据DDR选择概率子模块输出的表示本组DDR SDRAM是否被选中的信息及自身的判断逻辑选择出第一目标DDR SDRAM;具体地,选择出第一目标DDR SDRAM对应的DDR SDRAM号;还配置为将所述第一目标DDR SDRAM发送至Bank处理模块和地址模块;具体地,将所述第一目标DDR SDRAM对应的DDR SDRAM号发送至Bank处理模块和地址模块;在一优选实施例中,所述DDR综合判断子模块723仅设置有一个,也就是说,多个DDR选择概率子模块722与多个DDR统计子模块721对应一个DDR综合判断子模块723。这里,所述DDR综合判断子模块只在分片输入时起作用,分片输出时无效;也就是说,当第一数据写入所述DDR SDRAM组时,所述DDR综合判断子模块起作用;当所述第二数据被读出所述DDR SDRAM组时,所述DDR综合判断子模 块不起作用。The DDR comprehensive judgment sub-module 723 is configured to select the first target DDR SDRAM according to the information indicating whether the DDR SDRAM of the group is selected and the judgment logic of the DDR selection probability sub-module output; specifically, selecting the first target DDR SDRAM Corresponding DDR SDRAM number; configured to send the first target DDR SDRAM to the bank processing module and the address module; specifically, send the DDR SDRAM number corresponding to the first target DDR SDRAM to the bank processing module and the address module In a preferred embodiment, the DDR comprehensive judgment sub-module 723 is only provided with one, that is, the plurality of DDR selection probability sub-modules 722 and the plurality of DDR statistical sub-modules 721 correspond to one DDR comprehensive judgment sub-module 723. Here, the DDR integrated judgment sub-module functions only at the time of slice input, and is invalid when the slice is output; that is, when the first data is written into the DDR SDRAM group, the DDR integrated judgment sub-module functions. When the second data is read out of the DDR SDRAM group, the DDR comprehensive judgment submodule The block does not work.
在一具体实施例中,若存在多组DDR SDRAM被选中的情况,则结合当前被选中的DDR SDRAM号,并根据某种选择算法进行处理,进而确定出唯一的第一目标DDR SDRAM,并将确定的唯一的第一目标DDR SDRAM发送至Bank处理模块和地址模块;例如,确定出唯一的第一目标DDR SDRAM对应的DDR SDRAM号,并将唯一的第一目标DDR SDRAM对应的DDR SDRAM号发送至Bank处理模块和地址模块。这里,所述选择算法可以是轮询调度(RR)算法、拥塞管理算法(WFQ)等。In a specific embodiment, if there are multiple sets of DDR SDRAMs selected, the currently selected DDR SDRAM numbers are combined and processed according to a selection algorithm to determine a unique first target DDR SDRAM, and The determined first target DDR SDRAM is sent to the bank processing module and the address module; for example, determining the DDR SDRAM number corresponding to the unique first target DDR SDRAM, and transmitting the DDR SDRAM number corresponding to the unique first target DDR SDRAM To the bank processing module and address module. Here, the selection algorithm may be a polling scheduling (RR) algorithm, a congestion management algorithm (WFQ), or the like.
所述Bank处理模块73,配置为接收所述包处理模块71发送的一个或多个第一分片,并触发自身跟踪并统计DDR SDRAM组中的每一个Bank的缓存使用量;还配置为接收所述第一目标DDR SDRAM,并根据预设规则在所述第一目标DDR SDRAM中确定出与所述一个或多个第一分片对应的第一目标Bank,进而将所述第一目标Bank发送至地址模块;The bank processing module 73 is configured to receive one or more first fragments sent by the packet processing module 71, and trigger itself to track and count the buffer usage of each bank in the DDR SDRAM group; Determining, by the first target DDR SDRAM, a first target bank corresponding to the one or more first fragments in the first target DDR SDRAM according to a preset rule, and further, the first target bank Send to the address module;
还配置为当第一报文写入所述DDR SDRAM组时,调整与所述写入地址信息对应的所述第一目标Bank的缓存使用量,具体地增加所述第一目标Bank对应的缓存使用量;还配置为当第二报文被读出所述DDR SDRAM组时,调整与所述读出地址信息对应的所述第二目标Bank的缓存使用量,具体地减少与所述读出地址信息对应的所述第二目标Bank的缓存使用量。And configuring, when the first packet is written into the DDR SDRAM group, adjusting a cache usage of the first target bank corresponding to the write address information, specifically increasing a cache corresponding to the first target bank. The usage amount is further configured to: when the second message is read out of the DDR SDRAM group, adjust a buffer usage amount of the second target bank corresponding to the read address information, specifically reduce the readout The cache usage of the second target bank corresponding to the address information.
在一具体实施例中,所述Bank处理模块73包括:Bank统计子模块731、Bank选择概率子模块732、Bank综合判断子模块733以及多路选择子模块(MUX)734;在一优选实施例中,如图8所示,每一个Bank对应一个Bank统计子模块731、Bank选择概率子模块732;但是,每组DDR SDRAM中的一个若多个Bank对应的Bank统计子模块731、Bank选择概率子模块732被绑定成一组;每一组DDR SDRAM中的所有Bank对应一个Bank综合判断子模块,所有的Bank综合判断子模块对应一个多路选择子模块734;具 体地,In a specific embodiment, the bank processing module 73 includes: a bank statistics sub-module 731, a bank selection probability sub-module 732, a bank comprehensive judgment sub-module 733, and a multi-path selection sub-module (MUX) 734; As shown in FIG. 8, each bank corresponds to a Bank statistical sub-module 731 and a Bank selection probability sub-module 732; however, if one bank of each group of DDR SDRAMs has a bank corresponding to the Bank statistical sub-module 731, Bank selection probability The sub-module 732 is bound into a group; all the banks in each group of DDR SDRAM correspond to one bank comprehensive judgment sub-module, and all the bank comprehensive judgment sub-modules correspond to one multi-path selection sub-module 734; Body,
Bank统计子模块731,配置为跟踪并统计DDR SDRAM组中的每一Bank的缓存使用量;进一步地,还配置为当第一报文写入所述DDR SDRAM组时,调整与所述写入地址信息对应的所述第一目标Bank的缓存使用量,具体地增加所述第一目标Bank对应的缓存使用量;还配置为当第二报文被读出所述DDR SDRAM组时,调整与所述读出地址信息对应的所述第二目标Bank的缓存使用量,具体地减少与所述读出地址信息对应的所述第二目标Bank的缓存使用量。The Bank Statistics sub-module 731 is configured to track and count the buffer usage of each bank in the DDR SDRAM group; further, to be configured to adjust and write the first message when the first message is written to the DDR SDRAM group The buffer usage of the first target bank corresponding to the address information, specifically increasing the buffer usage amount corresponding to the first target bank; and further configured to adjust when the second packet is read out of the DDR SDRAM group The buffer usage amount of the second target bank corresponding to the read address information specifically reduces the buffer usage amount of the second target bank corresponding to the read address information.
这里,在实际应用中,所用DDR SDRAM组数的不同,以及每组DDR SDRAM中的Bank的个数不同,Bank统计子模块和Bank选择概率子模块的个数不一样。以Bank统计子模块为例,Bank选择概率子模块与Bank统计子模块相似;假设系统使用了8组DDR SDRAM,每组DDR SDRAM有8个Bank,则一共需要64个Bank统计子模块。但是64个Bank统计子模块不是完全独立的,而是每8个Bank统计模块被绑定成一组,对应一组DDR SDRAM。在实际应用中,每写入一个第一分片时,第一分片所属Bank的缓存使用量增加1;相反地,分片输出时,分片所属Bank的使用量减去1。Here, in practical applications, the number of DDR SDRAM groups used is different, and the number of banks in each group of DDR SDRAM is different, and the number of Bank statistical sub-modules and Bank selection probability sub-modules are different. Taking the Bank statistical sub-module as an example, the Bank selection probability sub-module is similar to the Bank statistical sub-module; assuming that the system uses 8 sets of DDR SDRAM, each group of DDR SDRAM has 8 banks, then a total of 64 Bank statistical sub-modules are needed. However, the 64 Bank statistical sub-modules are not completely independent, but each 8 bank statistics modules are bound into a group, corresponding to a group of DDR SDRAM. In practical applications, each time a first fragment is written, the buffer usage of the bank to which the first fragment belongs is increased by one; conversely, when the fragment is output, the usage of the bank to which the fragment belongs is subtracted by one.
Bank选择概率子模块732,配置为根据DDR SDRAM组中的每一Bank的缓存使用量选取概率曲线;还配置为根据每一Bank的缓存使用量,以及概率曲线确定出每一Bank对应的概率值;还配置为根据每一Bank对应的概率值确定出与该概率值对应的某一Bank是否被选中;具体地,某一组Bank的缓存使用量越大,被选中的概率越小;这里,Bank选择概率子模块只在分片输入时起作用,分片输出时无效;也就是说,当第一数据写入所述DDR SDRAM组时,Bank选择概率子模块起作用;当所述第二数据被读出所述DDR SDRAM组时,Bank选择概率子模块不起作用。在一具体实施 例中,每个Bank或每组DDR SDRAM或所有组DDR SDRAM对应一个概率曲线。The Bank selection probability sub-module 732 is configured to select a probability curve according to the buffer usage of each bank in the DDR SDRAM group; and is further configured to determine a probability value corresponding to each bank according to the buffer usage of each bank and the probability curve. And configured to determine, according to the probability value corresponding to each bank, whether a certain bank corresponding to the probability value is selected; specifically, the larger the buffer usage of a certain group of banks, the smaller the probability of being selected; here, The Bank Select Probability sub-module only works when the slice is input, and is invalid when the slice is output; that is, when the first data is written into the DDR SDRAM group, the Bank Select Probability sub-module functions; when the second When the data is read out of the DDR SDRAM group, the Bank Selection Probability sub-module does not work. In a specific implementation In the example, each bank or each group of DDR SDRAM or all groups of DDR SDRAM corresponds to a probability curve.
Bank综合判断子模块733,配置为根据Bank选择概率子模块输出的表示本Bank是否被选中的信息以及自身的判断逻辑确定出第一疑似目标Bank;还配置为将确定出的第一疑似目标Bank发送至多路选择子模块734;这里,Bank综合判断子模块只在分片输入时起作用,分片输出时无效;也就是说,当第一数据写入所述DDR SDRAM组时,Bank综合判断子模块起作用;当所述第二数据被读出所述DDR SDRAM组时,Bank综合判断子模块不起作用。The Bank comprehensive judgment sub-module 733 is configured to determine, according to the information indicating whether the Bank is selected by the Bank selection probability sub-module and its own judgment logic, to determine the first suspect target bank; and to configure the first suspect target bank to be determined. Send to the multiplex selection sub-module 734; here, the Bank comprehensive judgment sub-module only works when the slice input is performed, and is invalid when the slice output is output; that is, when the first data is written into the DDR SDRAM group, the Bank comprehensively judges The sub-module functions; when the second data is read out of the DDR SDRAM group, the Bank comprehensive judgment sub-module does not function.
多路选择子模块734,配置为接收所述第一目标DDR SDRAM以及第一疑似目标Bank;还配置为根据接收到的第一疑似目标Bank,以及所述第一目标DDR SDRAM,在所述第一目标DDR SDRAM中确定出第一目标Bank;具体地,在所述第一目标DDR SDRAM中确定出第一目标Bank对应的Bank号;还配置为将所述第一目标Bank发送至地址模块。a multiplex selection sub-module 734 configured to receive the first target DDR SDRAM and the first suspected target bank; further configured to receive, according to the received first suspect target bank, the first target DDR SDRAM Determining a first target bank in a target DDR SDRAM; specifically, determining a bank number corresponding to the first target bank in the first target DDR SDRAM; and configured to send the first target bank to the address module.
在一具体实施例中,Bank综合判断子模块接收输入的属于一组DDR SDRAM的多个Bank的信息,结合上次被选中的Bank对应的信息,根据某个选择算法,比如RR轮询、WFQ等,确定当前被选中的Bank号,也即第一疑似目标Bank对应的Bank号。如果存在多组DDR SDRAM,就会有对应的多个Bank号。此时,将多个Bank号,也即多个第一疑似目标Bank对应的Bank号发送至多路选择子模块;进而使所述多路选择子模块需要根据DDR处理模块输出的第一目标DDR SDRAM对应的DDR SDRAM号,在所述第一目标DDR SDRAM中确定出第一目标Bank对应的Bank号。In a specific embodiment, the Bank comprehensive judgment sub-module receives the input information of a plurality of banks belonging to a group of DDR SDRAMs, and combines the information corresponding to the last selected bank according to a selection algorithm, such as RR polling, WFQ. Etc., determine the currently selected bank number, that is, the bank number corresponding to the first suspected target bank. If there are multiple sets of DDR SDRAM, there will be a corresponding number of Bank numbers. At this time, a plurality of Bank numbers, that is, a bank number corresponding to the plurality of first suspect target banks are sent to the multiplex selection sub-module; and then the multiplex selection sub-module needs to output the first target DDR SDRAM according to the DDR processing module. Corresponding DDR SDRAM number, the bank number corresponding to the first target bank is determined in the first target DDR SDRAM.
所述地址模块74,配置为接收第一目标DDR SDRAM,以及所述第一目标DDR SDRAM中的第一目标Bank,并根据所述第一目标DDR SDRAM以及所述第一目标Bank确定出写入地址信息;还配置为将所述写入地址信 息发送至DDR控制模块。The address module 74 is configured to receive the first target DDR SDRAM, and the first target bank in the first target DDR SDRAM, and determine the write according to the first target DDR SDRAM and the first target bank. Address information; also configured to write the address address The information is sent to the DDR control module.
在实际应用中,所述包处理模块71、DDR处理模块72、Bank处理模块73以及地址模块74均可由中央处理单元(CPU,Central Processing Unit)、或数字信号处理(DSP,Digital Signal Processor)、或现场可编程门阵列(FPGA,Field Programmable Gate Array)等来实现;所述CPU、DSP、FPGA均可内置于数据处理装置中。In practical applications, the packet processing module 71, the DDR processing module 72, the bank processing module 73, and the address module 74 may each be a central processing unit (CPU) or a digital signal processor (DSP). Or a Field Programmable Gate Array (FPGA), etc.; the CPU, DSP, and FPGA can be built in the data processing apparatus.
本发明实施例所述的数据处理方法及装置,能够最大化平均地利用缓存空间,避免了过度使用或过少使用某组或某些DDR SDRAM,以及DDR SDRAM中某个或某些Bank的情况;同时,还能够尽可能地平均使用各组DDR SDRAM及DDR SDRAM中的每个Bank,进而隐藏预充电时间和激活时间,避免了同Bank换行导致的读写效率下降的问题。The data processing method and apparatus according to the embodiments of the present invention can maximize the average utilization of the cache space, and avoid excessive use or under-use of a certain group or some DDR SDRAMs, and the case of one or some banks in the DDR SDRAM. At the same time, it is also possible to use each bank of each group of DDR SDRAM and DDR SDRAM as much as possible, thereby hiding the pre-charging time and activation time, and avoiding the problem of the drop in read and write efficiency caused by bank line-changing.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理 设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a bootable computer or other programmable data processing The apparatus is readable in a computer readable memory in a particular manner such that instructions stored in the computer readable memory produce an article of manufacture comprising instruction means implemented in one or more flows and/or block diagrams of the flowchart The function specified in the box or in multiple boxes.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
以上所述仅是本发明实施例的实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明实施例原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明实施例的保护范围。The above is only an embodiment of the embodiments of the present invention, and it should be noted that those skilled in the art can make some improvements and refinements without departing from the principles of the embodiments of the present invention. Retouching should also be considered as the scope of protection of the embodiments of the present invention.
工业实用性Industrial applicability
本发明实施例能够根据数据的存储变化情况调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数,进而最大化地平均地使用每组存储器,以及每组存储器中的存储体,提高了存储器的利用率,同时提升了存储器的读写效率。 The embodiment of the present invention can adjust the first cache feature parameter corresponding to the memory according to the storage change of the data, and adjust the second cache feature parameter corresponding to the storage body, thereby maximizing the average use of each set of memory, and each set of memory The memory bank improves the utilization of the memory and improves the read and write efficiency of the memory.

Claims (11)

  1. 一种数据处理方法,包括:A data processing method comprising:
    获取至少一个存储器对应的第一缓存特征参数;Obtaining a first cache feature parameter corresponding to the at least one memory;
    获取至少一个存储体对应的第二缓存特征参数;所述至少一个存储体设置于所述至少一个存储器中;Obtaining a second cache feature parameter corresponding to the at least one bank; the at least one bank is disposed in the at least one memory;
    当确定存在第一数据写入所述至少一个存储器中的至少一个存储体中时,根据写入地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数;When it is determined that the first data is written into the at least one of the at least one memory, the first cache feature parameter corresponding to the memory is adjusted according to the write address information, and the second cache feature parameter corresponding to the bank is adjusted;
    当确定存在第二数据被读出所述至少一个存储器中的至少一个存储体中时,根据读出地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数。When it is determined that the second data is read out of the at least one of the at least one memory, the first cache feature parameter corresponding to the memory is adjusted according to the read address information, and the second cache feature parameter corresponding to the bank is adjusted.
  2. 根据权利要求1所述的方法,其中,所述方法还包括:The method of claim 1 wherein the method further comprises:
    根据所述至少一个存储器对应的第一缓存特征参数确定出第一目标存储器;Determining a first target memory according to the first cache feature parameter corresponding to the at least one memory;
    根据至少一个存储体对应的第二缓存特征参数确定出第一目标存储体;所述第一目标存储体设置于所述第一目标存储器中;Determining, according to the second cache feature parameter corresponding to the at least one storage body, the first target storage body; the first target storage body being disposed in the first target storage;
    根据所述第一目标存储器和所述第一目标存储体对应的地址信息确定出所述写入地址信息,以便于将所述第一数据存储于所述写入地址信息指示的第一目标存储器中的第一目标存储体中。Determining the write address information according to the address information corresponding to the first target memory and the first target storage body, so as to store the first data in the first target storage indicated by the write address information In the first target bank.
  3. 根据权利要求2所述的方法,其中,所述第一缓存特征参数和所述第二缓存特征参数均表征缓存使用量;对应地,The method of claim 2, wherein the first cache feature parameter and the second cache feature parameter both characterize a cache usage; correspondingly,
    所述根据写入地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数,包括:The adjusting the first cache feature parameter corresponding to the memory according to the write address information, and adjusting the second cache feature parameter corresponding to the storage body, includes:
    根据所述写入地址信息所指示的第一目标存储器,调小所述第一目标 存储器对应的缓存使用量;以及根据所述写入地址信息所指示的第一目标存储体,调小所述第一目标存储体对应的缓存使用量。Reducing the first target according to the first target memory indicated by the write address information a cache usage amount corresponding to the memory; and reducing a cache usage amount corresponding to the first target storage body according to the first target storage body indicated by the write address information.
  4. 根据权利要求1所述的方法,其中,所述方法还包括:The method of claim 1 wherein the method further comprises:
    接收所述读出地址信息;Receiving the read address information;
    获取所述读出地址信息所指示的第二目标存储器以及所述第二目标存储器中的第二目标存储体。And acquiring a second target storage indicated by the read address information and a second target storage in the second target storage.
  5. 根据权利要求4所述的方法,其中,所述第一缓存特征参数和所述第二缓存特征参数均表征缓存使用量;对应地,The method of claim 4, wherein the first cache feature parameter and the second cache feature parameter both characterize a cache usage; correspondingly,
    所述根据读出地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数,包括:The adjusting the first cache feature parameter corresponding to the memory according to the read address information, and adjusting the second cache feature parameter corresponding to the storage body, includes:
    根据所述读出地址信息所指示的第二目标存储器,调大所述第二目标存储器对应的缓存使用量;以及根据所述读出地址信息所指示的第二目标存储体,调大所述第二目标存储体对应的缓存使用量。And increasing, according to the second target memory indicated by the read address information, a buffer usage amount corresponding to the second target memory; and increasing the size according to the second target storage body indicated by the read address information The cache usage corresponding to the second target bank.
  6. 一种数据处理装置,包括:A data processing device comprising:
    第一获取单元,配置为获取至少一个存储器对应的第一缓存特征参数;a first acquiring unit, configured to acquire a first cache feature parameter corresponding to the at least one memory;
    第二获取单元,配置为获取至少一个存储体对应的第二缓存特征参数;所述至少一个存储体设置于所述至少一个存储器中;a second acquiring unit, configured to acquire a second cache feature parameter corresponding to the at least one bank; the at least one bank is disposed in the at least one memory;
    调整单元,配置为当确定存在第一数据写入所述至少一个存储器中的至少一个存储体中时,根据写入地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数;The adjusting unit is configured to: when it is determined that the first data is written into the at least one of the at least one memory, adjust the first cache feature parameter corresponding to the memory according to the write address information, and adjust the second corresponding to the storage body Cache feature parameters;
    还配置为当确定存在第二数据被读出所述至少一个存储器中的至少一个存储体中时,根据读出地址信息调整存储器对应的第一缓存特征参数,以及调整存储体对应的第二缓存特征参数。And configured to: when it is determined that the second data is read out of the at least one of the at least one memory, adjust the first cache feature parameter corresponding to the memory according to the read address information, and adjust the second cache corresponding to the bank Characteristic Parameters.
  7. 根据权利要求6所述的数据处理装置,其中,所述数据处理装置还包括: The data processing device of claim 6, wherein the data processing device further comprises:
    第一确定单元,配置为根据所述至少一个存储器对应的第一缓存特征参数确定出第一目标存储器;a first determining unit, configured to determine a first target memory according to the first cache feature parameter corresponding to the at least one memory;
    第二确定单元,配置为根据至少一个存储体对应的第二缓存特征参数确定出第一目标存储体;所述第一目标存储体设置于所述第一目标存储器中;a second determining unit, configured to determine a first target storage body according to a second cache feature parameter corresponding to the at least one storage body; the first target storage body is disposed in the first target storage;
    第三确定单元,配置为根据所述第一目标存储器和所述第一目标存储体对应的地址信息确定出所述写入地址信息,以便于将所述第一数据存储于所述写入地址信息指示的第一目标存储器中的第一目标存储体中。a third determining unit, configured to determine the write address information according to the address information corresponding to the first target memory and the first target storage body, so as to store the first data in the write address The first target storage in the first target memory indicated by the information.
  8. 根据权利要求7所述的数据处理装置,其中,所述第一缓存特征参数和所述第二缓存特征参数均表征缓存使用量;对应地,The data processing apparatus according to claim 7, wherein the first cache feature parameter and the second cache feature parameter both represent a cache usage amount; correspondingly,
    所述调整单元,还配置为根据所述写入地址信息所指示的第一目标存储器,调小所述第一目标存储器对应的缓存使用量;以及根据所述写入地址信息所指示的第一目标存储体,调小所述第一目标存储体对应的缓存使用量。The adjusting unit is further configured to: adjust, according to the first target memory indicated by the write address information, a buffer usage amount corresponding to the first target memory; and first, according to the write address information The target storage body reduces the cache usage amount corresponding to the first target storage body.
  9. 根据权利要求6所述的数据处理装置,其中,所述数据处理装置还包括:The data processing device of claim 6, wherein the data processing device further comprises:
    接收单元,配置为接收所述读出地址信息;a receiving unit configured to receive the read address information;
    处理单元,配置为获取所述读出地址信息所指示的第二目标存储器以及所述第二目标存储器中的第二目标存储体。And a processing unit configured to acquire the second target storage indicated by the read address information and the second target storage in the second target storage.
  10. 根据权利要求9所述的数据处理装置,其中,所述第一缓存特征参数和所述第二缓存特征参数均表征缓存使用量;对应地,The data processing apparatus according to claim 9, wherein the first cache feature parameter and the second cache feature parameter both represent a cache usage amount; correspondingly,
    所述调整单元,还配置为根据所述读出地址信息所指示的第二目标存储器,调大所述第二目标存储器对应的缓存使用量;以及根据所述读出地址信息所指示的第二目标存储体,调大所述第二目标存储体对应的缓存使用量。 The adjusting unit is further configured to increase a buffer usage amount corresponding to the second target memory according to the second target memory indicated by the read address information; and second according to the read address information The target storage body increases the cache usage amount corresponding to the second target storage medium.
  11. 一种计算机可读存储介质,该存储介质包括一组指令,所述指令用于执行权利要求1至5任一项所述的数据处理方法。 A computer readable storage medium comprising a set of instructions for performing the data processing method of any one of claims 1 to 5.
PCT/CN2016/081615 2015-07-15 2016-05-10 Data processing method and device, and storage medium WO2017008563A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510417343.2A CN106356088A (en) 2015-07-15 2015-07-15 Data processing method and device
CN201510417343.2 2015-07-15

Publications (1)

Publication Number Publication Date
WO2017008563A1 true WO2017008563A1 (en) 2017-01-19

Family

ID=57756801

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/081615 WO2017008563A1 (en) 2015-07-15 2016-05-10 Data processing method and device, and storage medium

Country Status (2)

Country Link
CN (1) CN106356088A (en)
WO (1) WO2017008563A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019095942A1 (en) * 2017-11-17 2019-05-23 华为技术有限公司 Data transmission method and communication device

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108959105B (en) * 2017-05-17 2023-12-22 深圳市中兴微电子技术有限公司 Method and device for realizing address mapping
CN111857817B (en) * 2019-04-25 2024-02-20 比亚迪半导体股份有限公司 Data reading method, data reading device and data reading system
CN117393013B (en) * 2023-12-09 2024-04-09 深圳星云智联科技有限公司 Efficient DDR control method and related device in statistical application

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6912616B2 (en) * 2002-11-12 2005-06-28 Hewlett-Packard Development Company, L.P. Mapping addresses to memory banks based on at least one mathematical relationship
CN102096562A (en) * 2011-02-12 2011-06-15 华为技术有限公司 Data writing method and device
CN103425437A (en) * 2012-05-25 2013-12-04 华为技术有限公司 Initial written address selection method and device
CN103605478A (en) * 2013-05-17 2014-02-26 华为技术有限公司 Memory address marking and collocation method and data access method and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009211735A (en) * 2008-02-29 2009-09-17 Toshiba Corp Nonvolatile memory device
JP2009259329A (en) * 2008-04-16 2009-11-05 Toshiba Corp Semiconductor integrated circuit device
CN102684976B (en) * 2011-03-10 2015-07-22 中兴通讯股份有限公司 Method, device and system for carrying out data reading and writing on basis of DDR SDRAN (Double Data Rate Synchronous Dynamic Random Access Memory)

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6912616B2 (en) * 2002-11-12 2005-06-28 Hewlett-Packard Development Company, L.P. Mapping addresses to memory banks based on at least one mathematical relationship
CN102096562A (en) * 2011-02-12 2011-06-15 华为技术有限公司 Data writing method and device
CN103425437A (en) * 2012-05-25 2013-12-04 华为技术有限公司 Initial written address selection method and device
CN103605478A (en) * 2013-05-17 2014-02-26 华为技术有限公司 Memory address marking and collocation method and data access method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019095942A1 (en) * 2017-11-17 2019-05-23 华为技术有限公司 Data transmission method and communication device
US11297011B2 (en) 2017-11-17 2022-04-05 Huawei Technologies Co., Ltd. Data transmission method and communications device

Also Published As

Publication number Publication date
CN106356088A (en) 2017-01-25

Similar Documents

Publication Publication Date Title
WO2017008563A1 (en) Data processing method and device, and storage medium
CN112511325B (en) Network congestion control method, node, system and storage medium
US10248350B2 (en) Queue management method and apparatus
EP3657744B1 (en) Message processing
US10135711B2 (en) Technologies for sideband performance tracing of network traffic
US20230164078A1 (en) Congestion Control Method and Apparatus
WO2018149102A1 (en) Method and device for reducing transmission latency of high-priority data, and storage medium
CN109660468B (en) Port congestion management method, device and equipment
US20230004321A1 (en) Storage device throttling amount of communicated data depending on suspension frequency of operation
US11134021B2 (en) Techniques for processor queue management
CN113411262A (en) Method and device for setting large receiving and unloading function
WO2016070668A1 (en) Method, device, and computer storage medium for implementing data format conversion
CN111181874B (en) Message processing method, device and storage medium
CN105335323A (en) Buffering device and method of data burst
TW201642140A (en) A packet memory system, method and device for preventing underrun
CN104486442A (en) Method and device for transmitting data of distributed storage system
US20190074029A1 (en) Voice data processing apparatus and voice data processing method for avoiding voice delay
US20230367735A1 (en) Data transmission method, module and apparatus, device, and storage medium
CN108763107B (en) Background disc writing flow control method and device, electronic equipment and storage medium
WO2022110681A1 (en) Returning method and returning control apparatus for command response information, and electronic device
CN105279136A (en) Method and system for real-time parallel frequency-domain analysis based on multichannel signals of multi-core DSP
CN102170401A (en) Method and device of data processing
US8345701B1 (en) Memory system for controlling distribution of packet data across a switch
WO2022174444A1 (en) Data stream transmission method and apparatus, and network device
US10474599B1 (en) Striped direct memory access circuit

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: 16823710

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: 16823710

Country of ref document: EP

Kind code of ref document: A1