Data output method, device, equipment and medium
By setting up cache queues and priority queues in DRAM and adjusting the data output sequence of FIFO memory, the problem of difficulty in data priority output in DRAM is solved, and data transmission efficiency and system performance are improved.
Patent Information
- Application Number
- CN202410709201.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-06-03
AI Technical Summary
The FIFO memory in dynamic random access memory (DRAM) cannot effectively realize data priority output, which leads to the difficulty and high cost of increasing the core frequency of the internal storage unit when the data transmission speed is increased.
By setting up a cache queue and a priority queue in the FIFO memory, the input data and its priority information are received, and the cache queue is adjusted in response to the clock signal to achieve early output of data with higher priority.
It improves data transmission efficiency, ensures that high-priority data is output faster in each clock cycle, and improves system performance.
Smart Images

Figure CN118277289B
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of memory technology and related technical fields, and in particular, to a data output method, apparatus, device, and medium. Background Art
[0002] Dynamic Random Access Memory (DRAM) is a type of semiconductor memory.
[0003] In the field of dynamic random access memory (DRAM) design, there is a FIFO memory in the internal circuit, which is often called First In First Out. Through the FIFO memory, the data transmission rate is increased, a large amount of data flow is processed, and systems with different transmission rates are matched, thereby improving system performance. The FIFO memory is a first-in-first-out dual-port buffer, that is, the first data to enter it is the first to be removed. One of the ports is the input port of the memory, and the other port is the output port of the memory.
[0004] Based on the inherent properties of FIFO memory, all incoming data follows the principle of first-in, first-out. This means that in some cases, even if the data itself has different priorities, it is still necessary to wait for all the head data to go out before obtaining the tail important data, and it is impossible to output the higher priority data first. With the development of DRAM design, the requirements for data transmission speed are also increasing, but it is difficult and costly to increase the core frequency of the internal storage unit of DRAM. Summary of the invention
[0005] The embodiments described herein provide a data output method, apparatus, device, and medium to solve the problems existing in the prior art.
[0006] According to a first aspect of the present disclosure, there is provided a data output method, comprising:
[0007] receiving input data and priority information of the input data;
[0008] Cache the input data into a cache queue, and store the priority information of the input data into a priority queue, wherein the cache queue corresponds to the priority queue one by one;
[0009] In response to the received clock signal, sending the input data of the first cache bit in the cache queue to the FIFO queue, and outputting the input data of the first cache bit in the FIFO queue;
[0010] In one clock cycle of the clock signal, the cache bit of each input data in the cache queue is adjusted according to the priority information of each input data in the cache queue to obtain a target cache queue.
[0011] In some embodiments of the present disclosure, adjusting the cache bit of each input data in the cache queue according to the priority information of each input data in the cache queue to obtain the target cache queue includes:
[0012] Determine the state information of each input data according to the relationship between the priority information of each input data in the cache queue and the preset priority information, wherein the state information includes an unadjusted state and an adjusted state;
[0013] According to the priority information of each input data and the status information of each input data, the cache bit of each input data in the cache queue is adjusted to obtain a target cache queue.
[0014] In some embodiments of the present disclosure, determining the status information of each input data according to the relationship between the priority information of each input data in the cache queue and the preset priority information includes:
[0015] When the priority information of the input data is equal to the preset priority information, determining that the state information of the input data is a non-adjustment state;
[0016] When the priority information of the input data is greater than the preset priority information, it is determined that the state information of the input data is an adjustment state.
[0017] In some embodiments of the present disclosure, adjusting the cache bit of each input data in the cache queue according to the priority information of each input data and the status information of each input data to obtain the target cache queue includes:
[0018] Adjusting the input data in the cache queue forward by one cache bit as a whole to obtain an initial cache queue;
[0019] Sequentially obtain initial cache bits corresponding to target input data whose state information is an adjustment state;
[0020] Determining a target cache bit of the target input data according to the priority information of the target input data and an initial cache bit corresponding to the target input data;
[0021] The target input data is adjusted to a corresponding target cache bit in the initial cache queue, and the target cache bit and the input data between the initial cache bit and the target cache bit are adjusted backward by one cache bit to obtain a target cache queue.
[0022] In some embodiments of the present disclosure, determining the target cache bit of the target input data according to the priority information of the target input data and the initial cache bit corresponding to the target input data includes:
[0023] Determining the number of adjustment bits of the target input data according to the priority information of the target input data;
[0024] A target cache bit of the target input data is determined according to the number of adjustment bits of the target input data and the initial cache bit corresponding to the target input data.
[0025] In some embodiments of the present disclosure, the step of adjusting the target input data to a corresponding target cache bit in the initial cache queue, and adjusting the target cache bit and the input data between the initial cache bit and the target cache bit backward by one cache bit to obtain a target cache queue includes:
[0026] According to the cache positions of the target input data in the initial cache queue, the target input data are sorted in order of cache positions from low to high to obtain a target input data group, wherein the target input data group includes first target input data, second target input data, ..., Nth target input data;
[0027] The first target input data is adjusted to the corresponding first target cache bit, and the first target cache bit and the input data between the first initial cache bit and the first target cache bit corresponding to the first target input data are adjusted backward by one cache bit to obtain a first target cache queue, until the Nth target input data is adjusted to the corresponding Nth target cache bit, and the Nth target cache bit and the input data between the Nth initial cache bit and the Nth target cache bit corresponding to the Nth target input data are adjusted backward by one cache bit to obtain a target cache queue.
[0028] In some embodiments of the present disclosure, the method further includes:
[0029] The input data of the cache queue and the priority information of the priority queue are obtained.
[0030] According to a second aspect of the present disclosure, there is provided a data output device, comprising:
[0031] An information receiving module, used for receiving input data and priority information of the input data;
[0032] A storage module, used for caching the input data into a cache queue, and storing the priority information of the input data into a priority queue, wherein the cache queue corresponds to the priority queue one by one;
[0033] An output module, configured to send the input data of the first cache bit in the cache queue to the FIFO queue in response to a received clock signal, and output the input data of the first cache bit in the FIFO queue;
[0034] The target cache queue determination module is used to adjust the cache bit of each input data in the cache queue according to the priority information of each input data in the cache queue within a clock cycle of the clock signal to obtain the target cache queue.
[0035] According to a third aspect of the present disclosure, there is provided a computer device, comprising:
[0036] one or more processors;
[0037] a storage device for storing one or more programs,
[0038] When the one or more programs are executed by the one or more processors, the one or more processors implement any method as described in the first aspect.
[0039] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method described in any one of the first aspects is implemented.
[0040] The data output method, device, equipment and medium provided by the embodiment of the present disclosure first receive input data and priority information of the input data; then cache the input data to a cache queue, and store the priority information of the input data to the priority queue; in response to the received clock signal, send the input data of the first cache bit in the cache queue to the FIFO queue, and output the input data of the first cache bit in the FIFO queue; finally, within a clock cycle of the clock signal, adjust the cache bit of each input data in the cache queue according to the priority information of each input data in the cache queue, and obtain the target cache queue. By setting a cache queue and a priority queue in a FIFO memory, after sending the input data of the first cache bit of the cache queue to the FIFO queue at the rising edge of a certain clock signal, within the cycle of the clock signal, by obtaining the priority information of each input data in the cache queue, the cache bit of each input data in the cache queue is adjusted, so as to realize the cache bit of the input data with higher priority being advanced, and within each clock cycle of the clock signal, the cache bit of each input data in the cache queue can be adjusted based on the priority information of the input data, so as to realize the faster transmission of the input data with high priority. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly described below. It should be noted that the drawings described below only relate to some embodiments of the present disclosure, but are not intended to limit the present disclosure, wherein:
[0042] Figure 1 is a flowchart of a data output method provided by an embodiment of the present disclosure;
[0043] Figure 2 It is a structural diagram of an association relationship of a queue provided by an embodiment of the present disclosure;
[0044] Figure 3A-3D is a schematic diagram of a data output process provided by an embodiment of the present disclosure;
[0045] Figure 4 is a structural schematic diagram of a data output device provided by an embodiment of the present disclosure;
[0046] Figure 5 It is a structural diagram of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work also fall within the scope of protection of the present disclosure.
[0048] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by a person skilled in the art to which the subject matter of the present disclosure belongs. It will be further understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the specification and the relevant art, and will not be interpreted in an idealized or overly formal form unless otherwise explicitly defined herein. As used herein, a statement that two or more parts are "connected" or "coupled" together shall mean that the parts are joined together directly or through one or more intermediate components.
[0049] In all embodiments of the present disclosure, terms such as “first” and “second” are used only to distinguish one component (or a part of a component) from another component (or another part of a component).
[0050] Unless the context clearly indicates otherwise, the singular form of the words used herein and in the appended claims includes the plural and vice versa. Thus, when referring to the singular, the plural form of the corresponding term is generally included. Similarly, the words "comprise" and "include" are to be interpreted as inclusive rather than exclusive. Likewise, the terms "include" and "or" should be interpreted as inclusive unless such interpretation is expressly prohibited herein. Where the term "example" is used herein, particularly when it is located after a group of terms, the "example" is merely exemplary and illustrative and should not be considered exclusive or comprehensive.
[0051] Based on the problems existing in the prior art, the present disclosure provides a data output method. Figure 1 is a flow chart of a data output method provided by an embodiment of the present disclosure, such as Figure 1 As shown, the data output method includes:
[0052] S110: Receive input data and priority information of the input data.
[0053] In a specific implementation, in a data output method provided by an embodiment of the present disclosure, input data and priority information of the input data are first received.
[0054] S120 , cache the input data into a cache queue, and store the priority information of the input data into the priority queue.
[0055] Among them, the cache queue corresponds to the priority queue one by one.
[0056] After receiving the input data and the priority information of the input data in step S110, the input data is cached in the cache queue according to the order in which the input data is received, and the priority information of the input data is stored in the priority queue. Since there is a corresponding relationship between the priority queue and the cache queue, the input data can be made to correspond to the priority information of the input data. Figure 2 The association relationship between the queues is exemplified.
[0057] S130 , in response to the received clock signal, sending the input data of the first cache bit in the cache queue to the FIFO queue, and outputting the input data of the first cache bit in the FIFO queue.
[0058] S140 . Within one clock cycle of the clock signal, adjust the cache bit of each input data in the cache queue according to the priority information of each input data in the cache queue to obtain a target cache queue.
[0059] When a clock signal is received, at each rising edge of the clock signal, the input data of the first cache bit in the cache queue is sent to the FIFO queue, and at each rising edge of the clock signal, the input data of the first cache bit in the FIFO queue is output.
[0060] Figure 3A The exemplary embodiment indicates that at the rising edge of the first clock cycle, that is, at time T0, the input data of the first cache bit in the cache queue (that is, D0) is sent to the FIFO queue. Therefore, when the input data of the first cache bit in the cache queue (that is, D0) is sent to the FIFO queue, the input data stored in the cache queue can be moved forward by one cache bit as a whole, and a new input data can be additionally received, and the received new input data is stored in the last cache bit in the cache queue, such as Figure 3B As shown. Since the input data of the first cache bit in the cache queue is sent to the FIFO queue at the rising edge of the first clock cycle, the cache bit of each input data in the cache queue can be adjusted to obtain the target cache queue according to the priority information of each input data in the cache queue during the first clock cycle. When the rising edge of the second clock cycle comes, the input data of the first cache bit of the target cache queue adjusted in the first clock cycle is sent to the FIFO queue. Figure 3C The exemplary embodiment shows that in the first clock cycle, according to the priority information of each input data in the cache queue, the cache bit of each input data in the cache queue is adjusted to obtain the target cache queue. When the rising edge of the second clock cycle comes, that is, at time T1, Figure 3D As shown, the input data of the first cache bit in the cache queue (ie, D1) is sent to the FIFO queue, and the input data of the first cache bit in the FIFO queue (ie, D0) is output. Similarly, in the second clock cycle, the cache bits of each input data in the cache queue can be adjusted according to the priority information of each input data in the cache queue to obtain the target cache queue. When the rising edge of the third clock cycle comes, the input data of the first cache bit of the target cache queue adjusted in the second clock cycle is sent to the FIFO queue.
[0061] It should be noted that at the rising edge of the first clock cycle, if there is no cached input data in the FIFO queue, only the input data of the first cache bit in the cache queue will be sent to the FIFO queue at the rising edge of the first clock cycle, and at the rising edge of the second clock cycle, the input data of the first cache bit in the updated target cache queue will be sent to the FIFO queue, and the input data of the first cache bit in the FIFO queue will be output (the input data of the first cache bit in the FIFO queue is the input data of the first cache bit sent by the cache queue at the rising edge of the first clock cycle).
[0062] The data output method provided by the embodiment of the present disclosure first receives input data and priority information of the input data; then caches the input data to a cache queue, and stores the priority information of the input data to the priority queue; in response to the received clock signal, sends the input data of the first cache bit in the cache queue to the FIFO queue, and outputs the input data of the first cache bit in the FIFO queue; finally, within a clock cycle of the clock signal, according to the priority information of each input data in the cache queue, adjusts the cache bit of each input data in the cache queue to obtain a target cache queue. By setting a cache queue and a priority queue in a FIFO memory, after the input data of the first cache bit of the cache queue is sent to the FIFO queue at the rising edge of a certain clock signal, within the cycle of the clock signal, by obtaining the priority information of each input data in the cache queue, the cache bit of each input data in the cache queue is adjusted, so as to advance the cache bit of the input data with higher priority, and within each clock cycle of the clock signal, the cache bit of each input data in the cache queue can be adjusted based on the priority information of the input data, so as to transmit the high-priority input data faster.
[0063] In a specific implementation, according to the priority information of each input data in the cache queue, the cache bit of each input data in the cache queue is adjusted to obtain a target cache queue, including: determining the status information of each input data according to the relationship between the priority information of each input data in the cache queue and the preset priority information, wherein the status information includes an unadjusted status and an adjusted status; according to the priority information of each input data and the status information of each input data, the cache bit of each input data in the cache queue is adjusted to obtain the target cache queue.
[0064] Specifically, based on the relationship between the priority information of each input data in the cache queue and the preset priority information, the status information of each input data is determined, including: when the priority information of the input data is equal to the preset priority information, the status information of the input data is determined to be an unadjusted state; when the priority information of the input data is greater than the preset priority information, the status information of the input data is determined to be an adjusted state.
[0065] Among them, the preset priority information is 1.
[0066] Specifically, if the priority information of the input data in the cache queue is greater than 1, it indicates that the priority of the input data is higher, and the cache bit of the input data in the cache queue needs to be adjusted forward. The specific number of cache bits adjusted forward is the same as the priority information of the input data. The larger the priority information, the higher the priority of the input data, and the more cache bits need to be adjusted forward in the cache queue.
[0067] Therefore, in the embodiment of the present disclosure, the relationship between the priority information of each input data in the cache queue and the preset priority information is first obtained, and then the status information of each input data is determined according to the relationship between the priority information of each input data in the cache queue and the preset priority information. That is, by comparing the relationship between the priority information of the input data and the preset priority information, the status information of the input data is divided into an adjustment state and a non-adjustment state, and then the cache bits of the input data in the adjustment state are adjusted forward, and the cache bits of the input data in the non-adjustment state are adjusted along with the adjustment of the cache bits of the input data in the adjustment state to obtain the target cache queue.
[0068] As a specific implementation method, according to the priority information of each input data and the status information of each input data, the cache bit of each input data in the cache queue is adjusted to obtain a target cache queue, including: sequentially obtaining the initial cache bit corresponding to the target input data whose status information is the adjustment state; determining the target cache bit of the target input data according to the priority information of the target input data and the initial cache bit corresponding to the target input data; adjusting the input data in the cache queue as a whole forward by one cache bit to obtain an initial cache queue; adjusting the target input data to the corresponding target cache bit in the initial cache queue, and adjusting the target cache bit and the input data between the initial cache bit and the target cache bit backward by one cache bit to obtain the target cache queue.
[0069] Among them, determining the target cache bit of the target input data according to the priority information of the target input data and the initial cache bit corresponding to the target input data includes: determining the number of adjustment bits of the target input data according to the priority information of the target input data; determining the target cache bit of the target input data according to the number of adjustment bits of the target input data and the initial cache bit corresponding to the target input data.
[0070] Adjusting the target input data to the corresponding target cache bit in the initial cache queue, and adjusting the target cache bit and the input data between the initial cache bit and the target cache bit backward by one cache bit to obtain the target cache queue, comprising: sorting the target input data in an ascending order of the cache bit according to the cache bit of the target input data in the initial cache queue to obtain a target input data group, wherein the target input data group comprises first target input data, second target input data, ..., Nth target input data;
[0071] The first target input data is adjusted to the corresponding first target cache bit, and the first target cache bit and the input data between the first initial cache bit and the first target cache bit corresponding to the first target input data are adjusted backward by one cache bit to obtain a first target cache queue, until the Nth target input data is adjusted to the corresponding Nth target cache bit, and the Nth target cache bit and the input data between the Nth initial cache bit and the Nth target cache bit corresponding to the Nth target input data are adjusted backward by one cache bit to obtain a target cache queue.
[0072] Combination Figure 3A-3D , at the rising edge of the first clock cycle, that is, at time T0, the input data of the first cache bit in the cache queue (that is, D0) is sent to the FIFO queue. At this time, the cache queue as a whole is moved forward by one cache bit, and the cache queue can additionally receive a new input data (that is, D8), and store the received new input data in the last cache bit in the cache queue. Since the input data of the first cache bit in the cache queue is sent to the FIFO queue at the rising edge of the first clock cycle, before the rising edge of the second clock cycle, that is, within the time of the first clock cycle, the cache bits of each input data in the cache queue can be adjusted according to the priority information of each input data in the cache queue to obtain the target cache queue. The specific adjustment method is: first, the input data in the cache queue is adjusted forward by one cache bit as a whole to obtain an initial cache queue. The obtained initial cache queue is as follows: Figure 3B As shown, after obtaining the initial cache queue, the target cache position of the target input data is determined according to the priority information of the target input data and the initial cache position corresponding to the target input data, and finally the target input data with the state information of the adjustment state is adjusted to the corresponding target cache position in turn, and the input data of the target cache position and the input data between the initial cache position and the target cache position are adjusted backward by one cache position to obtain the target cache queue. Exemplarily, combined with Figure 3BIn the initial cache queue, the target input data whose state information is the adjustment state include D3, D5 and D8, the initial cache bit of the target input data D3 is the third cache bit, the initial cache bit of the target input data D5 is the fifth cache bit, and the initial cache bit of the target input data D8 is the eighth cache bit. The priority information of the target input data D3 is 2, the priority information of the target input data D5 is 3, and the priority information of the target input data D8 is 2. Then the number of adjustment bits of the target input data D3 is 1, the number of adjustment bits of the target input data D5 is 2, and the number of adjustment bits of the target input data D8 is 1. Therefore, it can be determined that the target cache bit of the target input data D3 is the second cache bit, the target cache bit of the target input data D5 is the third cache bit, and the target cache bit of the target input data D8 is the seventh cache bit. After determining the target cache bit of each target input data, in the initial cache queue, the target input data D3 is adjusted forward by one cache bit on the basis of the initial cache bit to obtain the target cache bit of the target input data D3, and the target input data D5 is adjusted forward by two cache bits on the basis of the initial cache bit to obtain the target input The target cache position of the input data D5 is obtained by adjusting the target input data D8 forward by one cache position on the basis of the initial cache position, that is, firstly adjusting the target input data D3 from the third cache position to the second cache position in the initial cache queue, and adjusting the input data D2 of the second cache position backward by one cache position, that is, adjusting the input data D2 of the second cache position to the third cache position, and then adjusting the target input data D5 from the fifth cache position to the third cache position in the initial cache queue after adjusting the target cache data D3, adjusting the input data between the fifth cache position and the third cache position (that is, the input data D4 of the fourth cache position) and the input data D2 of the third cache position backward by one cache position, that is, adjusting the input data D4 of the fourth cache position to the fifth cache position, and adjusting the input data D2 of the third cache position to the fourth cache position, and finally adjusting the target input data D8 from the eighth cache position to the seventh cache position, and adjusting the input data D7 of the seventh cache position backward by one cache position, that is, adjusting the input data D7 of the seventh cache position to the eighth cache position, to obtain the final target cache queue as shown in FIG. Figure 3C shown.
[0073] Based on the above embodiment, the data output method provided by the embodiment of the present disclosure also includes:
[0074] Get the input data of the cache queue and the priority information of the priority queue.
[0075] Combination Figure 3DAt the rising edge of the second clock cycle, the first cached input data of the target cache queue is sent to the FIFO queue, that is, the input data D1 is sent to the FIFO queue. At this time, the cache queue as a whole moves forward by one cache bit, and the last cache bit of the cache queue caches a new input data. At this time, it is necessary to re-acquire the priority information of the priority queue of the input data of the cache queue.
[0076] Based on the above embodiments, Figure 4 is a structural diagram of a data output device provided by an embodiment of the present disclosure, such as Figure 4 As shown, a data output device comprises:
[0077] An information receiving module 410, configured to receive input data and priority information of the input data;
[0078] The storage module 420 is used to cache the input data into the cache queue, and store the priority information of the input data into the priority queue, wherein the cache queue corresponds to the priority queue one by one;
[0079] An output module 430, for sending the input data of the first cache bit in the cache queue to the FIFO queue in response to the received clock signal, and outputting the input data of the first cache bit in the FIFO queue;
[0080] The target cache queue determination module 440 is used to adjust the cache bit of each input data in the cache queue according to the priority information of each input data in the cache queue within one clock cycle of the clock signal to obtain the target cache queue.
[0081] The data output device provided by the embodiment of the present disclosure first receives input data and priority information of the input data; then caches the input data to a cache queue, and stores the priority information of the input data to the priority queue; in response to the received clock signal, sends the input data of the first cache bit in the cache queue to the FIFO queue, and outputs the input data of the first cache bit in the FIFO queue; finally, within a clock cycle of the clock signal, according to the priority information of each input data in the cache queue, adjusts the cache bit of each input data in the cache queue to obtain a target cache queue. By setting a cache queue and a priority queue in a FIFO memory, after sending the input data of the first cache bit of the cache queue to the FIFO queue at the rising edge of a certain clock signal, within the cycle of the clock signal, by obtaining the priority information of each input data in the cache queue, the cache bit of each input data in the cache queue is adjusted based on the priority information of each input data, so as to advance the cache bit of the input data with higher priority, and within each clock cycle of the clock signal, the cache bit of each input data in the cache queue can be adjusted based on the priority information of the input data, so as to transmit the high-priority input data faster.
[0082] In a specific implementation, according to the priority information of each input data in the cache queue, the cache bit of each input data in the cache queue is adjusted to obtain the target cache queue, including:
[0083] Determine the state information of each input data according to the relationship between the priority information of each input data in the cache queue and the preset priority information, wherein the state information includes an unadjusted state and an adjusted state;
[0084] According to the priority information of each input data and the status information of each input data, the cache position of each input data in the cache queue is adjusted to obtain a target cache queue.
[0085] In a specific implementation manner, determining the status information of each input data according to the relationship between the priority information of each input data in the cache queue and the preset priority information includes:
[0086] When the priority information of the input data is equal to the preset priority information, determining that the state information of the input data is a non-adjustment state;
[0087] When the priority information of the input data is greater than the preset priority information, it is determined that the state information of the input data is an adjustment state.
[0088] In a specific implementation, according to the priority information of each input data and the status information of each input data, the cache bit of each input data in the cache queue is adjusted to obtain the target cache queue, including:
[0089] Sequentially obtain initial cache bits corresponding to target input data whose state information is an adjustment state;
[0090] Determining a target cache bit of the target input data according to the priority information of the target input data and the initial cache bit corresponding to the target input data;
[0091] The input data in the cache queue is adjusted forward by one cache bit as a whole to obtain an initial cache queue;
[0092] In the initial cache queue, the target input data is adjusted to the corresponding target cache bit, and the target cache bit and the input data between the initial cache bit and the target cache bit are adjusted backward by one cache bit to obtain a target cache queue.
[0093] In a specific implementation manner, determining a target cache bit of the target input data according to the priority information of the target input data and the initial cache bit corresponding to the target input data includes:
[0094] Determine the adjustment number of the target input data according to the priority information of the target input data;
[0095] The target cache bit of the target input data is determined according to the adjustment bit number of the target input data and the initial cache bit corresponding to the target input data.
[0096] In a specific implementation, the target input data is adjusted to the corresponding target cache bit in the initial cache queue, and the target cache bit and the input data between the initial cache bit and the target cache bit are adjusted backward by one cache bit to obtain the target cache queue, including:
[0097] According to the cache positions of the target input data in the initial cache queue, the target input data are sorted in order of the cache positions from low to high to obtain a target input data group, wherein the target input data group includes the first target input data, the second target input data, ..., the Nth target input data;
[0098] The first target input data is adjusted to the corresponding first target cache bit, and the first target cache bit and the input data between the first initial cache bit and the first target cache bit corresponding to the first target input data are adjusted backward by one cache bit to obtain a first target cache queue, until the Nth target input data is adjusted to the corresponding Nth target cache bit, and the Nth target cache bit and the input data between the Nth initial cache bit and the Nth target cache bit corresponding to the Nth target input data are adjusted backward by one cache bit to obtain a target cache queue.
[0099] In a specific embodiment, the device further comprises:
[0100] The input data of the cache queue and the priority information of the priority queue are obtained.
[0101] The present application also provides a computer device. Figure 5 , Figure 5 This is a basic structural block diagram of the computer device in this embodiment.
[0102] The computer device includes a memory 510 and a processor 520 that are connected to each other through a system bus. It should be noted that the figure only shows a computer device with components 510-520, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA), digital signal processors (Digital Signal Processor, DSP), embedded devices, etc.
[0103] Computer devices can be computing devices such as desktop computers, notebooks, PDAs, and cloud servers. Computer devices can interact with users through keyboards, mice, remote controls, touch pads, or voice control devices.
[0104] The memory 510 includes at least one type of readable storage medium, and the readable storage medium includes a non-volatile memory or a volatile memory, such as a flash memory, a hard disk, a multimedia card, a card-type memory (such as an SD or DX memory, etc.), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc., and the RAM may include a static RAM or a dynamic RAM. In some embodiments, the memory 510 may be an internal storage unit of a computer device, such as a hard disk or a memory of the computer device. In other embodiments, the memory 510 may also be an external storage device of a computer device, such as a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, or a flash card (Flash Card), etc., equipped on the computer device. Of course, the memory 510 may also include both an internal storage unit of the computer device and an external storage device thereof. In this embodiment, the memory 510 is generally used to store an operating system and various application software installed on the computer device, such as the program code of the above method, etc. In addition, the memory 510 may also be used to temporarily store various data that have been output or are to be output.
[0105] The processor 520 is generally used to perform the overall operation of the computer device. In this embodiment, the memory 510 is used to store program codes or instructions, the program code includes computer operation instructions, and the processor 520 is used to execute the program codes or instructions stored in the memory 510 or process data, such as running the program code of the above method.
[0106] In this article, the bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus system can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0107] Another embodiment of the present application also provides a computer-readable medium, which may be a computer-readable signal medium or a computer-readable medium. A processor in a computer reads a computer-readable program code stored in the computer-readable medium, so that the processor can execute the functional actions specified in each step or a combination of steps in the above method; and generate a device for implementing the functional actions specified in each block or a combination of blocks in the block diagram.
[0108] Computer-readable media include but are not limited to electronic, magnetic, optical, electromagnetic, infrared memory or semiconductor systems, devices or apparatuses, or any appropriate combination of the foregoing, the memory is used to store program codes or instructions, the program codes include computer operating instructions, and the processor is used to execute the program codes or instructions of the above methods stored in the memory.
[0109] For the definitions of memory and processor, please refer to the description of the aforementioned computer device embodiment and will not be repeated here.
[0110] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0111] Each functional unit or module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0112] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., and other media that can store program codes.
[0113] Unless the context clearly indicates otherwise, the singular form of the words used herein and in the appended claims includes the plural and vice versa. Thus, when referring to the singular, the plural form of the corresponding term is generally included. Similarly, the words "comprise" and "include" are to be interpreted as inclusive rather than exclusive. Likewise, the terms "include" and "or" should be interpreted as inclusive unless such interpretation is expressly prohibited herein. Where the term "example" is used herein, particularly when it is located after a group of terms, the "example" is merely exemplary and illustrative and should not be considered exclusive or comprehensive.
[0114] Further aspects and scopes of adaptability become apparent from the description provided herein. It should be understood that various aspects of the present application can be implemented individually or in combination with one or more other aspects. It should also be understood that the description and specific embodiments herein are intended for purposes of illustration only and are not intended to limit the scope of the present application.
[0115] Several embodiments of the present disclosure are described in detail above, but it is obvious that those skilled in the art can make various modifications and variations to the embodiments of the present disclosure without departing from the spirit and scope of the present disclosure. The protection scope of the present disclosure is defined by the attached claims.
Claims
1. A data output method, It is characterized in that include: receiving input data and priority information of the input data; Cache the input data into a cache queue, and store the priority information of the input data into a priority queue, wherein the cache queue corresponds to the priority queue one by one; In response to the received clock signal, sending the input data of the first cache bit in the cache queue to the FIFO queue, and outputting the input data of the first cache bit in the FIFO queue; In one clock cycle of the clock signal, according to the priority information of each input data in the cache queue, the cache bit of each input data in the cache queue is adjusted to obtain a target cache queue; The step of adjusting the cache bit of each input data in the cache queue according to the priority information of each input data in the cache queue to obtain the target cache queue includes: Determine the state information of each input data according to the relationship between the priority information of each input data in the cache queue and the preset priority information, wherein the state information includes an unadjusted state and an adjusted state; According to the priority information of each input data and the status information of each input data, the cache bit of each input data in the cache queue is adjusted to obtain a target cache queue.
2. The method according to claim 1, It is characterized in that The determining, according to the relationship between the priority information of each input data in the cache queue and the preset priority information, the status information of each input data includes: When the priority information of the input data is equal to the preset priority information, determining that the state information of the input data is a non-adjustment state; When the priority information of the input data is greater than the preset priority information, it is determined that the state information of the input data is an adjustment state.
3. The method according to claim 1, It is characterized in that The step of adjusting the cache bit of each input data in the cache queue according to the priority information of each input data and the status information of each input data to obtain a target cache queue comprises: Adjusting the input data in the cache queue forward by one cache bit as a whole to obtain an initial cache queue; Sequentially obtain initial cache bits corresponding to target input data whose state information is an adjustment state; Determining a target cache bit of the target input data according to the priority information of the target input data and an initial cache bit corresponding to the target input data; The target input data is adjusted to a corresponding target cache bit in the initial cache queue, and the target cache bit and the input data between the initial cache bit and the target cache bit are adjusted backward by one cache bit to obtain a target cache queue.
4. The method according to claim 3, It is characterized in that The step of determining a target cache bit of the target input data according to the priority information of the target input data and the initial cache bit corresponding to the target input data comprises: Determining the number of adjustment bits of the target input data according to the priority information of the target input data; A target cache bit of the target input data is determined according to the number of adjustment bits of the target input data and the initial cache bit corresponding to the target input data.
5. The method according to claim 3, It is characterized in that The step of adjusting the target input data to the corresponding target cache bit in the initial cache queue, and adjusting the target cache bit and the input data between the initial cache bit and the target cache bit backward by one cache bit to obtain the target cache queue comprises: According to the cache positions of the target input data in the initial cache queue, the target input data are sorted in order of cache positions from low to high to obtain a target input data group, wherein the target input data group includes first target input data, second target input data, ..., Nth target input data; The first target input data is adjusted to the corresponding first target cache bit, and the first target cache bit and the input data between the first initial cache bit and the first target cache bit corresponding to the first target input data are adjusted backward by one cache bit to obtain a first target cache queue, until the Nth target input data is adjusted to the corresponding Nth target cache bit, and the Nth target cache bit and the input data between the Nth initial cache bit and the Nth target cache bit corresponding to the Nth target input data are adjusted backward by one cache bit to obtain a target cache queue.
6. The method according to claim 1, It is characterized in that The method further comprises: The input data of the cache queue and the priority information of the priority queue are obtained.
7. A data output device, It is characterized in that include: An information receiving module, used for receiving input data and priority information of the input data; A storage module, used for caching the input data into a cache queue, and storing the priority information of the input data into a priority queue, wherein the cache queue corresponds to the priority queue one by one; An output module, configured to send the input data of the first cache bit in the cache queue to the FIFO queue in response to a received clock signal, and output the input data of the first cache bit in the FIFO queue; a target cache queue determination module, configured to adjust the cache bit of each input data in the cache queue according to the priority information of each input data in the cache queue within one clock cycle of the clock signal to obtain a target cache queue; The step of adjusting the cache bit of each input data in the cache queue according to the priority information of each input data in the cache queue to obtain the target cache queue includes: Determine the state information of each input data according to the relationship between the priority information of each input data in the cache queue and the preset priority information, wherein the state information includes an unadjusted state and an adjusted state; According to the priority information of each input data and the status information of each input data, the cache bit of each input data in the cache queue is adjusted to obtain a target cache queue.
8. A computer device, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and system for processing asynchronous message queue
CN105068864A
