A data resource allocation method, system, intelligent terminal and readable storage medium

By optimizing the storage location of the flow based on the domain width and depth information of the memory block during network traffic detection, the problem of empty memory waste in flow resource allocation is solved, and the utilization of memory resources and flow extraction efficiency are improved.

CN114020458BActive Publication Date: 2024-10-15江苏信而泰智能装备有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111278285.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-30
Publication Date
2024-10-15
Estimated Expiration
2041-10-30

AI Technical Summary

Technical Problem

In the existing technology, memory resource allocation of flows during network traffic detection can easily lead to waste of vacant memory resources and low utilization rate.

Method used

By obtaining the domain width and domain depth information of the memory block, generate an array, randomly extract the stream and store it in the shelving memory block, calculate the domain width difference, determine and optimize the storage location of the stream, ensure that there are at least two streams in the same row, and reduce Reduce the waste of vacant memory resources and improve the usage efficiency of memory blocks.

Benefits of technology

It effectively reduces the waste of memory resources, improves the usage efficiency of memory blocks, optimizes the extraction and storage process of streams, and improves the occupancy efficiency of memory blocks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114020458B_ABST
    Figure CN114020458B_ABST
Patent Text Reader

Abstract

The present application relates to a data resource allocation method, system, intelligent terminal and readable storage medium, and relates to the field of memory resource allocation, including: obtaining domain width information and domain depth information, finding an array from the domain width information and randomly extracting a stream to store in a shelved memory block; calculating the domain width difference; if the domain width difference is 0, then completing the placement storage and re-extracting; if it is not 0, then determining whether there is a stream in the domain; if there is a stream, then randomly extracting the stream, and placing it, and updating the occupied memory block to complete the placement storage; if there is no stream, then completing the placement storage; until all streams are placed and stored. The problem that random allocation often leads to a lot of waste of vacant memory resources is improved. The present application has the effect of reducing the waste of vacant memory resources and improving the efficiency of memory block use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of memory resource allocation, and in particular to a data resource allocation method, system, intelligent terminal and readable storage medium. Background Art

[0002] With the popularization and complexity of the network, the reasonable construction and normal operation of the network have become extremely important, and to ensure the normal operation of the network, network detection auxiliary equipment must be used.

[0003] Stream is an abstract concept of input and output devices. Each simulation port can be configured with multiple streams. These streams are the basic control units for generating data packets and are also the smallest resource management units. Each stream independently generates network data frames according to its own configuration information and sends them out from the simulation port. In the network tester, there is a traffic generator component. The traffic generator is a very important tool for testing network performance and conducting network-related research. Every time a network data frame is generated, the traffic generator will take out a data list in the stream and put it into the corresponding data field. The traffic generator prepares a continuous memory resource. The software needs to allocate a continuous fixed-size memory block in this continuous memory for each stream that needs to configure the stream data list to jump.

[0004] In the related art, refer to Figure 1 , each stream needs to occupy a memory resource with fixed width and depth, and different streams are represented by different patterns. When a stream appears, the stream directly uses the empty memory block at the top grid of the same end as the initial point for storage, and continues to store according to the above steps when the next stream appears. For example, the current streams are S1{2,10}, S2{8,1}, S3{2,3}, S4{4,2}, S5{5,3}, where the first number represents the domain width and the second number represents the domain depth.

[0005] With respect to the above-mentioned related technologies, the inventors believe that allocating according to the above steps often easily leads to a lot of waste of vacant memory resources, and the utilization rate is low, and there is still room for improvement. Summary of the invention

[0006] In order to improve the problem that random allocation often leads to waste of many vacant memory resources, the present application provides a data resource allocation method, system, storage medium and intelligent terminal.

[0007] In a first aspect, the present application provides a data resource allocation method, which adopts the following technical solution:

[0008] Obtain domain width information and domain depth information of the stream of the memory block in the application resource, the memory block includes the shelved memory block and the occupied memory block, find the stream with the same domain width value from the domain width information and generate the corresponding array according to the domain width value;

[0009] A stream is randomly drawn from any array, and the drawn stream is stored in a shelved memory block from either end to be converted into an occupied memory block;

[0010] Calculate the domain width difference between the domain width value corresponding to the stream in the occupied memory block and the domain width value corresponding to the preset maximum domain width information;

[0011] Determine whether the domain width difference is 0;

[0012] If the domain width difference is 0, the placement and storage of the row of domain depth information corresponding to the current domain width information is completed and a stream is randomly extracted from any array again, and the extracted stream is stored in the shelved memory block from any end to convert it into an occupied memory block, and it is repeatedly determined whether the domain width difference is 0;

[0013] If the domain width difference is not 0, determine whether there is a flow in the array whose domain width is less than or equal to the domain width difference;

[0014] If there is a stream, randomly extract a stream from the array whose domain width value is less than or equal to the domain width difference value, and place the stream in the row where the domain depth information corresponding to the occupied memory block is located, and update the occupied memory block to complete the placement and storage of the row where the maximum domain depth information corresponding to the current domain width information is located, and randomly extract a stream from any array again, and store the extracted stream from any end to the shelved memory block to convert it into an occupied memory block, and repeatedly determine whether the domain width difference value is 0;

[0015] If there is no stream, the placement and storage of the row where the domain depth information corresponding to the current domain width information is located is completed, and a stream is randomly extracted from any array again, and the extracted stream is stored in the shelved memory block from any end to convert it into an occupied memory block, and it is repeatedly determined whether the domain width difference is 0;

[0016] Until all streams are placed in storage.

[0017] By adopting the above technical solution, by judging whether there are two streams whose sum of domain width values ​​is less than or equal to the maximum domain width information, the streams whose sum of domain width values ​​is less than or equal to the maximum domain width information are stored in the reserved memory blocks of the same row, so that there are at least two streams in the same row. Compared with placing one stream in one row, the waste of vacant memory resources is reduced and the utilization efficiency of memory blocks is improved.

[0018] Optionally, a storage method for shelving memory blocks in the same row includes:

[0019] Update the domain width difference between the sum of the domain width values ​​of the streams in the occupied memory block and the domain width value corresponding to the maximum domain width information;

[0020] Determine whether the updated domain width difference is 0;

[0021] If the updated domain width difference is 0, the placement storage of the current row is completed, and a stream is randomly extracted from any array again, and the extracted stream is stored in the shelved memory block from any end to convert it into an occupied memory block, and the domain width difference is repeatedly determined to be 0;

[0022] If the updated domain width difference is not 0, a stream is randomly selected from the array whose domain width is less than or equal to the domain width difference, and the stream is placed in the row where the domain depth information corresponding to the occupied memory block of the current row is located, so as to update the occupied memory block and repeatedly determine whether the domain width difference is 0;

[0023] The placement and storage of the current row is completed until the domain width difference is 0, or until there is no array whose domain width is less than or equal to the domain width difference.

[0024] By adopting the above technical solution, if there are idle memory blocks in the first row when two streams are stored in the same row and there are streams that can be placed in the remaining idle memory blocks, storage will continue, further reducing the waste of vacant memory block resources in a row and improving the utilization efficiency of memory blocks.

[0025] Optionally, when placing and storing the stream in the pending memory block, the stream selection method includes:

[0026] Sort the array according to the domain width value of the stream;

[0027] According to the extraction action, the maximum value array is found from the sorted array, and the maximum value array includes the array with the largest domain width value and the value with the smallest domain width value;

[0028] Extract the stream corresponding to the array with the largest domain width value.

[0029] By adopting the above technical solution, by sorting the array according to the domain width value and extracting from the array with the largest domain width value, it is more convenient to find the flow in the unstored array. Compared with the method of random placement, the screening is faster, and the efficiency of flow extraction is improved.

[0030] Optionally, when placing and storing the stream in the pending memory block, the stream selection method includes:

[0031] Sort the streams in the same array according to the domain depth value of the stream;

[0032] According to the extraction action, find the most valuable flow from the sorted flows, which includes the flow with the largest domain depth value in the same array and the flow with the smallest domain depth value in the same array;

[0033] Extract the flow with the largest domain depth value.

[0034] By adopting the above technical solution, by sorting the flows in the array according to the domain depth value and extracting the flow with the largest domain depth, it is more convenient to search for the same flow in the same array. Compared with the method of random placement, the screening is faster, and the efficiency of flow extraction is improved.

[0035] Optionally, when placing and storing the stream in the pending memory block, the stream selection method includes:

[0036] According to the extraction action, it is determined whether there is a flow in the stream with the same domain depth value as that corresponding to the occupied memory block in the same row;

[0037] If there is a stream in the stream with the same domain depth value as that corresponding to the shelved memory block in the same row, the stream with the same domain depth value is extracted.

[0038] By adopting the above technical solution, by giving priority to selecting streams with the same domain depth for storage, there are no empty idle memory blocks between streams, so that after the placement and storage of the current row is completed, the stream can be stored from the next row without being easily disturbed by the occupied memory blocks after the stream of the current row is occupied, thereby improving the occupancy efficiency of the memory blocks.

[0039] Optionally, when placing and storing the stream in the pending memory block, the stream selection method includes:

[0040] If there is no stream with the same domain depth value as the one corresponding to the idle memory block in the same row, then extract the streams with a smaller domain depth value than the one corresponding to the occupied memory block in the same row and combine and place them until the domain depth value is the same as the one corresponding to the idle memory block in the same row;

[0041] If the extracted streams cannot be combined and placed with the domain depth value corresponding to the shelved memory block in the same row, then the streams in the streams that are adjacent to the same row and have a greater domain depth value than the shelved memory block are placed;

[0042] If there is no adjacent stream with a domain depth value greater than the domain depth value corresponding to the shelved memory block in the same row in the stream, then place the stream in the stream that is adjacent to the same row and has a domain depth value less than the domain depth value corresponding to the shelved memory block;

[0043] If there is no adjacent stream in the stream that is smaller than the domain depth value corresponding to the shelved memory block in the same row, the placement storage is completed.

[0044] By adopting the above technical solution, by searching for the streams whose domain depth values ​​are equal to the domain depth values ​​corresponding to the pending memory blocks in the same row and placing and storing them, after completing the placement and storage of the current row, the streams can be stored from the next row and are not easily disturbed by the occupied memory blocks after the streams of the current row are occupied, thereby improving the occupancy efficiency of the memory blocks.

[0045] Optionally, the method of extracting the stream with the largest domain depth value and storing the stream from the end of the memory block to the shelved memory block includes:

[0046] Get the domain width value of the reserved memory block in the memory block occupied by the same row;

[0047] Push the reserved memory block corresponding to the maximum domain width value to the head end in a loop;

[0048] Determine whether there is a row in the reserved memory block in the same row as the occupied memory block that is larger than the domain width value of the extracted stream;

[0049] If there is a row whose domain width is larger than the extracted stream, the extracted stream is placed and stored in the smallest row among the rows whose domain width is larger than the extracted stream;

[0050] If there is no row with a domain width greater than the extracted stream, storage is performed from either end of the row in the shelved memory block where the domain width value is equal to the domain width value corresponding to the maximum domain width information.

[0051] By adopting the above technical solution, by moving the shelved memory block to the head end, it is convenient for the computer to make judgments, so that when streams of different domain depths exist, the streams in the shelved memory blocks that are less than or equal to the maximum domain depth can also be utilized, thereby rationally utilizing the resources of the shelved memory blocks left after the streams of different domain depths are stored in the previous row, and further improving the occupancy efficiency of the memory blocks.

[0052] In a second aspect, the present application provides a system for allocating resources for data jumps in a stream list, which adopts the following technical solution:

[0053] A system for allocating resources for data jump in a list within a stream, comprising:

[0054] An information acquisition module obtains domain width information and domain depth information of a stream of a memory block in an application resource, wherein the memory block includes a reserved memory block and an occupied memory block, finds a stream with a consistent domain width value from the domain width information, and generates a corresponding array according to the domain width value;

[0055] A processing module, connected to the information reading module and the judgment module, and used for processing and storing information;

[0056] The processing module randomly extracts a stream from any array and stores the extracted stream into a shelved memory block from any end to convert it into an occupied memory block;

[0057] The processing module calculates a domain width difference between a domain width value corresponding to a stream in an occupied memory block and a domain width value corresponding to preset maximum domain width information;

[0058] A judgment module is used to judge whether the domain width difference is 0;

[0059] If the judgment module determines that the domain width difference is 0, the processing module completes the placement and storage of the row where the domain depth information corresponding to the current domain width information is located and randomly extracts a stream from any array again, and stores the extracted stream from any end to the shelved memory block to convert it into an occupied memory block, and repeatedly determines whether the domain width difference is 0;

[0060] If the judgment module determines that the domain width difference is not 0, the judgment module determines whether there is a flow in the array whose domain width value is less than or equal to the domain width difference;

[0061] If the judgment module determines that there is a stream, the processing module randomly extracts a stream from the array whose domain width value is less than or equal to the domain width difference value, and places the stream in the row where the domain depth information corresponding to the occupied memory block is located, and updates the occupied memory block, completes the placement and storage of the row where the maximum domain depth information corresponding to the current domain width information is located, and randomly extracts a stream from any array again, and stores the extracted stream from any end to the shelved memory block to convert it into an occupied memory block, and repeatedly determines whether the domain width difference value is 0;

[0062] If the judgment module determines that there is no stream, the processing module completes the placement and storage of the row where the domain depth information corresponding to the current domain width information is located, and randomly extracts a stream from any array again, and stores the extracted stream from any end to the shelved memory block to convert it into an occupied memory block, and repeatedly determines whether the domain width difference is 0;

[0063] Until all streams are placed in storage.

[0064] By adopting the above technical solution, by judging whether there are two streams whose sum of domain width values ​​is less than or equal to the maximum domain width information, the streams whose sum of domain width values ​​is less than or equal to the maximum domain width information are stored in the reserved memory blocks of the same row, so that there are at least two streams in the same row. Compared with placing one stream in one row, the waste of vacant memory resources is reduced and the utilization efficiency of memory blocks is improved.

[0065] In a third aspect, the present application provides a smart terminal, which adopts the following technical solution:

[0066] An intelligent terminal comprises a memory and a processor, wherein the memory stores a computer program which can be loaded by the processor and execute any one of the above data resource allocation methods.

[0067] By adopting the above technical solution, by judging whether there are two streams whose sum of domain width values ​​is less than or equal to the maximum domain width information, the streams whose sum of domain width values ​​is less than or equal to the maximum domain width information are stored in the reserved memory blocks of the same row, so that there are at least two streams in the same row. Compared with placing one stream in one row, the waste of vacant memory resources is reduced and the utilization efficiency of memory blocks is improved.

[0068] In a fourth aspect, the present application provides a computer-readable storage medium that can store corresponding programs and has the characteristic of being easy to implement.

[0069] A computer-readable storage medium adopts the following technical solution:

[0070] A computer-readable storage medium stores a computer program that can be loaded by a processor and execute any of the above data resource allocation methods.

[0071] By adopting the above technical solution, by judging whether there are two streams whose sum of domain width values ​​is less than or equal to the maximum domain width information, the streams whose sum of domain width values ​​is less than or equal to the maximum domain width information are stored in the reserved memory blocks of the same row, so that there are at least two streams in the same row. Compared with placing one stream in one row, the waste of vacant memory resources is reduced and the utilization efficiency of memory blocks is improved.

[0072] In summary, the present application includes at least one of the following beneficial technical effects:

[0073] The streams whose sum of domain width values ​​is less than or equal to the maximum domain width information are stored in the reserved memory blocks of the same row, which reduces the waste of vacant memory resources and improves the use efficiency of memory blocks;

[0074] By giving priority to storing streams with the same domain depth, the streams can be stored from the next row without being disturbed, thus improving the occupancy efficiency of the memory block. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] Figure 1 It is a schematic diagram of a data resource allocation method in the related art.

[0076] Figure 2 It is a flowchart of a data resource allocation method in Example 1 of the present application.

[0077] Figure 3 This is a schematic diagram of the steps of a data resource allocation method in Example 1 of the present application.

[0078] Figure 4 It is a flowchart of a data resource allocation method in Example 2 of the present application.

[0079] Figure 5 This is a flowchart of the method for extracting and storing the stream with the largest domain depth value from the end of the memory block in Example 2 of the present application.

[0080] Figure 6 This is a schematic diagram of the steps of a data resource allocation method in Example 2 of the present application.

[0081] Figure 7 This is a schematic diagram of the steps of a data resource allocation method in Example 3 of the present application.

[0082] Figure 8 It is a module diagram of a data resource allocation method in an embodiment of the present application. DETAILED DESCRIPTION

[0083] In order to make the purpose, technical solutions and advantages of this application more clear, the following Figure 1-8 It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0084] The embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings.

[0085] See also Figure 1 and Figure 2 The embodiment of the present invention provides a data resource allocation method, and the main process of the data resource allocation method is described as follows:

[0086] Step 100: Obtain domain width information and domain depth information of the stream of the memory block in the application resource, the memory block includes a pending memory block and an occupied memory block, find the stream with the same domain width value from the domain width information and generate a corresponding array according to the domain width value.

[0087] Among them, stream is an abstract concept, which is an abstraction of input and output devices. In Java programs, data input / output operations are performed in a "stream" manner. Each stream has certain domain width information and domain depth information. The domain width information is the width value of the memory block occupied by the stream, and the domain depth information is the depth value of the memory block occupied by the stream. The idle memory block is the memory block where the stream is not stored. The occupied memory block is the memory block where the stream has been stored. Every time there are multiple streams, the traffic generator will take out one and put it in the corresponding idle memory block. Figure 1 As shown in Figure 1, each stream is allocated a continuous fixed-size memory block. When the domain width information is consistent, the streams are classified into an array to facilitate user extraction.

[0088] Step 101: randomly extract a stream from any array, and store the extracted stream into a shelved memory block from any end to convert it into an occupied memory block.

[0089] The extraction method is random extraction, and when the stream is put into it, the information of the shelved memory block is transformed into the occupied memory block. Figure 3 In step a1 in the figure, the randomly selected stream is S1 {2, 10}, then the memory blocks with a width of 2 and a depth of 10 starting from the top grid in the memory block are converted from idle memory blocks to occupied memory blocks.

[0090] Step 102: Calculate the domain width difference between the domain width value corresponding to the stream in the occupied memory block and the domain width value corresponding to the preset maximum domain width information.

[0091] The maximum domain width information is preset, that is, the length and size of all occupied blocks in the traffic generator are known in advance, and the maximum domain width information is the maximum value of the occupied block. The domain width difference △L=Lmax-L1, where Lmax is the domain width value corresponding to the maximum domain width information, and L1 is the domain width value in the randomly selected flow. Figure 3 From step diagram a1, we can see that the domain width difference △L=8-2=6.

[0092] Step 103: Determine whether the domain width difference is zero.

[0093] The purpose of the judgment is to determine whether there is a pending memory block in the same row of the memory block occupied by the stream.

[0094] Step 1031: If the domain width difference is 0, the placement and storage of the row where the domain depth information corresponding to the current domain width information is located is completed and a stream is randomly extracted from any array again, and the extracted stream is stored in the shelved memory block from either end to convert it into an occupied memory block, and repeatedly determine whether the domain width difference is 0.

[0095] When the domain width difference is 0, it means that the memory blocks in the same domain depth have all been converted into occupied memory blocks, which are in the best occupied state and allocate resources reasonably. For example, if the extracted stream is S2{8, 1}, the memory blocks in the same domain depth where S2 is located have been fully occupied.

[0096] Step 1032: If the domain width difference is not 0, determine whether there is a flow in the array whose domain width is less than or equal to the domain width difference.

[0097] When the domain width difference is not 0, it means that the domain width difference is a positive number, which means that there are still pending memory blocks in the memory blocks occupying the same row of the memory blocks, and then it is determined whether there are still streams that can be stored in the pending memory blocks and store them. Figure 3 In step a1 of the figure, the domain width difference is 6, not 0, which means there are still pending memory blocks. Then, we search whether there are any streams in the array whose domain width is less than or equal to 6. Here, we find streams S3{2, 3}, S4{4, 2} and S5{5, 3}.

[0098] Step 1041: If there is a stream, a stream is randomly selected from the array whose domain width value is less than or equal to the domain width difference value, and the stream is placed in the row where the domain depth information corresponding to the occupied memory block is located.

[0099] The extraction method is random extraction, that is, one can be randomly extracted from streams S3{2,3}, S4{4,2} and S5{5,3}, and then filled in the row where the domain depth information corresponding to the occupied memory block is located, for example Figure 3 In step a2 of FIG. 1 , the extracted stream is S5{5, 3}, and is stored next to the idle memory block of the occupied memory block.

[0100] Step 1042: If there is no stream, the placement and storage of the row where the domain depth information corresponding to the current domain width information is located is completed, and a stream is randomly extracted from any array again, and the extracted stream is stored in the shelved memory block from either end to convert it into an occupied memory block, and repeatedly determine whether the domain width difference is 0.

[0101] If it does not exist, it means that the remaining reserved memory blocks in the row where the domain depth information corresponding to the occupied memory block is located cannot be stored, and a new row is needed for storage, such as Figure 3 In the a3 diagram in FIG. 1 , there is no stream with a domain width value of 1, so a new row is stored, and then the process continues from step 101, such as Figure 3 As shown in a4 and a5 in .

[0102] Step 105: until all streams are placed and stored.

[0103] When all streams are stored, the storage of the current memory block ends.

[0104] Step 106: Update the domain width difference between the sum of the domain width values ​​of the streams in the occupied memory block and the domain width value corresponding to the maximum domain width information.

[0105] The updating method is to add the domain width values ​​of the streams in the same row numerically, and then compare them with the domain width value corresponding to the maximum domain width information. The domain width difference is △L=Lmax-LaLL, where LaLL is the sum of the domain width values ​​of the streams in the occupied memory block. When there is only one stream in the occupied memory block, LaLL=L1.

[0106] Step 107: Determine whether the updated domain width difference is 0 until there is no array whose domain width is less than or equal to the domain width difference, and then complete the placement and storage of the current row.

[0107] Among them, if the updated domain width difference is not less than 0, repeat step 1032 and subsequent steps; if it does not exist or the updated domain width difference is 0, it means that there is no pending memory block in the current row or the current pending memory block cannot be stored, and it is necessary to store from the next row of pending memory blocks.

[0108] Reference Figure 4 and Figure 5In order to make the extraction more efficient, the extraction method in this embodiment includes:

[0109] Step 200: Sort the array according to the domain width value of the stream.

[0110] The sorting method is to sort according to the domain width of the flow, and the purpose of sorting is to better find the flow.

[0111] Step 201: Sort the flows in the same array according to the domain depth values ​​of the flows.

[0112] The purpose of sorting by array and by domain depth of stream is to better find the corresponding stream, speed up the computer search process, and there is no need to search from the first stream of the first array every time.

[0113] Step 202: According to the extraction action, find the maximum value array from the sorted array, and the maximum value array includes the array with the largest domain width value and the value with the smallest domain width value.

[0114] The extraction action is the action of the computer extracting the stream from the array. The maximum value array is the array with the largest or smallest domain width value in the sorted array. For example, in this embodiment, the maximum value array is an array with a domain width value of 2 or a domain width value of 8.

[0115] Step 203: According to the extraction action, find the maximum value flow from the sorted flows, and the maximum value flow includes the flow with the largest domain depth value in the same array and the flow with the smallest domain depth value in the same array.

[0116] The extraction action is the action of the computer extracting the flow from the array. The maximum value flow is the flow with the largest or smallest domain depth value in the sorted array, making the extraction faster and more convenient.

[0117] Step 204: extract the stream corresponding to the array with the largest domain width value.

[0118] Among them, the stream corresponding to the array with the largest domain width value, that is, the array with a domain width value of 8, is extracted. If there is no stream in the array with a domain width value of 8, then the stream corresponding to the array with a domain width value of 7 is extracted, and so on. Figure 6 In step b1 of the above, the extracted stream is S2{8, 1}. If there is a stream with a domain depth greater than or equal to 1, the stream with the largest domain depth is selected. Then, the same as the steps in the embodiment is used to determine whether there is a domain width difference in the same row. In step b1, if there is no pending memory block in the row where the occupied memory block stored in S2{8, 1} is located, another row needs to be extracted and stored, for example Figure 6 In step b2 in FIG. 1 , the array with the largest domain width value is the array with a domain width value of 5, and the stream extracted from another row is S5{5, 3}.

[0119] Step 205: According to the extraction action, determine whether there is a flow in the flow with the same domain depth value as that corresponding to the occupied memory block in the same row.

[0120] The purpose of the judgment is to convert all the idle memory blocks in the same row of the occupied memory blocks into occupied memory blocks, so as to make reasonable use of memory resources.

[0121] Step 2051: If there is a stream in the stream with the same domain depth value as that corresponding to the pending memory block in the same row, the stream with the same domain depth value is extracted.

[0122] If there are streams with the same domain depth value in the array that is less than or equal to the domain width difference, the streams with the same domain depth value are selected, for example Figure 6 In step b2 of FIG. 1 , if there is a stream with a domain depth value of 3 among the remaining streams in the array that is less than or equal to the domain width difference value, the stream is stored in the corresponding shelved memory block.

[0123] Step 2052: If there is no stream in the stream with the same domain depth value as the domain depth value corresponding to the idle memory block in the same row, then extract streams from the streams in the same row that are smaller than the domain depth value corresponding to the occupied memory block and combine and place them until the domain depth value is the same as the domain depth value corresponding to the idle memory block in the same row.

[0124] If there is no stream with the same domain depth value as the one corresponding to the pending memory block in the same row, it means that the stream with the same domain depth value cannot be directly selected for storage. The same effect can be achieved by combining several streams with the same domain depth value for storage. Figure 6 In step b2 of FIG. 1 , if there is a flow whose combined domain depth value sums to 3 among the remaining flows in the array that is less than or equal to the domain width difference, the combined flow is stored.

[0125] Step 206: If the extracted streams cannot have the same domain depth value as the domain depth value corresponding to the shelved memory block in the same row after being combined and placed, then place the streams in the stream that are adjacent to the streams in the same row and have a greater domain depth value than the domain depth value corresponding to the shelved memory block.

[0126] If the extracted stream cannot have the same domain depth value as the reserved memory block in the same row after combination and placement, the stream with a domain depth value adjacent to the reserved memory block in the same row and greater than that of the reserved memory block is preferred. This is done to make the top grid a reserved memory block for easy storage. Figure 6 In step b2 of FIG. 1 , if there is a flow whose combined domain depth value is greater than 3 among the remaining flows in the array that is less than or equal to the domain width difference value, the flow is stored.

[0127] Step 207: If there is no adjacent stream in the stream and the domain depth value is greater than the domain depth value corresponding to the shelved memory block in the same row, place the stream in the stream that is adjacent to the same row and the domain depth value is less than the domain depth value corresponding to the shelved memory block.

[0128] Among them, if there is no adjacent stream in the stream that is greater than the domain depth value corresponding to the shelved memory block in the same row, it means that there are only streams with a domain depth value less than the domain depth value corresponding to the shelved memory block. In this case, only streams with a domain depth value less than the domain depth value corresponding to the shelved memory block can be placed to reduce the waste of memory resources.

[0129] Step 208: If there is no adjacent stream in the stream whose domain depth value is smaller than the domain depth value corresponding to the shelved memory block in the same row, the placement storage is completed.

[0130] If there is no adjacent stream in the stream that has a smaller domain depth value than the corresponding reserved memory block in the same row, it means that the remaining reserved memory blocks cannot be stored and need to be stored in another row.

[0131] Reference Figure 5 , the method for extracting the stream with the largest domain depth value from the end storage of the memory block includes:

[0132] Step 300: Obtain the domain width value of the reserved memory block in the memory block occupied by the same row.

[0133] The acquisition method is to compare the maximum domain width information with the domain width value of the occupied memory block of each row, for example Figure 6 In step diagram b3, the domain width values ​​of the first three rows are all 0, and the domain width value of the fourth row is 3.

[0134] Step 301: Push the reserved memory block corresponding to the maximum domain width value to the head end in a circular manner.

[0135] The pushing method is that all occupied memory blocks and shelved memory blocks move synchronously, and the maximum domain width value is the maximum value of the corresponding domain width values ​​in the shelved memory blocks, for example Figure 6 In step b3 of FIG. 1 , the maximum value of the domain width corresponding to the shelved memory block is 3, so the shelved memory block is moved to the head end, thus forming Figure 6 Step diagram b4.

[0136] Step 302: Determine whether there is a row in the idle memory block in the same row as the occupied memory block that has a value greater than the domain width of the extracted stream.

[0137] The purpose of the judgment is to see whether storage can still be performed in the idle memory block in the same row of the occupied memory block, so as to reduce the waste of memory blocks.

[0138] Step 3021: If there is a row whose domain width value is greater than the extracted stream, the extracted stream is placed and stored in the smallest row among the rows whose domain width value is greater than the extracted stream.

[0139] If there is a row with a domain width greater than the extracted stream, it means that the domain width of the next extracted stream is smaller than the domain width of the idle memory block in the same row as the occupied memory block, and the smallest row among the rows with a domain width greater than the extracted stream is placed for storage. Figure 6 In step b4 of FIG. 1 , if the domain width value in the stream extracted after sorting is less than or equal to 3, the stream less than or equal to 3 is placed in the shelved memory block for storage.

[0140] Step 3022: If there is no row with a domain width greater than the extracted stream, then place and store the domain width from any end of the row in the reserved memory block where the domain width value is equal to the domain width value corresponding to the maximum domain width information.

[0141] If there is no row whose domain width is greater than the extracted stream, it means that the remaining reserved memory blocks cannot provide storage space, and a new row is needed for storage, for example Figure 6 In step b4 of the diagram, the extracted stream after sorting is S4{4, 2}, which is greater than 3, so it is necessary to place and store it from either end of the fourth row, and then continue to execute step 205.

[0142] like Figure 7 As shown, Figure 6 The different approach is that the extracted stream is stored and placed from the other end.

[0143] Based on the same inventive concept, an embodiment of the present invention provides a system for allocating resources for data jumps in a list within a stream.

[0144] Reference Figure 8 , the in-stream list data jump resource allocation system includes:

[0145] An information acquisition module obtains domain width information and domain depth information of a stream of a memory block in an application resource, wherein the memory block includes a reserved memory block and an occupied memory block, finds a stream with a consistent domain width value from the domain width information, and generates a corresponding array according to the domain width value;

[0146] The processing module 401 is connected to the information reading module 403, the shelved memory block storage module 404, the flow sorting module 405, the flow selection module 406 and the judgment module 402, and is used to process and store information;

[0147] The processing module 401 randomly extracts a stream from any array, and stores the extracted stream into a shelved memory block from any end to convert it into an occupied memory block;

[0148] The processing module 401 calculates a domain width difference between a domain width value corresponding to a stream in an occupied memory block and a domain width value corresponding to preset maximum domain width information;

[0149] A determination module 402 is used to determine whether the domain width difference is 0;

[0150] If the determination module 402 determines that the domain width difference is 0, the processing module 401 completes the placement and storage of the row where the domain depth information corresponding to the current domain width information is located and randomly extracts a stream from any array again, and stores the extracted stream from any end into the shelved memory block to convert it into an occupied memory block, and repeatedly determines whether the domain width difference is 0;

[0151] If the determination module 402 determines that the domain width difference is not 0, the determination module 402 determines whether there is a flow in the array whose domain width value is less than or equal to the domain width difference;

[0152] If the judgment module 402 judges that there is a stream, the processing module 401 randomly extracts a stream from the array whose domain width value is less than or equal to the domain width difference value, and places the stream in the row where the domain depth information corresponding to the occupied memory block is located, and updates the occupied memory block, completes the placement and storage of the row where the maximum domain depth information corresponding to the current domain width information is located, and randomly extracts a stream from any array again, and stores the extracted stream from any end to the shelved memory block to convert it into an occupied memory block, and repeatedly determines whether the domain width difference value is 0;

[0153] If the judgment module 402 judges that there is no stream, the processing module 401 completes the placement and storage of the row where the domain depth information corresponding to the current domain width information is located, and randomly extracts a stream from any array again, and stores the extracted stream from any end to the shelved memory block to convert it into an occupied memory block, and repeatedly judges whether the domain width difference is 0;

[0154] A shelving memory block storage module 404 is used to place the stream storage in the row where the domain depth information corresponding to the occupied memory block of the current row is located;

[0155] A flow sorting module 405 is used to sort flows and flow groups in a certain order;

[0156] The stream selection module 406 is used to extract and store the streams with the same domain depth value or the same sum of domain depth values ​​and occupied memory blocks:

[0157] If the judgment module 402 has a row with a domain width greater than the extracted stream, the stream selection module 406 places and stores the extracted stream in the smallest row among the rows with a domain width greater than the extracted stream;

[0158] If the judging module 402 does not have a row with a domain width greater than the extracted stream, the stream selecting module 406 places the stream from any end of the row in the reserved memory block where the domain width value is equal to the domain width value corresponding to the maximum domain width information;

[0159] Until all streams are placed in storage.

[0160] An embodiment of the present invention provides a computer-readable storage medium storing a computer program that can be loaded by a processor and execute a data resource allocation method.

[0161] Computer storage media include, for example, various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.

[0162] Based on the same inventive concept, an embodiment of the present invention provides an intelligent terminal, including a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute a data resource allocation method.

[0163] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned 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. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0164] The above are all preferred embodiments of the present application, and are not intended to limit the protection scope of the present application. Any feature disclosed in this specification (including the abstract and drawings), unless otherwise stated, can be replaced by other equivalent or alternative features with similar purposes. That is, unless otherwise stated, each feature is only an example of a series of equivalent or similar features.

Claims

1. A data resource allocation method, It is characterized in that include: Obtain domain width information and domain depth information of the stream of the memory block in the application resource, the memory block includes the shelved memory block and the occupied memory block, find the stream with the same domain width value from the domain width information and generate the corresponding array according to the domain width value; A stream is randomly drawn from any array, and the drawn stream is stored in a shelved memory block from either end to be converted into an occupied memory block; Calculate the domain width difference between the domain width value corresponding to the stream in the occupied memory block and the domain width value corresponding to the preset maximum domain width information; Determine whether the domain width difference is 0; If the domain width difference is 0, the placement and storage of the row of domain depth information corresponding to the current domain width information is completed and a stream is randomly extracted from any array again, and the extracted stream is stored in the shelved memory block from any end to convert it into an occupied memory block, and it is repeatedly determined whether the domain width difference is 0; If the domain width difference is not 0, determine whether there is a flow in the array whose domain width is less than or equal to the domain width difference; If there is a stream, randomly extract a stream from the array whose domain width value is less than or equal to the domain width difference value, and place the stream in the row where the domain depth information corresponding to the occupied memory block is located, and update the occupied memory block to complete the placement and storage of the row where the maximum domain depth information corresponding to the current domain width information is located, and randomly extract a stream from any array again, and store the extracted stream from any end to the shelved memory block to convert it into an occupied memory block, and repeatedly determine whether the domain width difference value is 0; If there is no stream, the placement and storage of the row where the domain depth information corresponding to the current domain width information is located is completed, and a stream is randomly extracted from any array again, and the extracted stream is stored in the shelved memory block from any end to convert it into an occupied memory block, and it is repeatedly determined whether the domain width difference is 0; Until all streams are placed and stored; The storage method of the shelved memory blocks in the same row includes: Update the domain width difference between the sum of the domain width values ​​of the streams in the occupied memory block and the domain width value corresponding to the maximum domain width information; Determine whether the updated domain width difference is 0; If the updated domain width difference is 0, the placement storage of the current row is completed, and a stream is randomly extracted from any array again, and the extracted stream is stored in the shelved memory block from any end to convert it into an occupied memory block, and the domain width difference is repeatedly determined to be 0; If the updated domain width difference is not 0, a stream is randomly selected from the array whose domain width is less than or equal to the domain width difference, and the stream is placed in the row where the domain depth information corresponding to the occupied memory block of the current row is located, so as to update the occupied memory block and repeatedly determine whether the domain width difference is 0; The placement and storage of the current row is completed until the domain width difference is 0, or until there is no array whose domain width is less than or equal to the domain width difference.

2. A data resource allocation method according to claim 1, It is characterized in that When placing a stream in a pending memory block, the stream selection methods include: Sort the array according to the domain width value of the stream; According to the extraction action, the maximum value array is found from the sorted array, and the maximum value array includes the array with the largest domain width value and the value with the smallest domain width value; Extract the stream corresponding to the array with the largest domain width value.

3. A data resource allocation method according to claim 2, It is characterized in that When placing a stream in a pending memory block, the stream selection methods include: Sort the streams in the same array according to their domain depth values; According to the extraction action, find the most valuable flow from the sorted flows, which includes the flow with the largest domain depth value in the same array and the flow with the smallest domain depth value in the same array; Extract the flow with the largest domain depth value.

4. A data resource allocation method according to claim 2, It is characterized in that When placing a stream in a pending memory block, the stream selection methods include: According to the extraction action, it is determined whether there is a flow in the stream with the same domain depth value as that corresponding to the occupied memory block in the same row; If there is a stream in the stream with the same domain depth value as that corresponding to the shelved memory block in the same row, the stream with the same domain depth value is extracted.

5. A data resource allocation method according to claim 4, It is characterized in that When placing a stream in a pending memory block, the stream selection methods include: If there is no stream with the same domain depth value as the one corresponding to the idle memory block in the same row, then extract the streams with a smaller domain depth value than the one corresponding to the occupied memory block in the same row and combine and place them until the domain depth value is the same as the one corresponding to the idle memory block in the same row; If the extracted streams cannot be combined and placed with the domain depth value corresponding to the shelved memory block in the same row, then the streams in the streams that are adjacent to the same row and have a greater domain depth value than the shelved memory block are placed; If there is no adjacent stream in the stream whose domain depth value is greater than the domain depth value corresponding to the shelved memory block in the same row, then place the stream in the stream that is adjacent to the same row and whose domain depth value is less than the domain depth value corresponding to the shelved memory block; If there is no adjacent stream in the stream that is smaller than the domain depth value corresponding to the shelved memory block in the same row, the placement storage is completed.

6. A data resource allocation method according to claim 3, It is characterized in that The method of extracting the stream with the largest domain depth value and storing the stream from the end of the memory block to the shelved memory block includes: Get the domain width value of the reserved memory block in the memory block occupied by the same row; Push the reserved memory block corresponding to the maximum domain width value to the head end in a loop; Determine whether there is a row in the reserved memory block in the same row as the occupied memory block that is larger than the domain width value of the extracted stream; If there is a row whose domain width is larger than the extracted stream, the extracted stream is placed and stored in the smallest row among the rows whose domain width is larger than the extracted stream. If there is no row with a domain width greater than the extracted stream, storage is performed from either end of the row in the shelved memory block where the domain width value is equal to the domain width value corresponding to the maximum domain width information.

7. A resource allocation system for data jump in a stream list, It is characterized in that include: An information acquisition module obtains domain width information and domain depth information of a stream of a memory block in an application resource, wherein the memory block includes a reserved memory block and an occupied memory block, finds a stream with a consistent domain width value from the domain width information, and generates a corresponding array according to the domain width value; A processing module, connected to the information reading module and the judgment module, and used for processing and storing information; The processing module randomly extracts a stream from any array and stores the extracted stream into a shelved memory block from any end to convert it into an occupied memory block; The processing module calculates a domain width difference between a domain width value corresponding to a stream in an occupied memory block and a domain width value corresponding to preset maximum domain width information; A judgment module is used to judge whether the domain width difference is 0; If the judgment module determines that the domain width difference is 0, the processing module completes the placement and storage of the row where the domain depth information corresponding to the current domain width information is located and randomly extracts a stream from any array again, and stores the extracted stream from any end to the shelved memory block to convert it into an occupied memory block, and repeatedly determines whether the domain width difference is 0; If the judgment module determines that the domain width difference is not 0, the judgment module determines whether there is a flow in the array whose domain width value is less than or equal to the domain width difference; If the judgment module determines that there is a stream, the processing module randomly extracts a stream from the array whose domain width value is less than or equal to the domain width difference value, and places the stream in the row where the domain depth information corresponding to the occupied memory block is located, and updates the occupied memory block, completes the placement and storage of the row where the maximum domain depth information corresponding to the current domain width information is located, and randomly extracts a stream from any array again, and stores the extracted stream from any end to the shelved memory block to convert it into an occupied memory block, and repeatedly determines whether the domain width difference value is 0; If the judgment module determines that there is no stream, the processing module completes the placement and storage of the row where the domain depth information corresponding to the current domain width information is located, and randomly extracts a stream from any array again, and stores the extracted stream from any end to the shelved memory block to convert it into an occupied memory block, and repeatedly determines whether the domain width difference is 0; Until all streams are placed and stored; The storage method of the shelved memory blocks in the same row includes: The processing module updates the domain width difference between the sum of the domain width values ​​of the streams in the occupied memory block and the domain width value corresponding to the maximum domain width information; The judging module judges whether the updated domain width difference is 0; If the determination module determines that the updated domain width difference is 0, the processing module completes the placement storage of the current row, and randomly extracts a stream from any array again, stores the extracted stream from any end into the shelved memory block to convert it into an occupied memory block, and repeatedly determines whether the domain width difference is 0; If the determination module determines that the updated domain width difference is not 0, the processing module randomly extracts a stream from the array whose domain width value is less than or equal to the domain width difference, and places the stream in the row where the domain depth information corresponding to the occupied memory block of the current row is located, so as to update the occupied memory block and repeatedly determine whether the domain width difference is 0; Until the domain width difference is 0, or until there is no array whose domain width is less than or equal to the domain width difference, the processing module completes the placement and storage of the current row.

8. An intelligent terminal, It is characterized in that The method comprises a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executes any one of the data resource allocation methods according to claims 1 to 6.

9. A computer-readable storage medium, It is characterized in that The computer program is stored which can be loaded by a processor and executes the data resource allocation method according to any one of claims 1 to 6.