CN117373501B - Statistical service execution rate improving method and related device - Google Patents
Statistical service execution rate improving method and related device Download PDFInfo
- Publication number
- CN117373501B CN117373501B CN202311678558.0A CN202311678558A CN117373501B CN 117373501 B CN117373501 B CN 117373501B CN 202311678558 A CN202311678558 A CN 202311678558A CN 117373501 B CN117373501 B CN 117373501B
- Authority
- CN
- China
- Prior art keywords
- ddr
- address
- data
- service
- writing
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 49
- 238000004590 computer program Methods 0.000 claims description 13
- 238000006243 chemical reaction Methods 0.000 description 8
- 238000004891 communication Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000001737 promoting effect Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000002093 peripheral effect Effects 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000005971 DNA damage repair Effects 0.000 description 1
- 102000002706 Discoidin Domain Receptors Human genes 0.000 description 1
- 108010043648 Discoidin Domain Receptors Proteins 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11C—STATIC STORES
- G11C7/00—Arrangements for writing information into, or reading information out from, a digital store
- G11C7/22—Read-write [R-W] timing or clocking circuits; Read-write [R-W] control signal generators or management
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11C—STATIC STORES
- G11C7/00—Arrangements for writing information into, or reading information out from, a digital store
- G11C7/10—Input/output [I/O] data interface arrangements, e.g. I/O data control circuits, I/O data buffers
- G11C7/1051—Data output circuits, e.g. read-out amplifiers, data output buffers, data output registers, data output level conversion circuits
- G11C7/1069—I/O lines read out arrangements
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11C—STATIC STORES
- G11C7/00—Arrangements for writing information into, or reading information out from, a digital store
- G11C7/10—Input/output [I/O] data interface arrangements, e.g. I/O data control circuits, I/O data buffers
- G11C7/1078—Data input circuits, e.g. write amplifiers, data input buffers, data input registers, data input level conversion circuits
- G11C7/1096—Write circuits, e.g. I/O line write drivers
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The application discloses a statistical service execution rate improving method and a related device, which are applied to electronic equipment, wherein the electronic equipment comprises DDR (double data rate), and the method comprises the following steps: when the service is the writing statistical service, the following steps S1-S4 are executed: s1, acquiring an input address, determining a storage address in the DDR corresponding to the input address, and executing a read operation on the storage address; s2, detecting whether the quantity of the returned DDR read data exceeds a preset threshold; s3, detecting whether the next service is the writing statistical service or not when the quantity of the returned DDR read data does not exceed the preset threshold value; and S4, executing the steps S1-S3 when the next service is the writing statistical service so as to realize continuous and repeated reading operation. By adopting the embodiment of the application, the execution rate of the writing statistical service can be improved.
Description
Technical Field
The application relates to the technical field of communication or the technical field of internet, in particular to a statistical service execution rate improving method and a related device.
Background
Currently, incoming traffic from an ethernet interface in a network device may come from multiple flows, and in order to monitor the traffic of each flow, statistics on the number of messages and bytes of each flow are necessary in the device. Since the number of flows supported by the network device is generally large (generally 1M and above), a Double Data Rate (DDR) device with a large capacity is selected as a storage device for the flow statistics of each flow in most cases. DDR requires that when accessing an address within it, the row corresponding to Bank is activated first, and then a read/write command is sent to a column in the row after waiting for tRCD time. If the read-write command is sent alternately, the tRCW needs to be kept between the read command and the write command, namely, the interval of read-write conversion time; the write command also needs to maintain tttr, i.e., the interval of write-read transition time, from the read command. Because the physical characteristics of DDR devices require that a fixed interval be maintained between the alternating transmission of read and write commands, which can slow down the execution rate of the write statistics service, the problem of how to increase the execution rate of the write statistics service needs to be solved.
Disclosure of Invention
The application provides a statistical service execution rate improving method and a related device, which can improve the execution rate of writing statistical service.
In a first aspect, the present application provides a method for improving a statistical service execution rate, which is applied to an electronic device, where the electronic device includes a DDR, and the method includes:
when the service is the writing statistical service, the following steps S1-S4 are executed:
s1, acquiring an input address, determining a storage address in the DDR corresponding to the input address, and executing a read operation on the storage address;
s2, detecting whether the quantity of the returned DDR read data exceeds a preset threshold;
s3, detecting whether the next service is the writing statistical service or not when the quantity of the returned DDR read data does not exceed the preset threshold value;
and S4, executing the steps S1-S3 when the next service is the writing statistical service so as to realize continuous and repeated reading operation.
In a second aspect, the present application provides a statistical service execution rate promotion device applied to an electronic device, where the electronic device includes a DDR, and the device includes: an execution unit, wherein,
the execution unit is configured to execute the following steps S1 to S4 when the current service is a write statistics service:
s1, acquiring an input address, determining a storage address in the DDR corresponding to the input address, and executing a read operation on the storage address;
s2, detecting whether the quantity of the returned DDR read data exceeds a preset threshold;
s3, detecting whether the next service is the writing statistical service or not when the quantity of the returned DDR read data does not exceed the preset threshold value;
and S4, executing the steps S1-S3 when the next service is the writing statistical service so as to realize continuous and repeated reading operation.
In a third aspect, the present application provides an electronic device comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps in the first aspect of the present application.
In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program causes a computer to perform part or all of the steps as described in the first aspect of the present application.
In a fifth aspect, the present application provides a computer program product, wherein the computer program product comprises a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform part or all of the steps as described in the first aspect of the present application. The computer program product may be a software installation package.
By implementing the application, the method has the following beneficial effects:
the statistical service execution rate lifting method and the related device described in the embodiment of the application are applied to electronic equipment, the electronic equipment comprises DDR, and when the service is a writing statistical service, the following steps S1-S4 are executed: s1, acquiring an input address, determining a storage address in the DDR corresponding to the input address, and executing a read operation on the storage address; s2, detecting whether the quantity of the returned DDR read data exceeds a preset threshold value; s3, when the number of the returned DDR read data does not exceed a preset threshold value, detecting whether the next service is a writing statistical service or not; and S4, when the next service is the writing statistics service, executing the steps S1-S3 to realize continuous and repeated reading operation, so that the writing operation can be continuously and repeatedly performed after the continuous and repeated reading operation is performed when the writing statistics is performed, the occurrence frequency of DDR reading-writing conversion time can be reduced to the greatest extent on the premise that the accuracy of the statistics data is ensured, the execution rate of the writing statistics service is improved, and the rate of the statistics service is also improved.
Drawings
In order to more clearly illustrate the technical solutions of the present application or the prior art, the following description will briefly introduce the drawings that are required to be used in the embodiments or the prior art descriptions, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a statistical service execution rate improving method provided in the present application;
fig. 2 is a flow chart of another statistical service execution rate promotion method provided in the present application;
FIG. 3 is a schematic illustration of a comparison between an input address and an address in a cache provided herein;
fig. 4 is a schematic structural diagram of an electronic device provided in the present application;
fig. 5 is a functional unit composition block diagram of a statistical service execution rate lifting device provided in the present application.
Detailed Description
In order that those skilled in the art will better understand the present application, a detailed description of the present application will be provided below, with reference to the accompanying drawings, wherein it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The terms first, second and the like in the description and in the claims of the present application and in the above-described figures, are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
In particular implementations, the electronic device referred to herein may include, but is not limited to: network devices, intelligent network cards, data processors (data processing unit, DPU), HOSTs (HOST), servers, high-speed serial computer expansion bus standard (peripheral component interconnect express, PCIE) devices. For example, the electronic device may include a host to which the DPU network card is plugged.
In this application, PCI, peripheral Component Interconnect, chinese means "peripheral device interconnect", a local parallel bus standard developed by PCISIG (PCI Special Interest Group). The PCI bus is a tree structure and is independent of the CPU bus and can operate in parallel with the CPU bus. PCI equipment and PCI bridge pieces can be hung on a PCI bus, only one PCI master equipment is allowed on the PCI bus, the other PCI slave equipment is all available, and the read-write operation can only be carried out between the master equipment and the slave equipment, and the data exchange between the slave equipment needs to be transferred through the master equipment.
Among them, PCI Express is derived from early PCI expansion and is largely distinguished from compatible PCI by parallel-to-serial switching and faster rates. PCI Express is a layered protocol consisting of a transaction layer, a data link layer, and a physical layer.
In this embodiment of the present application, banks may be understood as a memory Bank, that is, a memory block is internally divided into a plurality of memory banks, when a memory Bank number is specified during access, the specified memory Bank may be accessed, how many banks are divided in DDR, and if there are two bits in an address line, it is indicated that there are 4 banks, and if there are 3 bits, it is indicated that there are 8 banks.
In the embodiment of the present application, tRCD, RAS (Row Active) -to-CAS (Column Active) Delay, specifically refers to the Delay time for transmitting the row address to the column address.
In the present embodiment, wttr represents the write-to-read latency, the time that must be waited between the last valid write operation and the next read operation.
In the present embodiment, tRTW represents the read-to-write delay, the time that must be waited between the last valid read operation and the next write operation.
In the related art, when traffic of a certain flow is counted, information sent by a network device to a DDR controller is an increment of a statistic value. Therefore, the original statistic value needs to be read from the DDR equipment, the increment of the statistic value is increased on the basis, and finally the DDR equipment is written back, so that the write-once statistic service can be considered to be executed after the series of operations are completed. This is a read-write operation, as can be seen from the operation content. As described above, the physical characteristics of DDR devices require a fixed interval to be maintained between alternate transmissions of read and write commands, which can slow the execution rate of the write statistics traffic.
In order to solve the defects in the related art, the method for improving the statistical service execution rate is applied to electronic equipment, wherein the electronic equipment comprises DDR, and the following functions can be realized:
when the service is the writing statistical service, the following steps S1-S4 are executed:
s1, acquiring an input address, determining a storage address in the DDR corresponding to the input address, and executing a read operation on the storage address;
s2, detecting whether the quantity of the returned DDR read data exceeds a preset threshold;
s3, detecting whether the next service is the writing statistical service or not when the quantity of the returned DDR read data does not exceed the preset threshold value;
and S4, executing the steps S1-S3 when the next service is the writing statistical service so as to realize continuous and repeated reading operation.
The preset threshold may be preset or default.
The statistical service execution rate improving method described in the embodiment of the present application is applied to electronic equipment, where the electronic equipment includes a DDR, and when the current service is a write statistical service, the following steps S1 to S4 are executed: s1, acquiring an input address, determining a storage address in the DDR corresponding to the input address, and executing a read operation on the storage address; s2, detecting whether the quantity of the returned DDR read data exceeds a preset threshold value; s3, when the number of the returned DDR read data does not exceed a preset threshold value, detecting whether the next service is a writing statistical service or not; and S4, when the next service is the writing statistics service, executing the steps S1-S3 to realize continuous and repeated reading operation, so that the continuous and repeated reading operation can be performed when the writing statistics is executed, the occurrence frequency of DDR reading-writing conversion time can be reduced to the greatest extent on the premise of ensuring the accuracy of the statistics data, the execution rate of the writing statistics service is improved, and the rate of the statistics service is also improved.
In a specific implementation, the information of the next service can be prefetched, and the execution rate of the statistical service can be improved in a manner of executing the read operation and then executing the read operation continuously as possible.
The present application is described in detail below.
Referring to fig. 1, fig. 1 is a flow chart of a statistical service execution rate improving method provided in the present application, which is applied to an electronic device, where the electronic device includes a DDR, and as shown in the figure, the statistical service execution rate improving method includes:
s101, when the service is a writing statistical service, executing the following steps S1-S4:
s1, acquiring an input address, determining a storage address in the DDR corresponding to the input address, and executing a read operation on the storage address;
s2, detecting whether the quantity of the returned DDR read data exceeds a preset threshold;
s3, detecting whether the next service is the writing statistical service or not when the quantity of the returned DDR read data does not exceed the preset threshold value;
and S4, executing the steps S1-S3 when the next service is the writing statistical service so as to realize continuous and repeated reading operation.
In the embodiment of the present application, a service request of the present service may be obtained, and when the service request is a write operation request, it is indicated that the present service is a write statistics service, and the write operation request may carry an input address and a statistics value increment.
In the embodiment of the present application, the scheme of performing the read operation consecutively for a plurality of times in the embodiment of the present application may be implemented for one stream or for a plurality of streams.
In a specific implementation, when the service is a write statistics service, an input address and different input addresses can be obtained, the mapping relationship between the input address and the storage address of the DDR can be preset, and further, the storage address of the DDR corresponding to the input address can be determined based on the mapping relationship, and a read operation is performed on the storage address.
Then, whether the read data exceeding the preset number of DDRs is returned can be detected, when the number of the read data exceeding the preset threshold is not exceeded, whether the next service is the writing statistical service is detected, and when the next service is the writing statistical service, the steps S1-S3 can be repeatedly executed to realize continuous and repeated reading operation, so that the continuous and repeated writing operation can be carried out after the continuous and repeated reading operation is carried out when the writing statistics is executed, the occurrence frequency of the DDR reading-writing conversion time can be reduced to the greatest extent on the premise of ensuring the accuracy of the statistical data, the execution rate of the writing statistical service is improved, and the rate of the statistical service is also improved. Namely, on the premise of ensuring the accuracy of the statistical data, the reading operation and the writing operation in the statistical business reading and writing operation are continuously carried out.
Optionally, the method further comprises the following steps:
when the number of the returned DDR read data exceeds the preset threshold value, the data enters a writing state, and the accumulated data is completely written back to the DDR according to the reading sequence in the reading state so as to realize continuous and repeated writing operation.
In this embodiment of the present application, when the number of the returned DDR read data exceeds a preset threshold, a write state may be entered, and the accumulated data may be completely written back to the DDR according to the order of reading in the read state. Specifically, after the DDR read data is returned, the DDR read data is added with the statistics value increment sent by the user and is stored in a first-in first-out queue (First in First out, FIFO) until the DDR read data enters a writing state, so that the write operation is continuously performed for a plurality of times, namely, the final statistics value is written back to the DDR according to the reading sequence.
Optionally, the method further comprises the following steps:
and when the next service is not the writing statistical service, entering a waiting state, waiting until the data return quantity of the DDR exceeds the preset threshold, executing the step of entering a writing state when the data return quantity of the DDR exceeds the preset threshold, and completely writing the accumulated data back to the DDR according to the reading sequence in the reading state.
In this embodiment of the present application, when the next service is not a write statistics service, a waiting state may be entered, waiting until the number of data returned by the DDR exceeds a preset threshold, and executing the step of entering a write state when the number of data read by the DDR that has been returned exceeds the preset threshold, and fully writing the accumulated data back to the DDR according to the order of reading in the read state, that is, after the data read by the DDR returns to exceed the preset threshold, adding the accumulated data increment with the statistics value sent by the user and storing the added data increment in a first-in first-out queue until entering the write state, and writing the final statistics value back to the DDR according to the order of reading.
Optionally, the electronic device includes a cache, and the method further includes:
comparing the input address with addresses in a preset address set in the cache, wherein the preset address set comprises at least one address; when the input address is different from any one of the preset address sets, a read instruction corresponding to the input address is sent to the DDR, the input address is written into the preset address set, and the statistical increment value corresponding to the input address is written into a preset data set.
The preset address set may be stored in advance or default to the system. The set of preset addresses may include at least one address.
In this embodiment of the present application, the input address may be compared with an address in a preset address set in the cache, where the preset address set includes at least one address, and when the input address is different from any one address in the preset address set, a read command corresponding to the input address is sent to the DDR, and the input address is written into the preset address set, and the input statistical increment value is written into the preset data set.
Optionally, the method further comprises the following steps:
when the input address is the same as a target address in the preset address set, not sending the read command to the DDR, and inquiring target data in the preset data set corresponding to the target address, wherein the target address is any address in the preset address set; reading the target data; adding the target data to the statistical added value corresponding to the input address to obtain a target statistical added value; when the DDR data returns, the corresponding return data is added with the target statistical value obtained by the target statistical increment value and stored in a first-in first-out queue; in the write phase, the target statistics are written back to the DDR.
The preset data set may include at least one data, and each data may correspond to an address.
In this embodiment, when the input address is the same as the target address in the preset address set, it is indicated that the situation that the addresses are the same occurs in the continuous reading process in the reading stage, the target data in the preset data set corresponding to the target address can be queried without sending a read command to the DDR, the target address is any address in the preset address set, the target data is read again, the target data is added with the statistical increment value corresponding to the input address to obtain the target statistical increment value, when the DDR data is returned, the target statistical value obtained by adding the corresponding return data with the target statistical increment value is stored in the first-in first-out queue, and in the writing stage, the target statistical value is written back to the DDR.
Specifically, in the embodiment of the present application, if the addresses are the same during the continuous reading in the reading stage, the same data may be read out by two reading operations with the same address, so that the last written-back data covers the last written-back data, and the statistical data error is caused. To avoid this, the write statistics requests for the same address may be consolidated.
In the specific implementation, a buffer memory of the address read in the reading stage is maintained in the reading stage, when a new request of a user arrives, firstly, the address attached to the request is compared with the address in the buffer memory, if the comparison is passed, the address corresponding to the preset data set for storing the data is read, the data in the buffer memory is read and rewritten, the statistical increment of the time is added on the basis of the original data, and the original address is rewritten.
For example, as shown in fig. 2, in the embodiment of the present application, the service is write statistics, and according to the address of the user, reading is performed on the address corresponding to the DDR, and whether the number of the read data of the DDR that has been returned exceeds a preset threshold value is detected; if not (N), detecting whether the next service is the writing statistical service.
If yes, executing a step of executing one reading of the address corresponding to the DDR according to the address of the user; if not (N), entering a waiting state, and waiting until the data return quantity of the DDR exceeds a preset threshold value.
Detecting whether the quantity of the returned DDR read data exceeds a preset threshold value; if yes, entering a writing state, and writing all accumulated data back to the DDR according to the reading sequence in the reading state. In the waiting stage, if and only if the quantity of returned read data corresponding to the read command sent in the reading stage exceeds a preset threshold value, the read data can enter a writing state after being added with the statistical increment input by the user and stored in the corresponding FIFO. Otherwise, insufficient data may be encountered in the write state.
Next, it is detected whether the next service is a write statistics service; if yes, executing a step of executing one reading of the address corresponding to the DDR according to the address of the user; if not (N), executing other services.
In the specific implementation, after the DDR read data is returned, the DDR read data is added with the statistic value increment sent by the user and stored in the first-in first-out queue until the DDR read data enters a writing state, and the final statistic value is written back to the DDR according to the reading sequence.
Further, in the embodiment of the present application, in order to avoid address collision during reading and writing, the user's write statistics requests for the same address are combined. In a specific implementation, the DDR can be continuously read, and the read-write request is based on the data read back from the DDR, and the DDR is written back after the data is added with a statistic increment. If the addresses are the same during the continuous reading of the read phase, it may result in two read operations with the same address reading the same data, thereby resulting in the last write-back data overlapping the previous write-back data, resulting in a statistical data error. To avoid this, the user's write statistics requests to the same address are consolidated.
By way of example, as shown in FIG. 3, the input address may be referred to as addr and the addresses in the cache may include: addr_buffer_0, addr_buffer_1, addr_buffer_2, …. The input address can be compared with the address in the cache, if any address in the cache is the same as the input address, the address in the Data cache corresponding to any address in the cache can be obtained and recorded as data_buffer_1, the corresponding Data can be obtained, the Data can be read out, the Data attached to the user request is added on the basis, the Data is written back to the Data cache, and finally the Data is written back to the DDR in the writing stage.
In the specific implementation, the address requested by the user is compared with the address in the cache first, if and only if the requested address is different from the address in the cache, the requested address is written into the cache, if the requested address is the same as any address in the cache, the corresponding Data (Data) in the Data RAM is found according to the address in the cache, the Data is read out, the Data attached to the user request is added on the basis, then the Data is written back into the Data RAM, the final statistical value can be obtained after the Data corresponding to the DDR is added after the Data is returned, and finally the Data is written back into the DDR in the writing stage.
In the embodiment of the application, the write operation is continuously performed for a plurality of times after the read operation is continuously performed for a plurality of times when the write statistics is performed, so that the occurrence frequency of DDR read-write conversion time is reduced to the greatest extent on the premise of ensuring the accuracy of the statistical data, and the speed of the statistical service is improved.
The statistical service execution rate improving method described in the embodiment of the present application is applied to electronic equipment, where the electronic equipment includes a DDR, and when the current service is a write statistical service, the following steps S1 to S4 are executed: s1, acquiring an input address, determining a storage address in the DDR corresponding to the input address, and executing a read operation on the storage address; s2, detecting whether the quantity of the returned DDR read data exceeds a preset threshold value; s3, when the number of the returned DDR read data does not exceed a preset threshold value, detecting whether the next service is a writing statistical service or not; and S4, when the next service is the writing statistical service, executing the steps S1-S3 to realize the continuous and repeated writing operation after the continuous and repeated reading operation, so that the continuous and repeated reading operation can be performed when the writing statistics is performed, the occurrence frequency of the DDR reading-writing conversion time can be reduced to the greatest extent on the premise of ensuring the accuracy of the statistical data, the execution rate of the writing statistical service is improved, and the rate of the statistical service is also improved.
In accordance with the above-described embodiments, referring to fig. 4, fig. 4 is a schematic structural diagram of an electronic device provided in the present application, as shown in the fig. 4, the electronic device includes a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and the electronic device further includes a DDR, and the programs include instructions for performing the following steps:
when the service is the writing statistical service, the following steps S1-S4 are executed:
s1, acquiring an input address, determining a storage address in the DDR corresponding to the input address, and executing a read operation on the storage address;
s2, detecting whether the quantity of the returned DDR read data exceeds a preset threshold;
s3, detecting whether the next service is the writing statistical service or not when the quantity of the returned DDR read data does not exceed the preset threshold value;
and S4, executing the steps S1-S3 when the next service is the writing statistical service so as to realize continuous and repeated reading operation.
Optionally, the above program further comprises instructions for performing the steps of:
when the number of the returned DDR read data exceeds the preset threshold value, the data enters a writing state, and the accumulated data is completely written back to the DDR according to the reading sequence in the reading state so as to realize continuous and repeated writing operation.
Optionally, the above program further comprises instructions for performing the steps of:
and when the next service is not the writing statistical service, entering a waiting state, waiting until the data return quantity of the DDR exceeds the preset threshold, executing the step of entering a writing state when the data return quantity of the DDR exceeds the preset threshold, and completely writing the accumulated data back to the DDR according to the reading sequence in the reading state.
Optionally, the electronic device includes a cache, and the program further includes instructions for performing the following steps:
comparing the input address with addresses in a preset address set in the cache, wherein the preset address set comprises at least one address;
when the input address is different from any one of the preset address sets, a read instruction corresponding to the input address is sent to the DDR, the input address is written into the preset address set, and the statistical increment value corresponding to the input address is written into a preset data set.
Optionally, the above program further comprises instructions for performing the steps of:
when the input address is the same as a target address in the preset address set, not sending the read instruction to the DDR, and inquiring target data in the preset data set corresponding to the target address, wherein the target address is any address in the preset address set;
reading the target data;
adding the target data to the statistical added value corresponding to the input address to obtain a target statistical added value;
when the DDR data returns, the corresponding return data is added with the target statistical value obtained by the target statistical increment value and stored in a first-in first-out queue;
in the write phase, the target statistics are written back to the DDR.
The electronic device described in the embodiment of the present application includes a DDR, and when the current service is a write statistics service, the following steps S1 to S4 are executed: s1, acquiring an input address, determining a storage address in the DDR corresponding to the input address, and executing a read operation on the storage address; s2, detecting whether the quantity of the returned DDR read data exceeds a preset threshold value; s3, when the number of the returned DDR read data does not exceed a preset threshold value, detecting whether the next service is a writing statistical service or not; and S4, when the next service is the writing statistics service, executing the steps S1-S3 to realize continuous and repeated reading operation, so that the writing operation can be continuously and repeatedly performed after the continuous and repeated reading operation is performed when the writing statistics is performed, the occurrence frequency of DDR reading-writing conversion time can be reduced to the greatest extent on the premise that the accuracy of the statistics data is ensured, the execution rate of the writing statistics service is improved, and the rate of the statistics service is also improved.
Fig. 5 is a functional unit block diagram of a statistical service execution rate lifting device 500 according to the present application. The statistical service execution rate lifting device 500 is applied to an electronic device, wherein the electronic device comprises a DDR, and the statistical service execution rate lifting device 500 comprises: an execution unit 501, wherein,
the executing unit 501 is configured to execute the following steps S1-S4 when the current service is a write statistics service:
s1, acquiring an input address, determining a storage address in the DDR corresponding to the input address, and executing a read operation on the storage address;
s2, detecting whether the quantity of the returned DDR read data exceeds a preset threshold;
s3, detecting whether the next service is the writing statistical service or not when the quantity of the returned DDR read data does not exceed the preset threshold value;
and S4, executing the steps S1-S3 when the next service is the writing statistical service so as to realize continuous and repeated reading operation.
Optionally, the statistical service execution rate promoting device 500 is further specifically configured to:
when the number of the returned DDR read data exceeds the preset threshold value, the data enters a writing state, and the accumulated data is completely written back to the DDR according to the reading sequence in the reading state so as to realize continuous and repeated writing operation.
Optionally, the statistical service execution rate promoting device 500 is further specifically configured to:
and when the next service is not the writing statistical service, entering a waiting state, waiting until the data return quantity of the DDR exceeds the preset threshold, executing the step of entering a writing state when the data return quantity of the DDR exceeds the preset threshold, and completely writing the accumulated data back to the DDR according to the reading sequence in the reading state.
Optionally, the electronic device includes a cache, and the statistical service execution rate promoting device 500 is further specifically configured to:
comparing the input address with addresses in a preset address set in the cache, wherein the preset address set comprises at least one address;
when the input address is different from any one of the preset address sets, a read instruction corresponding to the input address is sent to the DDR, the input address is written into the preset address set, and the statistical increment value corresponding to the input address is written into a preset data set.
Optionally, the statistical service execution rate promoting device 500 is further specifically configured to:
when the input address is the same as a target address in the preset address set, not sending the read instruction to the DDR, and inquiring target data in the preset data set corresponding to the target address, wherein the target address is any address in the preset address set;
reading the target data;
adding the target data to the statistical added value corresponding to the input address to obtain a target statistical added value;
when the DDR data returns, the corresponding return data is added with the target statistical value obtained by the target statistical increment value and stored in a first-in first-out queue;
in the write phase, the target statistics are written back to the DDR.
The statistical service execution rate lifting device described in the embodiment of the present application is applied to electronic equipment, where the electronic equipment includes a DDR, and when the current service is a write statistical service, the following steps S1 to S4 are executed: s1, acquiring an input address, determining a storage address in the DDR corresponding to the input address, and executing a read operation on the storage address; s2, detecting whether the quantity of the returned DDR read data exceeds a preset threshold value; s3, when the number of the returned DDR read data does not exceed a preset threshold value, detecting whether the next service is a writing statistical service or not; and S4, when the next service is the writing statistical service, executing the steps S1-S3 to realize the continuous and repeated writing operation after the continuous and repeated reading operation, so that the continuous and repeated reading operation can be performed when the writing statistics is performed, the occurrence frequency of the DDR reading-writing conversion time can be reduced to the greatest extent on the premise of ensuring the accuracy of the statistical data, the execution rate of the writing statistical service is improved, and the rate of the statistical service is also improved.
It may be understood that the functions of each program module of the statistical service execution rate enhancing device of the present embodiment may be specifically implemented according to the method in the foregoing method embodiment, and the specific implementation process may refer to the relevant description of the foregoing method embodiment, which is not repeated herein.
The present application also provides a computer storage medium storing a computer program for electronic data exchange, the computer program causing a computer to execute part or all of the steps of any one of the methods described in the above method embodiments, the computer including an electronic device.
The present application also provides a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform part or all of the steps of any one of the methods described in the method embodiments above. The computer program product may be a software installation package, said computer comprising an electronic device.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the present application.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, such as the above-described division of units, merely a division of logic functions, and there may be additional manners of dividing in actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, or may be in electrical or other forms.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units described above, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a memory, including several instructions for causing a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the above-mentioned method of the various embodiments of the present application. And the aforementioned memory includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in the various methods of the above embodiments may be implemented by a program that instructs associated hardware, and the program may be stored in a computer readable memory, which may include: flash disk, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
The foregoing has outlined rather broadly the more detailed description of the present application, wherein specific examples have been provided to illustrate the principles and embodiments of the present application, the description of the examples being provided solely to assist in the understanding of the method of the present application and the core concepts thereof; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.
Claims (9)
1. The statistical service execution rate improving method is characterized by being applied to electronic equipment, wherein the electronic equipment comprises DDR and cache, and the method comprises the following steps:
when the service is the writing statistical service, the following steps S1-S4 are executed:
s1, acquiring an input address, determining a storage address in the DDR corresponding to the input address, and executing a read operation on the storage address;
s2, detecting whether the quantity of the returned DDR read data exceeds a preset threshold;
s3, detecting whether the next service is the writing statistical service or not when the quantity of the returned DDR read data does not exceed the preset threshold value;
s4, when the next service is the writing statistical service, executing the steps S1-S3 to realize continuous and repeated reading operation;
wherein the method further comprises:
comparing the input address with addresses in a preset address set in the cache, wherein the preset address set comprises at least one address;
when the input address is different from any one of the preset address sets, a read instruction corresponding to the input address is sent to the DDR, the input address is written into the preset address set, and the statistical increment value corresponding to the input address is written into a preset data set.
2. The method according to claim 1, wherein the method further comprises:
when the number of the returned DDR read data exceeds the preset threshold value, the data enters a writing state, and the accumulated data is completely written back to the DDR according to the reading sequence in the reading state so as to realize continuous and repeated writing operation.
3. The method according to claim 2, wherein the method further comprises:
and when the next service is not the writing statistical service, entering a waiting state, waiting until the data return quantity of the DDR exceeds the preset threshold, executing the step of entering a writing state when the data return quantity of the DDR exceeds the preset threshold, and completely writing the accumulated data back to the DDR according to the reading sequence in the reading state.
4. The method according to claim 1, wherein the method further comprises:
when the input address is the same as a target address in the preset address set, not sending the read instruction to the DDR, and inquiring target data in the preset data set corresponding to the target address, wherein the target address is any address in the preset address set;
reading the target data;
adding the target data to the statistical added value corresponding to the input address to obtain a target statistical added value;
when the DDR data returns, the corresponding return data is added with the target statistical value obtained by the target statistical increment value and stored in a first-in first-out queue;
in the write phase, the target statistics are written back to the DDR.
5. A statistical service execution rate promotion device, which is applied to an electronic device, wherein the electronic device comprises a DDR and a cache, and the device comprises: an execution unit, wherein,
the execution unit is configured to execute the following steps S1 to S4 when the current service is a write statistics service:
s1, acquiring an input address, determining a storage address in the DDR corresponding to the input address, and executing a read operation on the storage address;
s2, detecting whether the quantity of the returned DDR read data exceeds a preset threshold;
s3, detecting whether the next service is the writing statistical service or not when the quantity of the returned DDR read data does not exceed the preset threshold value;
s4, when the next service is the writing statistical service, executing the steps S1-S3 to realize continuous and repeated reading operation;
wherein, the device is also specifically used for:
comparing the input address with addresses in a preset address set in the cache, wherein the preset address set comprises at least one address;
when the input address is different from any one of the preset address sets, a read instruction corresponding to the input address is sent to the DDR, the input address is written into the preset address set, and the statistical increment value corresponding to the input address is written into a preset data set.
6. The device according to claim 5, characterized in that it is also specifically adapted to:
when the number of the returned DDR read data exceeds the preset threshold value, the data enters a writing state, and the accumulated data is completely written back to the DDR according to the reading sequence in the reading state so as to realize continuous and repeated writing operation.
7. The device according to claim 6, characterized in that it is also specifically adapted to:
and when the next service is not the writing statistical service, entering a waiting state, waiting until the data return quantity of the DDR exceeds the preset threshold, executing the step of entering a writing state when the data return quantity of the DDR exceeds the preset threshold, and completely writing the accumulated data back to the DDR according to the reading sequence in the reading state.
8. An electronic device comprising a processor, a memory for storing one or more programs and configured to be executed by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-4.
9. A computer-readable storage medium, characterized in that a computer program for electronic data exchange is stored, wherein the computer program causes a computer to perform the method according to any of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311678558.0A CN117373501B (en) | 2023-12-08 | 2023-12-08 | Statistical service execution rate improving method and related device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311678558.0A CN117373501B (en) | 2023-12-08 | 2023-12-08 | Statistical service execution rate improving method and related device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117373501A CN117373501A (en) | 2024-01-09 |
CN117373501B true CN117373501B (en) | 2024-04-09 |
Family
ID=89391434
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311678558.0A Active CN117373501B (en) | 2023-12-08 | 2023-12-08 | Statistical service execution rate improving method and related device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117373501B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101848135A (en) * | 2009-03-24 | 2010-09-29 | 华为技术有限公司 | Management method and management device for statistical data of chip |
JP2011248846A (en) * | 2010-05-31 | 2011-12-08 | Mitsubishi Electric Corp | Memory device and signal processing device |
WO2017157110A1 (en) * | 2016-03-18 | 2017-09-21 | 深圳市中兴微电子技术有限公司 | Method of controlling high-speed access to double data rate synchronous dynamic random access memory, and device |
CN109086008A (en) * | 2018-07-26 | 2018-12-25 | 浪潮电子信息产业股份有限公司 | Data processing method of solid state disk and solid state disk |
CN114371957A (en) * | 2021-12-31 | 2022-04-19 | 山东云海国创云计算装备产业创新中心有限公司 | DDR controller and DDR data refresh control method |
WO2022095439A1 (en) * | 2020-11-05 | 2022-05-12 | 珠海一微半导体股份有限公司 | Hardware acceleration system for data processing, and chip |
CN116841458A (en) * | 2023-05-06 | 2023-10-03 | 苏州浪潮智能科技有限公司 | Memory read-write control method, system, terminal and storage medium |
CN117093157A (en) * | 2023-10-16 | 2023-11-21 | 鸣飞伟业技术有限公司 | DDR high-speed read-write method and system for unidirectional optical transmission |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5754273B2 (en) * | 2011-07-11 | 2015-07-29 | 株式会社リコー | MEMORY CONTROL DEVICE, INFORMATION PROCESSING DEVICE, AND MEMORY CONTROL METHOD |
CN108763099B (en) * | 2018-04-18 | 2020-05-08 | 华为技术有限公司 | System starting method and device, electronic equipment and storage medium |
-
2023
- 2023-12-08 CN CN202311678558.0A patent/CN117373501B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101848135A (en) * | 2009-03-24 | 2010-09-29 | 华为技术有限公司 | Management method and management device for statistical data of chip |
JP2011248846A (en) * | 2010-05-31 | 2011-12-08 | Mitsubishi Electric Corp | Memory device and signal processing device |
WO2017157110A1 (en) * | 2016-03-18 | 2017-09-21 | 深圳市中兴微电子技术有限公司 | Method of controlling high-speed access to double data rate synchronous dynamic random access memory, and device |
CN107204198A (en) * | 2016-03-18 | 2017-09-26 | 深圳市中兴微电子技术有限公司 | The control method and device of high speed access Double Data Rate synchronous DRAM |
CN109086008A (en) * | 2018-07-26 | 2018-12-25 | 浪潮电子信息产业股份有限公司 | Data processing method of solid state disk and solid state disk |
WO2022095439A1 (en) * | 2020-11-05 | 2022-05-12 | 珠海一微半导体股份有限公司 | Hardware acceleration system for data processing, and chip |
CN114371957A (en) * | 2021-12-31 | 2022-04-19 | 山东云海国创云计算装备产业创新中心有限公司 | DDR controller and DDR data refresh control method |
CN116841458A (en) * | 2023-05-06 | 2023-10-03 | 苏州浪潮智能科技有限公司 | Memory read-write control method, system, terminal and storage medium |
CN117093157A (en) * | 2023-10-16 | 2023-11-21 | 鸣飞伟业技术有限公司 | DDR high-speed read-write method and system for unidirectional optical transmission |
Also Published As
Publication number | Publication date |
---|---|
CN117373501A (en) | 2024-01-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107992436B (en) | NVMe data read-write method and NVMe equipment | |
JP4866646B2 (en) | How to select commands to send to memory, memory controller, computer system | |
US9280290B2 (en) | Method for steering DMA write requests to cache memory | |
CN101566927B (en) | Memory system, memory controller and data caching method | |
CN101290604A (en) | Information processing apparatus and method, and program | |
CN108920387A (en) | Reduce method, apparatus, computer equipment and the storage medium of read latency | |
US9400603B2 (en) | Implementing enhanced performance flash memory devices | |
US8954644B2 (en) | Apparatus and method for controlling memory | |
US9069489B1 (en) | Dynamic random access memory front end | |
JP2000330859A (en) | Optimization of usage of bus having read/write coherency | |
CN115543894B (en) | Storage system, data processing method and device, storage medium and electronic equipment | |
US9727521B2 (en) | Efficient CPU mailbox read access to GPU memory | |
CN118012338A (en) | High-speed storage method and device based on field programmable gate array | |
CN117373501B (en) | Statistical service execution rate improving method and related device | |
CN110399219B (en) | Memory access method, DMC and storage medium | |
CN115826882B (en) | Storage method, device, equipment and storage medium | |
CN105264608A (en) | Data storage method, memory controller and central processing unit | |
WO2023093335A1 (en) | Data processing circuit, artificial intelligence chip, and data processing method and apparatus | |
CN110515861B (en) | Memory device for processing flash command and method thereof | |
CN116414743A (en) | Method for controlling memory, memory controller and chip | |
CN112463037B (en) | Metadata storage method, device, equipment and product | |
CN114265791A (en) | Data scheduling method, chip and electronic equipment | |
JP2008523485A5 (en) | ||
JP2003099324A (en) | Streaming data cache for multimedia processor | |
CN113093994A (en) | Data processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |