SOC bus data statistics method and device
By setting up a statistical unit on the SOC bus, and performing statistical calculations while transmitting data, the inefficiency problem caused by frequent access to the processing area during data statistics in the prior art is solved, and more efficient data processing is achieved.
Patent Information
- Application Number
- CN202411568594.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-02-25
AI Technical Summary
When performing data statistics, the prior art requires repeated access to the processing area multiple times, resulting in a greatly reduced computer data processing efficiency.
By setting up a statistical unit on the SOC bus, statistical calculations are performed while data transmission are performed, reducing the need for the CPU to repeatedly access the original data.
It effectively reduces the access load to the processing area and improves the efficiency of computer data processing.
Smart Images

Figure CN119512893A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method and device for counting data of a SOC bus. Background Art
[0002] The audio frame data sampled by the MIC or the video macroblock data sampled by the camera need to be transferred from the sampled data area to the processing area through the bus. The processing area performs some simple statistical processing, such as finding the maximum value, calculating the average value, and calculating the average energy value, to obtain some statistical characteristics of the data, and then perform subsequent specific algorithm processing.
[0003] In the related art, when performing data statistics, it is often necessary to perform multiple repeated data reading operations on the processing area according to different statistical requirements. Even if data caching is started, the data access time cannot be reduced, resulting in a significant reduction in the computer's data processing efficiency.
[0004] Based on this, there is an urgent need for a data statistics method and device for a SOC bus to solve the above technical problems. Summary of the invention
[0005] The present invention provides a method and device for SOC bus data statistics, which can effectively reduce the access load to the processing area and improve the computer data processing efficiency. The technical solution is as follows:
[0006] On the one hand, a method for collecting data of a SOC bus is provided, the method comprising:
[0007] Initializing the SOC bus and the preset statistical unit according to the transmission request to perform data transmission; wherein the statistical unit is mounted on the global bus or the local bus;
[0008] Utilizing the statistical unit to calculate statistical information of data transmitted within a specific address segment of the bus;
[0009] The statistical information is transferred to the data channel output port to directly use the statistical results for further processing.
[0010] On the other hand, a data statistics device for a SOC bus is provided, the device comprising:
[0011] An initialization unit, used to initialize the SOC bus and a preset statistical unit according to a transmission request to perform data transmission; wherein the statistical unit is mounted on a global bus or a local bus;
[0012] A statistical unit, used to calculate the statistical information of the data transmitted within a specific address segment of the bus;
[0013] The output unit is used to transmit the statistical information to the data channel output port so as to directly use the statistical results for further processing.
[0014] On the other hand, a computer device is provided, which includes a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the steps of the above-mentioned SOC bus data statistics method.
[0015] On the other hand, a computer-readable storage medium is provided, wherein a computer program is stored in the storage medium, and when the computer program is executed by a processor, the steps of the data statistics method of the SOC bus described above are implemented.
[0016] On the other hand, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the steps of the above-mentioned method for counting data of the SOC bus are implemented.
[0017] The technical solution provided by the present invention can at least bring the following beneficial effects: first, according to the request instruction, the data in the data area is transmitted to the processing area through the SOC bus; according to the statistical instruction, the preset statistical unit is called to perform statistical calculations on the transmitted data; according to the processing instruction, the statistical calculation results are transmitted to the processing area, so as to directly use the statistical results for further processing. Through this method, the statistical processing of the transmitted data can be completed while the data is being transmitted, avoiding the data access load caused by repeated access to the processing area, and greatly improving the data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 This is a flow chart of a data statistics method for a SOC bus provided by an embodiment of the present invention;
[0020] Figure 2 This is a schematic diagram of bus device hardware connection provided by an embodiment of the present invention;
[0021] Figure 3 This is a schematic diagram of a statistical unit workflow provided by an embodiment of the present invention;
[0022] Figure 4 is a schematic diagram of data transmission provided by an embodiment of the present invention;
[0023] Figure 5 is a schematic diagram of the function code of the summation module provided by an embodiment of the present invention;
[0024] Figure 6 It is a structural diagram of a data statistics device of a SOC bus provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0026] As mentioned above, when processing the transmission data, the prior art must re-traverse all the data in the access data area to complete the statistical processing of the data. This process greatly occupies the computer's data processing time, resulting in reduced processing efficiency.
[0027] Based on this, the concept of the present invention is to set up a statistical unit on the bus to complete statistical calculations on data while transmitting data, thereby reducing the CPU's repeated access to original data to calculate this information and reducing the load on the CPU and the bus.
[0028] The specific implementation of the above concept is described below.
[0029] Please refer to Figure 1 , an embodiment of the present invention provides a method for collecting data of a SOC bus, the method comprising:
[0030] Step 100, initializing the SOC bus and the preset statistical unit according to the transmission request to perform data transmission;
[0031] Step 102, using the statistical unit to calculate statistical information of data transmitted within a specific address segment of the bus;
[0032] Step 104, transmitting the statistical information to the data channel output port, so as to directly use the statistical results for further processing.
[0033] In the embodiment of the present invention, firstly, the data in the data area is transmitted to the processing area through the SOC bus according to the request instruction; the preset statistical unit is called according to the statistical instruction to perform statistical calculation on the transmitted data; and the statistical calculation result is transmitted to the processing area according to the processing instruction, so as to directly use the statistical result for further processing. Through this method, the statistical processing of the transmitted data can be completed while the data is being transmitted, avoiding the data access load caused by repeated access to the processing area, and greatly improving the data processing efficiency.
[0034] Described below Figure 1 How the various steps are performed.
[0035] First, with respect to step 100 , the SOC bus and a preset statistical unit are initialized according to a transmission request to perform data transmission.
[0036] The processing of audio and video data generally needs to be transferred from data area A to data processing area B for further processing, and simple statistical calculations are performed before processing. For example, before IFFT of speech noise reduction processing, it is necessary to first determine the maximum value of the processed data. If the maximum value of the data is less than a certain value, the data to be processed will be amplified and then the IFFT process will be performed. That is, before performing IFFT on the data in area B, the data in area B must be accessed and read again to obtain the maximum value, which causes multiple repeated accesses of the CPU, affecting the processing efficiency.
[0037] Therefore, this embodiment adds a statistical unit to the bus to complete the transmission and perform statistics on the data, such as Figure 2 and Figure 3 As shown, the statistical unit can be mounted on the global bus or the local bus. In order to implement this design, the bus needs to be initialized before transmission.
[0038] Since each address on the bus corresponds to transmission data, it is necessary to determine in advance which address segments need to be counted, that is, determine the target address segment and data type of the data in advance, and turn on the clock gating of the corresponding statistical unit according to the statistical requirements. Each statistical unit has a separate enable and gating design, so that the corresponding unit can be turned on as needed, and unnecessary units will not work to save power consumption.
[0039] by Figure 4 Taking the example shown in the figure, the address segment to be counted is 0x0400_0000:0x0400_0fff, that is, the starting address is 0x0400_0000; the end address is 0x0400_0fff; the data type can be read data or write data, that is, both input and output can be counted. Figure 4 Take reading data as an example; then turn on the corresponding clock gating to complete the initialization process.
[0040] Then, with respect to step 102, a statistical unit is used to calculate statistical information of data transmitted within a specific address segment of the bus.
[0041] In the implementation of the present invention, the calculation module of the statistical unit includes calculating the maximum value, the minimum value, the cumulative sum, the absolute value cumulative sum, the average value, the absolute value average value, the square sum and the cube sum, etc. These calculation modules can be adjusted according to actual needs, and the corresponding modules work according to clock gating control, which will not be described in detail here.
[0042] In an embodiment of the present invention, the calculation process of statistical information includes using a statistical unit to monitor the transmission data of the target address segment; capturing the corresponding transmission data in the target address segment according to the monitoring results; using the statistical unit to perform statistical calculations on the captured transmission data; when calculating, it is necessary to pre-process the captured transmission data according to the bus communication protocol; then execute the statistical function of the statistical unit on the pre-processed data to obtain the calculation results; finally, determine whether the statistics of the transmission data of all buses are completed, and if so, end the statistics and output the statistical information.
[0043] Specifically, the same Figure 4 For example, when the address: 0x400_0d14 to 0x400_0d20 is monitored on the bus, since this segment belongs to a segment in the target address segment, the data in this segment address is captured: 0x01_01_01_01, 0x02_02_02_02, 0x03_03_03_03 and 0x04_04_04_04.
[0044] Furthermore, the communication protocol adopted in this embodiment is the AHB protocol, so htrans is first delayed by one beat to align with the data hrdata in timing; then the valid number transmitted on the data bus hrdata is selected according to htrans for statistical calculation: dma_sum<=dma_sum+hrdata[31:24]+hrdata[23:16]+hrdata[15:8]+hrdata[7:0]; finally, the above steps are repeated until all buses complete data transmission. The specific implementation code of this step is as follows Figure 5 shown.
[0045] It is understandable that when different communication protocols are selected, the statistical process of data within the statistical unit will also be different. These can be adjusted by relevant technical personnel according to actual needs and will not be elaborated here.
[0046] With respect to step 104 , the statistical information is transmitted to the data channel output port so as to directly utilize the statistical results for further processing.
[0047] In an embodiment of the present invention, after the data statistics are completed, the address of the statistical information in the statistical unit can be accessed according to the processing instruction issued by the processing module to transmit the statistical information through the data channel output port; when the statistical information transmission is completed, the clock gating is adjusted according to the processing instruction to close the statistical unit.
[0048] At this point, statistical processing is completed while data is being transmitted, which reduces the load on the CPU and bus and improves data processing efficiency.
[0049] Please refer to Figure 6 The embodiment of the present invention provides a data statistics device for a SOC bus, the device comprising:
[0050] Initialization unit 600, used to initialize the SOC bus and the preset statistical unit according to the transmission request to perform data transmission; wherein the statistical unit is mounted on the global bus or the local bus;
[0051] A statistical unit 602, used to calculate statistical information of data transmitted within a specific address segment of the bus;
[0052] The output unit 604 is used to transmit the statistical information to the data channel output port so as to directly use the statistical results for further processing.
[0053] In an embodiment of the present invention, when the initialization unit 600 initializes the SOC bus and the preset statistical unit according to the transmission request, it is specifically used to perform the following operations: determine the target address segment and data type of the data transmitted on the bus; turn on the clock gating of the corresponding statistical unit according to the transmission request; wherein the clock gating is used to enable the statistical unit.
[0054] In the embodiment of the present invention, the target address segment includes a start address and an end address; the data type includes read data and write data.
[0055] In an embodiment of the present invention, when the statistical unit 602 is executing the calculation of statistical information of the transmission data within a specific address segment of the bus, it is specifically used to perform the following operations: using the statistical unit to monitor the transmission data of the target address segment; capturing the corresponding transmission data in the target address segment according to the monitoring results; using the statistical unit to perform statistical calculations on the captured transmission data; determining whether the statistics of the transmission data of all buses are completed, and if so, ending the statistics and outputting the statistical information.
[0056] In the embodiment of the present invention, the statistical unit is used to perform statistical calculations on the captured transmission data, including: preprocessing the captured transmission data according to the bus communication protocol; executing the statistical function of the statistical unit on the preprocessed data to obtain a calculation result.
[0057] In an embodiment of the present invention, when the output unit 604 executes the transmission of statistical information to the data channel output port, it is specifically used to perform the following operations: access the address of the statistical information in the statistical unit according to the processing instruction to transmit the statistical information through the data channel output port; when the transmission of the statistical information is completed, adjust the clock gating according to the processing instruction to close the statistical unit.
[0058] It should be noted that: the data statistics device of the SOC bus provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the data statistics device of the SOC bus provided in the above embodiment and the data statistics method embodiment of the SOC bus belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0059] An embodiment of the present application also provides a computer device, which includes a processor and a memory, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement the data statistics method of the SOC bus provided by the above-mentioned method embodiments.
[0060] An embodiment of the present application also provides a computer-readable storage medium, on which is stored at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the data statistics method of the SOC bus provided in the above-mentioned method embodiments.
[0061] An embodiment of the present application also provides a computer program product, which includes a computer program. A processor of a computer device reads the computer program from a computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the data statistics method of the SOC bus described in any of the above embodiments.
[0062] For the convenience of description, the above system or device is described by dividing it into various modules or units according to its functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0063] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.
[0064] Finally, it should be noted that, in this article, relational terms such as first, second, third and fourth are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0065] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A data statistics method for a SOC bus, characterized in that: The method comprises: Initializing the SOC bus and the preset statistical unit according to the transmission request to perform data transmission; wherein the statistical unit is mounted on the global bus or the local bus; Utilizing the statistical unit to calculate statistical information of data transmitted within a specific address segment of the bus; The statistical information is transferred to the data channel output port to directly use the statistical results for further processing.
2. The method according to claim 1, characterized in that Initializing the SOC bus according to the transmission request includes: Determine the target address segment and data type of data transmitted on the bus; The clock gating of the corresponding statistical unit is turned on according to the transmission request; wherein the clock gating is used to enable the statistical unit.
3. The method according to claim 2, characterized in that The target address segment includes a start address and an end address; the data type includes read data and write data.
4. The method according to claim 2, characterized in that: The method of calculating the statistical information of the data transmitted in the specific address segment of the bus by using a preset statistical unit includes: Using the statistical unit to monitor the transmission data of the target address segment; Capture the corresponding transmission data in the target address segment according to the monitoring results; Using the statistical unit to perform statistical calculations on the captured transmission data; Determine whether the statistics of the transmission data of all buses are completed. If so, end the statistics and output the statistical information.
5. The method according to claim 4, characterized in that The using the statistical unit to perform statistical calculation on the captured transmission data includes: Preprocessing the captured transmission data according to the bus communication protocol; The statistical function of the statistical unit is executed on the preprocessed data to obtain the calculation result.
6. The method according to claim 4, characterized in that The transmitting the statistical information to the data channel output port comprises: accessing the address of the statistical information in the statistical unit according to the processing instruction to transmit the statistical information through the data channel output port; When the statistical information transmission is completed, the clock gating is adjusted according to the processing instruction to shut down the statistical unit.
7. A data statistics device for a SOC bus, characterized in that: The device comprises: An initialization unit, used to initialize the SOC bus and a preset statistical unit according to a transmission request to perform data transmission; wherein the statistical unit is mounted on a global bus or a local bus; A statistical unit, used to calculate the statistical information of the data transmitted within a specific address segment of the bus; The output unit is used to transmit the statistical information to the data channel output port so as to directly use the statistical results for further processing.
8. A computer device, characterized in that: The computer device includes a memory and a processor, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the steps of any one of the methods described in claims 1-6.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The method comprises a computer program, wherein when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.