Linked list data structure and data processing method therefor, storage medium, and electronic device

Through the design of multi-headed linked list structure and related management units, efficient data reading of linked list data structure is realized, solving the problem of low data reading efficiency in the existing technology, and improving data reading efficiency and system bandwidth.

WO2024187704A9PCT designated stage expired Publication Date: 2024-12-12BEIJING JAGUAR MICROSYSTEMS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/117916
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-13
Filing Date
2023-09-11
Publication Date
2024-12-12

AI Technical Summary

Technical Problem

The existing linked list data structures are low in data reading due to the RAM reading delay when reading data, and cannot meet the design requirements of high bandwidth requirements.

Method used

Using a multi-headed link list structure, the idle address management unit, the write operation sub-chain indication unit, the read operation sub-chain indication unit, the sub-chain length unit, the write pointer unit and the read pointer unit can realize the continuous n data written in one clock cycle. and read out to improve data reading efficiency.

Benefits of technology

Read commands can be initiated and data output in each clock cycle, which significantly improves the data reading efficiency of linked list data structures and meets the design requirements of high bandwidth requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023117916_12122024_PF_FP_ABST
    Figure CN2023117916_12122024_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to a linked list data structure and a data processing method therefor, a storage medium, and an electronic device. The linked list data structure comprises an RAM, an idle address management unit, and a multi-head linked list; the multi-head linked list comprises a control unit, a write operation sub-link indication unit, a read operation sub-link indication unit, and n sub-links; each sub-link comprises a sub-link length unit, a write pointer unit, and a read pointer unit. On the basis of the linked list data structure of the present application, a read command is initiated in each clock cycle by means of an n-head linked list, and data can be outputted in each clock cycle.
Need to check novelty before this filing date? Find Prior Art

Description

A linked list data structure and data processing method thereof, storage medium, and electronic device

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on March 13, 2023, with application number 2023102331281 and invention name “A linked list data structure and its data processing method, storage medium, and electronic device”. The entire contents of the patent application are incorporated into this application by reference. Technical Field

[0003] The present application relates to the technical field of linked list data reading and writing, and specifically to a linked list data structure and a data processing method thereof, a computer-readable storage medium, and an electronic device. Background Art

[0004] A linked list data structure is often required in digital circuit design, as shown in Figure 1. In a linked list data structure, each data is followed by a pointer, which points to the address of the next data. Usually, the data and pointer contents are stored in RAM (Random Access Memory), and the pointer contents are the addresses of these data in RAM. When a data is read from RAM, the data and its corresponding pointer contents are read together. Therefore, the address of the next data and its corresponding pointer contents in RAM can be determined based on the pointer contents corresponding to the data, so that the RAM can be accessed based on the address to read the next data and its corresponding pointer contents.

[0005] Because RAM typically has read latency, existing linked-list data structure data reading methods typically require three to four clock cycles from initiating a read request to receiving a read result. Therefore, after reading one piece of data, it takes three to four clock cycles before the address of the next piece of data is known and the next piece of data can be read. This results in low data reading efficiency for linked-list data structures. The existing linked-list data structure data reading method is specifically illustrated in Figure 2. In Figure 2, after a read command is initiated at address A0 at time T0, data D0 is obtained at time T3 after three clock cycles. In the next clock cycle, T4, the address A1 of the next hop data is obtained based on data D0, and a read command is initiated. It still takes another three clock cycles to obtain the next piece of data, D1. In Figure 2, one piece of data is read in an average of four clock cycles. Such performance is insufficient for many designs with high bandwidth requirements, where one data point is typically read out in one clock cycle. Taking a 1GHz system clock and 512b data width as an example, if one data point is read out in four clock cycles, the system bandwidth is only 128Gbps. If one data point is read out in one clock cycle, the system bandwidth can reach 512Gbps.

[0006] Summary of the Invention

[0007] The purpose of this application is to propose a linked list data structure and a data processing method thereof, a computer-readable storage medium, and an electronic device.

[0008] To achieve the above objectives, according to a first aspect of the present application, a linked list data structure is provided, comprising a RAM, a free address management unit, and a multi-head linked list, wherein the multi-head linked list comprises a control unit, a write operation subchain indication unit, a read operation subchain indication unit, and n subchains, where n is a positive integer ≥ 2; the subchain comprises a control unit, a subchain length unit, a write pointer unit, and a read pointer unit; the RAM comprises a plurality of data units and a plurality of pointer storage units corresponding one-to-one to the plurality of data units, wherein any data unit and a corresponding pointer storage unit share an address of the RAM;

[0009] The data unit is used to store data;

[0010] The pointer unit is used to store an address; wherein, if a data unit is used to store the i-th data of a sub-chain, the pointer unit corresponding to the data unit is used to store the address of the data unit where the i+1-th data of the sub-chain is located;

[0011] The idle address management unit is used to manage the idle addresses of the RAM; and when it receives a read idle address request from the control unit, it outputs an idle address to the control unit;

[0012] The write operation subchain indication unit is used to store the subchain number of the write target subchain, and the write target subchain is the subchain to which the data to be written is to be written;

[0013] The read operation subchain indicating unit is used to store the subchain number of the read target subchain, where the subchain number of the read target subchain is the subchain where the data to be read is located;

[0014] The sub-chain length unit is used to store sub-chain length information, which is the number of data currently stored in the sub-chain;

[0015] The write pointer unit is used to store the address of the current data written into the multi-head linked list in the RAM;

[0016] The read pointer unit is used to store the address of the next read data of the multi-head linked list in the RAM;

[0017] The control unit is used to determine the write target sub-chain according to the sub-chain number stored in the write operation sub-chain indication unit when it receives a write data request, and perform a write data operation according to the idle address, the sub-chain length information stored in the sub-chain length unit of the write target sub-chain, and the address stored in the write pointer unit; and, when it receives a read data request, determine the read target sub-chain according to the sub-chain number stored in the read operation sub-chain indication unit, and perform a read data operation according to the address stored in the read pointer unit of the read target sub-chain.

[0018] Based on the linked list data structure provided in the first aspect of the present application, when storing n consecutive data, one data is written into a sub-chain in one clock cycle, and the n data are written into the n sub-chains of the n-head linked list in sequence in n consecutive clock cycles to complete the writing of the n data. Therefore, when subsequently reading the n consecutive data, one data is read out from a sub-chain in one clock cycle, and the n sub-chains are read in sequence in n consecutive clock cycles to obtain the n data. Therefore, the read command is initiated in each clock cycle through the n-head linked list, and data can be output in each clock cycle.

[0019] According to a second aspect of the present application, there is provided a data processing method for the above-mentioned linked list data structure, the method comprising: when the control unit receives a write data request, performing a write data operation;

[0020] The performing of the data writing operation includes:

[0021] Acquire the data to be written according to the write data request;

[0022] Read the subchain number stored in the write operation subchain indication unit, determine the write target subchain according to the subchain number stored in the write operation subchain indication unit, and obtain the subchain length information stored in the subchain length unit of the write target subchain and the address stored in the write pointer unit of the write target subchain;

[0023] Sending a read idle address request to the idle address management unit, and receiving an idle address returned by the idle address management unit;

[0024] Writing the data to be written into the data unit corresponding to the idle address in the RAM;

[0025] Determine, based on the sub-chain length information stored in the sub-chain length unit of the write target sub-chain, whether to write the idle address into the pointer storage unit in the RAM corresponding to the address stored in the write pointer unit of the write target sub-chain;

[0026] Update the subchain number stored in the write operation subchain indication unit to the subchain number of the next write target subchain;

[0027] Updating the address stored in the write pointer unit of the write target subchain to the idle address;

[0028] The sub-chain length information stored in the sub-chain length unit of the write target sub-chain is updated according to the number of data currently stored in the write target sub-chain.

[0029] The data processing method provided in the second aspect of the present application is implemented based on the linked list data structure provided in the first aspect of the present application. When storing n consecutive data, one data is written into a sub-chain in one clock cycle, and the n data are written into the n sub-chains of the n-head linked list in sequence in n consecutive clock cycles to complete the writing of the n data. Correspondingly, when reading the n consecutive data subsequently, one data can be read out from a sub-chain in one clock cycle, and the data of the n sub-chains are read in sequence in n consecutive clock cycles to obtain the n data. Therefore, a read command is initiated in each clock cycle through the n-head linked list, and data can be output in each clock cycle.

[0030] According to a third aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the data processing method according to the second aspect of the present application is implemented.

[0031] According to the fourth aspect of the present application, an electronic device is provided, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the data processing method according to the second aspect of the present application is implemented.

[0032] According to a fifth aspect of the present application, there is provided a chip, comprising: a processor and a memory;

[0033] The processor is used to call and run a computer program from the memory, so that the device equipped with the chip executes the data processing method described in the second aspect of this application.

[0034] According to a sixth aspect of the present application, a computer program product is provided, which includes relevant program instructions, and when the relevant program instructions are executed, the data processing method described in the second aspect of the present application is implemented.

[0035] According to a seventh aspect of the present application, a computer program is provided, comprising program instructions. When executed on an electronic device, the program instructions enable the computer device to execute the data processing method described in the second aspect of the present application.

[0036] According to the eighth aspect of the present application, a device is provided, which may include: at least one processor, in which the relevant program instructions are executed so that the device implements the data processing method as described in the second aspect of the present application.

[0037] Other features and advantages of the present application will be set forth in the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required in the embodiments or related technology descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0039] FIG1 is a schematic diagram of a linked list data structure in the related art.

[0040] FIG. 2 is a schematic diagram of a data reading process of a linked list data structure in the related art.

[0041] FIG3 is a schematic diagram of a linked list data structure in one embodiment of the present application.

[0042] FIG4 is a schematic diagram of a reading and writing process of a linked list data structure in an embodiment of the present application.

[0043] FIG5 is a flowchart of executing a data write operation in one embodiment of the present application.

[0044] FIG6 is a schematic diagram of a data writing process of a multi-head linked list in an embodiment of the present application.

[0045] FIG7 is a flowchart of performing a data read operation in one embodiment of the present application. DETAILED DESCRIPTION

[0046] The detailed description of the accompanying drawings is intended to serve as an illustration of the present optional embodiments of the present application, and is not intended to represent the only form in which the present application can be implemented. It should be understood that the same or equivalent functions can be accomplished by different embodiments intended to be included in the spirit and scope of the present application.

[0047] An embodiment of the present application provides a linked list data structure. Referring to Figure 3, the linked list data structure of this embodiment includes a RAM, a free address management unit, and a multi-head linked list. The multi-head linked list includes a control unit, a write operation sub-chain indication unit, a read operation sub-chain indication unit, and n sub-chains, where n is a positive integer ≥2; the n sub-chains each include a sub-chain length unit, a write pointer unit, and a read pointer unit; the RAM includes multiple data units and multiple pointer storage units corresponding to the multiple data units one by one, and any data unit and a corresponding pointer storage unit share an address of the RAM.

[0048] The data unit is used to store data; specifically, one data unit stores one data.

[0049] The pointer storage unit is used to store addresses; illustratively, one pointer storage unit stores one address; wherein, if a data unit is used to store the i-th data of a sub-chain, then the pointer storage unit corresponding to the data unit is used to store the address of the data unit where the i+1-th data of the sub-chain is located, that is, the address stored in the pointer storage unit is used to represent the relationship between the two data.

[0050] The idle address management unit is used to manage the idle addresses of the RAM; and when it receives a request to read an idle address from the control unit, it outputs an idle address to the control unit.

[0051] The write operation sub-chain indication unit is used to store the sub-chain number of the write target sub-chain, and the write target sub-chain is the sub-chain to which the data to be written is to be written; specifically, the write operation sub-chain indication unit provides a write target sub-chain indication. According to the indication of the write operation sub-chain indication unit, the control unit learns which sub-chain the data to be written needs to be written to. For a multi-head linked list, only one data is written to one sub-chain in each clock cycle. In the next clock cycle, if data is to be written, the data will be written to the next sub-chain in the next clock cycle.

[0052] The read operation sub-chain indication unit is used to store the sub-chain number of the read target sub-chain, and the sub-chain number of the read target sub-chain is the sub-chain where the data to be read is located; specifically, the read operation sub-chain indication unit provides a read target sub-chain indication. According to the indication of the read operation sub-chain indication unit, the control unit learns which sub-chain the data to be read is stored in. For a multi-head linked list, only one data is read from one sub-chain in each clock cycle. In the next clock cycle, if data is to be read, the data will be read from the next sub-chain in the next clock cycle. The reading of data corresponds to the order of data writing.

[0053] The sub-chain length unit is used to store sub-chain length information, which is the number of data currently stored in the sub-chain.

[0054] The write pointer unit is used to store the address of the current data written into the multi-head linked list in the RAM; specifically, the address stored in the write pointer unit is updated after the data is written;

[0055] The read pointer unit is used to store the address of the next data to be read out of the multi-head linked list in the RAM; specifically, the address stored in the read pointer unit is updated after the data is read out;

[0056] The control unit is configured to, when receiving a write data request, determine a write target subchain according to the subchain number stored in the write operation subchain indication unit, and perform a write data operation according to the idle address, the subchain length information stored in the subchain length unit of the write target subchain, and the address stored in the write pointer unit; and, when receiving a read data request, determine a read target subchain according to the subchain number stored in the read operation subchain indication unit, and perform a read data operation according to the address stored in the read pointer unit of the read target subchain;

[0057] It should be noted that the linked list data structure of this embodiment may include one or more multi-headed linked lists, and the structure and working principle of each multi-headed linked list are the same. Therefore, this embodiment is explained with a multi-headed linked list. The number n of sub-chains of each multi-headed linked list is determined by the time taken to read the linked list data. For example, in the multi-headed linked list reading process shown in Figure 4, in Figure 4, n takes a value of 4. The reason is that when a read data request is initiated in the T8 clock cycle, the data with the address A8 of the first sub-chain is read, and the data with the address A8 is returned in the T11 clock cycle, that is, the time taken to read one data is 4 clock cycles. Therefore, the number n of sub-chains of the multi-headed linked list is set to 4 to achieve data reading in each clock cycle; generally speaking, it takes 3 to 4 clock cycles to read one data, and n can be set to 3 or 4, depending on the time taken to read the data.

[0058] Please continue to refer to Figure 4. In this embodiment, when writing data, it is written to each sub-chain in sequence, that is, data D0 is written to address A0 of the first sub-chain in the T0 clock cycle, data D1 is written to address A1 of the second sub-chain in the T1 clock cycle, data D2 is written to address A2 of the third sub-chain in the T2 clock cycle, and data D3 is written to address A3 of the second sub-chain in the T3 clock cycle.

[0059] When reading data, data is read from each sub-chain in turn, that is: data at address A8 is read from the first sub-chain in the T8 clock cycle, data at address A9 is read from the second sub-chain in the T9 clock cycle, data at address A10 is read from the third sub-chain in the T10 clock cycle, and data at address A11 is read from the fourth sub-chain in the T11 clock cycle. In addition, data D8 at address A8 is also returned in the T11 clock cycle, and data at address A12 can be read from the first sub-chain again in the T12 clock cycle.

[0060] Based on the above content, it can be seen that in this embodiment, after the replication of the sub-chain, a multi-head linked list can initiate a read command in each clock cycle and output one data in each clock cycle, that is, in Figure 4, the 8 clock cycles T11-T18, each clock cycle outputs data, thereby improving the data reading efficiency of the linked list data structure and solving the technical problem of low data reading efficiency of the existing linked list data structure.

[0061] Optionally, in the linked list data structure of this embodiment, the idle address management unit is a FIFO device; wherein, when an address of the RAM is idle, the idle address is written into the FIFO device.

[0062] Specifically, the FIFO device follows the first-in, first-out principle (FIFO). The free address written to the FIFO device first is output first. That is, within a clock cycle, the free address management unit receives a request from the control unit to read a free address and outputs a free address in the RAM for writing data. Assuming the RAM depth for storing linked list data is 1024, when initializing the linked list, 0, 1, 2, ..., 1023 are written to the free address management unit in sequence, indicating that in the initial state, these RAM addresses are free and can be allocated for use.

[0063] Optionally, in the linked list data structure of this embodiment, the write operation sub-chain indication unit, the read operation sub-chain indication unit and the sub-chain length unit are all registers.

[0064] Specifically, the function of a register is to store binary code. It is composed of a combination of flip-flops with storage functions. One flip-flop can store 1 bit of binary code, so a register that stores n bits of binary code needs to be composed of n flip-flops. For example, for a multi-head linked list containing 4 sub-chains, the registers of its write operation sub-chain indication unit and read operation sub-chain indication unit need to represent 4 binary codes from 0 to 3, namely 00, 01, 10 and 11.

[0065] Based on the linked list data structure of the above embodiment, another embodiment of the present application provides a data processing method of the linked list data structure, the method comprising: when the control unit receives a write data request, performing a write data operation;

[0066] As shown in FIG5 , the execution of the data writing operation includes the following steps:

[0067] Step S11: acquiring data to be written according to the write data request;

[0068] Step S12: Read the subchain number stored in the write operation subchain indication unit, determine the write target subchain according to the subchain number stored in the write operation subchain indication unit, and obtain the subchain length information stored in the subchain length unit of the write target subchain and the address stored in the write pointer unit of the write target subchain;

[0069] Step S13: Sending a read idle address request to the idle address management unit, and receiving an idle address returned by the idle address management unit;

[0070] Step S14: writing the data to be written into the data unit corresponding to the idle address in the RAM;

[0071] Step S15: determining whether to write the idle address into the pointer storage unit corresponding to the address stored in the write pointer unit of the write target subchain in the RAM according to the subchain length information stored in the subchain length unit of the write target subchain;

[0072] Step S16: updating the subchain number stored in the write operation subchain indication unit to the subchain number of the next write target subchain;

[0073] Step S17: updating the address stored in the write pointer unit of the write target subchain to the idle address;

[0074] Step S18: updating the sub-chain length information stored in the sub-chain length unit of the write target sub-chain according to the number of data currently stored in the write target sub-chain;

[0075] Specifically, the sub-chain length information is equal to the number of data currently stored in the sub-chain. That is, when no data is written, the sub-chain length information is 0. After the first data is written, the sub-chain length information is updated to 1. After each data is written, the sub-chain length information is updated by 1.

[0076] Optionally, in the data processing method of this embodiment, step S15 includes:

[0077] According to the sub-chain length information stored in the sub-chain length unit of the write target sub-chain, determine whether the data to be written is the first data written to the write target sub-chain; if so, determine that the pointer storage unit corresponding to the address stored in the write pointer unit of the write target sub-chain in the RAM is empty; if not, write the idle address into the pointer storage unit corresponding to the address stored in the write pointer unit of the write target sub-chain in the RAM.

[0078] Specifically, please refer to Figure 6, which shows the data writing process of a multi-head linked list. In Figure 6, data D0, D1, D2, and D3 are stored in the four data units (RAM) of the four sub-chains in sequence. At this time, data D0, D1, D2, and D3 are the first data stored in the sub-chain when they are stored in the four sub-chains. At this time, after completing the data D0 / D1 / D2 / D3 / / sub-chain data units in sequence, the content of the pointer storage unit corresponding to the data unit is not updated. At this time, the content of the pointer storage unit should be empty, because it is not clear at this time at which address the next data written to the sub-chain is stored, and it cannot be pointed to.

[0079] When the first sub-chain receives a request to write data D4 again, the sub-chain length information is 1 and the obtained free address is 4. The data D4 is stored in the data unit of the RAM corresponding to the free address 4 just obtained. At the same time, the value of the free address 4 is stored in the pointer storage unit of the sub-chain's write pointer unit (address 0). That is, the data unit at address 0 stores data D0, and the pointer storage unit stores address 4. Then, the content stored in the sub-chain's write pointer unit is updated from address 0 to address 4. The sub-chain's write pointer unit points to address 4, indicating that the current data is written to the data unit at address 4.

[0080] Optionally, in the data processing method of this embodiment, if the write target subchain into which the data to be written is to be written is the i-th subchain among the n subchains, then the corresponding next write target subchain is the i+1-th subchain; if the write target subchain into which the data to be written is to be written is the n-th subchain among the n subchains, then the corresponding next write target subchain is the 1st subchain.

[0081] Specifically, referring to FIG4 , data writing of n sub-chains is performed by selecting the corresponding sub-chain for data writing in each clock cycle in the order of the sub-chain numbers, and n sub-chains are cycled. In FIG4 , each sub-chain can write data to storage once every n cycles.

[0082] Optionally, the data processing method of this embodiment further includes executing a data read operation when the control unit receives a data read request;

[0083] The execution of the data read operation, as shown in FIG7 , includes the following steps:

[0084] Step S21: determining a read target subchain according to the subchain number stored in the read operation subchain indication unit, and obtaining an address stored in the read pointer unit of the read target subchain;

[0085] Step S22, reading out the data in the data unit corresponding to the address stored in the read pointer unit and the address in the pointer storage unit in the RAM;

[0086] Specifically, when reading data, the data of the data unit and the address of the corresponding pointer storage unit will be read out together. The application of the address of the pointer storage unit will be described in the subsequent steps.

[0087] Step S23: output the read data;

[0088] Specifically, the data is output to the requester who initiates the read data request;

[0089] Step S24: updating the subchain number stored in the read operation subchain indication unit to the subchain number of the next read target subchain;

[0090] Step S25: Update the address stored in the read pointer unit to the read address.

[0091] Optionally, in the data processing method of this embodiment, performing the data reading operation further includes:

[0092] Step S26: When the data in the data unit of an address in the RAM and the address in the pointer storage unit are read out, the read address is written into the free address management unit.

[0093] Specifically, after the data and pointer address of an address in the RAM are read out, the address is released and written back to the free address management unit for subsequent continued use.

[0094] Optionally, in the data processing method of this embodiment, if the read target sub-chain where the data to be read is located is the i-th sub-chain among the n sub-chains, then the corresponding next read target sub-chain is the i+1-th sub-chain; 1≤i≤n-1; if the read target sub-chain where the data to be read is located is the n-th sub-chain among the n sub-chains, then the corresponding next read target sub-chain is the 1st sub-chain.

[0095] Specifically, referring to FIG4 , corresponding to the data storage, the data reading of n sub-chains is also used in each clock cycle in the order of the sub-chain numbers, and n sub-chains are cycled. In FIG4 , each sub-chain can read out data once every n cycles.

[0096] It should be noted that the method of this embodiment is implemented based on the linked list data structure of the above embodiment. Therefore, the contents not described in detail in the method of this embodiment can be obtained by referring to the linked list data structure of the above embodiment, so they will not be repeated here.

[0097] Another embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the data processing method of the linked list data structure as described in the above embodiment is implemented.

[0098] Specifically, the computer-readable storage medium may include: any entity or recording medium that can carry the computer program instructions, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.

[0099] Another embodiment of the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for processing linked list data structures as described in the above embodiment is implemented.

[0100] Wherein, electronic equipment can also include the bus connecting different components (including memory and processor).Memory can include computer-readable medium in the form of volatile memory, such as random access memory (RAM) and / or cache memory.Memory can also include at least one program product, and this program product has one group (such as at least one) program module, and these program modules are configured to perform the function of each embodiment of the present application.Electronic equipment can also communicate with one or more external devices (such as keyboard, pointing device, display etc.), can also communicate with one or more devices that enable users to interact with this electronic equipment, and / or communicate with any device (such as network card) that enables this electronic equipment to communicate with one or more other computing devices, this communication can be carried out through input / output (I / O) interface, and electronic equipment can also communicate with one or more networks (such as local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) through network adapter.

[0101] Another embodiment of the present application provides a chip, including: a processor and a memory;

[0102] The processor is used to call and run a computer program from the memory, so that the device equipped with the chip executes the above-mentioned data processing method.

[0103] Another embodiment of the present application provides a computer program product, which includes relevant program instructions. When the relevant program instructions are executed, the above-mentioned data processing method is implemented.

[0104] Another embodiment of the present application provides a computer program, comprising program instructions. When executed on an electronic device, the program instructions enable the computer device to perform the above-mentioned data processing method.

[0105] Another embodiment of the present application provides a device, which may include: at least one processor, and the relevant program instructions are executed in the at least one processor, so that the device implements the above-mentioned data processing method.

[0106] While various embodiments of the present application have been described above, the above descriptions are illustrative, non-exhaustive, and not intended to be limiting of the disclosed embodiments. Many updates and modifications will be readily apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, their practical applications, or technological improvements in the marketplace, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A linked list data structure, characterized in that: It includes a RAM, a free address management unit and a multi-head linked list, wherein the multi-head linked list includes a control unit, a write operation sub-chain indication unit, a read operation sub-chain indication unit and n sub-chains, where n is a positive integer greater than or equal to 2; the sub-chain includes a sub-chain length unit, a write pointer unit and a read pointer unit; the RAM includes a plurality of data units and a plurality of pointer units corresponding to the plurality of data units one by one, and any data unit and a pointer unit corresponding thereto share an address of the RAM; The data unit is used to store data; The pointer unit is used to store an address; wherein, if a data unit is used to store the i-th data of a subchain, the pointer unit corresponding to the data unit is used to store the address of the data unit where the i+1-th data of the subchain is located; The idle address management unit is used to manage the idle addresses of the RAM; and when it receives a request to read an idle address from the control unit, it outputs an idle address to the control unit; The write operation subchain indicating unit is used to store the subchain number of the write target subchain, and the write target subchain is the subchain to which the data to be written is to be written; The read operation subchain indicating unit is used to store the subchain number of the read target subchain, where the subchain number of the read target subchain is the subchain where the data to be read is located; The subchain length unit is used to store subchain length information, which is the number of data currently stored in the subchain; The write pointer unit is used to store the address of the current data written into the multi-head linked list in the RAM; The read pointer unit is used to store the address of the next data to be read out of the multi-head linked list in the RAM; and The control unit is used to, when it receives a write data request, determine the write target sub-chain according to the sub-chain number stored in the write operation sub-chain indication unit, and perform a write data operation according to the idle address, the sub-chain length information stored in the sub-chain length unit of the write target sub-chain, and the address stored in the write pointer unit; and, when it receives a read data request, determine the read target sub-chain according to the sub-chain number stored in the read operation sub-chain indication unit, and perform a read data operation according to the address stored in the read pointer unit of the read target sub-chain.

2. The linked list data structure according to claim 1, characterized in that: The idle address management unit is a FIFO device; wherein, when an address of the RAM is idle, the idle address is written into the FIFO device.

3. The linked list data structure according to claim 1, characterized in that: The write operation sub-chain indication unit, the read operation sub-chain indication unit and the sub-chain length unit are all registers.

4. A data processing method, characterized in that: The method is used for a linked list data structure as claimed in any one of claims 1 to 3, and the method comprises: when the control unit receives a write data request, performing a write data operation; Wherein, executing the data writing operation includes: Acquire the data to be written according to the write data request; Read the subchain number stored in the write operation subchain indication unit, determine the write target subchain according to the subchain number stored in the write operation subchain indication unit, and obtain the subchain length information stored in the subchain length unit of the write target subchain and the address stored in the write pointer unit of the write target subchain; Sending a read idle address request to the idle address management unit, and receiving an idle address returned by the idle address management unit; Writing the data to be written into the data unit corresponding to the idle address in the RAM; Determine whether to write the idle address into a pointer unit in the RAM corresponding to the address stored in the write pointer unit of the write target subchain according to the subchain length information stored in the subchain length unit of the write target subchain; Update the subchain number stored in the write operation subchain indication unit to the subchain number of the next write target subchain; Updating the address stored in the write pointer unit of the write target subchain to the idle address; The sub-chain length information stored in the sub-chain length unit of the write target sub-chain is updated according to the number of data currently stored in the write target sub-chain.

5. The data processing method according to claim 4, characterized in that: The determining, according to the sub-chain length information stored in the sub-chain length unit of the write target sub-chain, whether to write the idle address into the pointer unit corresponding to the address stored in the write pointer unit of the write target sub-chain in the RAM comprises: Determine whether the data to be written is the first data written to the write target subchain according to the subchain length information stored in the subchain length unit of the write target subchain; if so, determine that the pointer unit corresponding to the address stored in the write pointer unit of the write target subchain in the RAM is empty; if not, write the idle address into the pointer unit corresponding to the address stored in the write pointer unit of the write target subchain in the RAM.

6. The data processing method according to claim 4, characterized in that: If the write target subchain to which the data to be written is written is the i-th subchain among the n subchains, then the corresponding next write target subchain is the i+1-th subchain; If the write target subchain into which the to-be-written data is written is the nth subchain among the n subchains, the corresponding next write target subchain is the 1st subchain.

7. A data processing method, characterized in that: The method is used for a linked list data structure as claimed in any one of claims 1 to 3, and the method comprises: when the control unit receives a read data request, performing a read data operation; The performing of the data reading operation includes: Determine the read target subchain according to the subchain number stored in the read operation subchain indication unit, and obtain the address stored in the read pointer unit of the read target subchain; Reading out the data in the data unit corresponding to the address stored in the read pointer unit and the address in the pointer unit in the RAM; Output the read data; The subchain number stored in the read operation subchain indication unit is updated to the subchain number of the next read target subchain; The address stored in the read pointer unit is updated to the read address.

8. The data processing method according to claim 7, characterized in that: The performing of the data reading operation further includes: When the data in the data unit of an address in the RAM and the address in the pointer unit are read out, the read out address is written into the free address management unit.

9. The data processing method according to claim 7, characterized in that: If the read target subchain where the to-be-read data is located is the i-th subchain among the n subchains, then the corresponding next read target subchain is the i+1-th subchain; 1≤i≤n-1; If the read target subchain where the to-be-read data is located is the nth subchain among the n subchains, then the corresponding next read target subchain is the 1st subchain.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the data processing method according to any one of claims 4 to 9 is implemented.

11. An electronic device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the data processing method according to any one of claims 4 to 9 is implemented.

12. A chip, characterized in that: include: Processor and memory; The processor is used to call and run a computer program from the memory, so that a device equipped with the chip executes the data processing method according to any one of claims 4 to 9.

13. A computer program product, characterized in that The computer program product comprises the relevant program instructions, and when the relevant program instructions are executed, the data processing method described in any one of claims 4 to 9 is implemented.

14. A computer program, characterized in that The computer comprises program instructions, which, when executed on an electronic device, cause the computer device to execute the data processing method as claimed in any one of claims 4 to 9.

15. A device, characterized in that: The device may include: at least one processor, and the program instructions involved are executed in the at least one processor, so that the device implements the data processing method as described in any one of claims 4 to 9.