A method for implementing linked list data structure

Through the independent and shared storage space design of the linked list data structure, the storage waste and data transfer problems caused by inconsistent data frame structure are solved, and the efficient use of storage space and the improvement of data transmission efficiency are achieved.

CN116304201BActive Publication Date: 2025-09-19GUANGZHOU GUOXIN MICRO TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310082442.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-03
Publication Date
2025-09-19
Estimated Expiration
2043-02-03

AI Technical Summary

Technical Problem

In the prior art, inconsistent data frame structures lead to a waste of storage space, and multiple data transfers cause a waste of storage space and time, especially in application scenarios with large data volumes and high efficiency requirements.

Method used

A linked list data structure is adopted, including independent storage space and shared storage space. Flexible data reading and writing operations are performed according to pointers through the data reading and writing module to avoid accessing two storage spaces at the same time, realize non-fixed data frame structure, optimize storage space utilization and reduce data transportation.

Benefits of technology

Effectively utilize storage space, reduce data handling operation time, improve data transmission efficiency, and optimize storage allocation of information transmission systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116304201B_ABST
    Figure CN116304201B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for implementing a linked list data structure. The hardware structure includes a data read / write module, an independent storage space, and a system shared storage space. The linked list data structure includes a plurality of serially connected data structures, each of which includes control data, a send data pointer, a receive data pointer, and a linked list jump pointer. The execution program first configures the data structure of the transaction and the data to be sent, and then starts the data read / write module to perform the actual data read / write operation. After completing a send or receive operation, the data read / write module reports the transaction status, and the control system reads the transaction status through the independent storage space to determine whether to continue the corresponding transaction operation. Based on the transaction status reported by the data read / write module, the execution program continues to fill in the transaction information and data, or terminates all operations. The present invention can flexibly utilize fixed storage space to achieve effective memory allocation, provide more storage space, and improve the efficiency of data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data technology transmission, and in particular relates to a method for realizing a linked list data structure. Background Art

[0002] In information transmission systems, information is transmitted in the form of data frames. However, the structure of each data frame is inconsistent, including data length and control information. If a fixed data length is used, some data space will inevitably be wasted. Furthermore, during software operation, the data to be sent must be copied from main memory to the application module to complete the data transmission operation. Data received by the application module also needs to be moved from a specific storage space to main memory. This multiple data transfers results in storage space usage and time waste, especially in applications with large data volumes and those that require high data transmission and reception efficiency. Summary of the Invention

[0003] The purpose of the present invention is to provide a method for realizing a linked list type data structure.

[0004] The hardware structure of the present invention includes a data reading and writing module, an independent storage space and a shared storage space.

[0005] The data read and write module completes data read and write operations according to the configured pointer. The data read and write module will not access the independent storage space and the shared storage space at the same time. The data read and write module completes different data read and write operations according to the transaction control information.

[0006] The independent storage space is used to store control data, send data pointer, receive data pointer and linked list jump pointer in the data structure.

[0007] The shared storage space is used to store sent data and received data, facilitating the upper layer to quickly process the data.

[0008] The linked list data structure includes a plurality of serially connected data structures, each of which includes control data, a sending data pointer, a receiving data pointer and a linked list jump pointer.

[0009] The control data includes transaction control information, basic information, encryption and decryption information, time information, read and write instructions and transaction operation status information.

[0010] The sending data pointer is used by the execution program to jump to the sending data content through the sending data pointer. The sending data content includes a type description of the sending data, a length description of the sending data, a feature description of the sending data and specific data information.

[0011] The received data pointer is used by the execution program to jump to the received data content through the received data pointer. The received data content includes a description of the type of received data, a description of the length of received data, a description of the characteristics of received data and specific data information.

[0012] The linked list jump pointer is used by the execution program to jump to the next data structure through the linked list jump pointer.

[0013] The execution program first configures the transaction data structure and the data to be sent, and then starts the data read and write module to perform actual data read and write operations. After completing a send or receive operation, the data read and write module reports the transaction status. The control system reads the transaction status through an independent storage space to decide whether to continue the corresponding transaction operation; based on the transaction status reported by the data read and write module, the execution program continues to fill in the transaction information and data, or terminates all operations.

[0014] The present invention provides a data frame structure of non-fixed length, which can flexibly utilize fixed storage space to achieve effective memory allocation, avoid wasting memory space, and reduce the handling operations of sending and receiving data, greatly reducing the operation time and storage space of data preparation, and can optimize the storage allocation operation of data in the information transmission system, provide more storage space, and improve the efficiency of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 This is a flow chart of the sending and receiving of the data structure of the present invention. DETAILED DESCRIPTION

[0016] A method for realizing a linked list data structure, wherein the hardware structure includes a data reading and writing module, an independent storage space and a shared storage space.

[0017] The data read and write module completes the data read and write operations according to the configured pointer. The data read and write module will not access the independent storage space and the shared storage space at the same time. The data read and write module completes different data read and write operations according to the transaction control information.

[0018] Independent storage space, used to store control data, send data pointer, receive data pointer and linked list jump pointer in the data structure.

[0019] Shared storage space is used to store sent and received data, facilitating rapid data processing by the upper layer.

[0020] A linked list data structure consists of multiple data structures connected in series, each of which includes control data, a send data pointer, a receive data pointer, and a linked list jump pointer. These multiple data structures can also be closed-loop, facilitating the recycling of memory space and implementing repetitive functions.

[0021] Control data includes transaction control information, basic information, encryption and decryption information, time information, read and write instructions, and transaction operation status information.

[0022] Send data pointer. The execution program jumps to the send data content through the send data pointer. The send data content includes the type description of the send data, the length description of the send data, the feature description of the send data and specific data information.

[0023] Receive data pointer, the execution program jumps to the received data content through the received data pointer, and the received data content includes the type description of the received data, the length description of the received data, the feature description of the received data and the specific data information.

[0024] Linked list jump pointer, the execution program jumps to the next data structure through the linked list jump pointer.

[0025] The execution program first configures the transaction data structure and the data to be sent, then starts the data read / write module to perform the actual data read / write operations. After completing a send or receive operation, the data read / write module reports the transaction status. The control system reads the transaction status from independent storage space and decides whether to continue the corresponding transaction operation. Based on the transaction status reported by the data read / write module, the execution program continues to fill in the transaction information and data, or terminates all operations.

[0026] The specific process is as follows Figure 1 As shown:

[0027] Step (1) executes the program to fill the control data in the data structure into the independent storage space.

[0028] Step (2) If the control data is sending control data, the execution program fills the sending data into the shared storage space and fills the sending data pointer into the independent storage space; if the control data is receiving control data, the execution program fills the receiving data pointer into the independent storage space.

[0029] If the program read and write behavior is executed multiple times in step (3), that is, multiple data structures are sent or received, the linked list jump pointer is filled into the independent storage space and step (4) is executed; if the program read and write behavior is executed once, that is, only one data structure is sent or received, the linked list jump pointer is empty and step (5) is executed.

[0030] Step (4) executes the program to determine whether the multiple data structures are all filled into the independent storage space and / or the shared storage space. If they are all filled, execute step (5), otherwise return to step (1).

[0031] Step (5) starts the data read / write module to read / write data. The first data read is the control data. If the control data is send control data, the data read / write module jumps to the send data space through the send data pointer and reads the data one by one. If the control data is receive control data, the data read / write module jumps to the receive data space through the receive data pointer and waits for data to be received.

[0032] Step (6) If a stop message of the execution program is received during the operation of the data reading and writing module, the data reading and writing module terminates the operation, returns to the idle state, and executes step (8); otherwise, executes step (7).

[0033] After the data is sent in step (7), the data read-write module generates an interrupt signal to inform the execution program that the operation is completed; after the data is received, the data read-write module generates an interrupt signal to inform the execution program that the operation is completed; and step (8) is executed.

[0034] Step (8) updates the control data in the independent storage space, such as the transaction operation status information. If the execution program read and write behavior is once, the read and write operation is completed, otherwise step (9) is executed.

[0035] Step (9) jumps to the next data structure through the linked list jump pointer, continues to read new control data, and performs a new round of read and write operations based on the new control data until all data structure read and write operations are completed.

[0036] The data structures pointed to by the linked list jump pointers can be the same or different. The next operation pointed to by the linked list jump pointer can be either a send or a receive. Therefore, multiple operations in the data read / write module can switch between sending and receiving at will. When the linked list jump pointers point to different data structures and multiple operations occur: receive operation 1 → receive operation 2 → receive operation 3 → send operation 1 → ... receive operation 10; send operation 1 → receive operation 1 → send operation 2 → send operation 3 → receive operation 2. When the linked list jump pointers point to the same data structure and multiple operations occur: receive operation 1 → receive operation 1 → receive operation 1 → receive operation 1 ...; send operation 1 → send operation 1 → send operation 1 → send operation 1 .... Data structures are stored in independent storage spaces, while send / receive data is stored in shared storage spaces.

[0037] The data read / write module generates an interrupt each time it completes an operation, notifying the executing program that the operation is complete.

[0038] The length of the data structure in the independent storage space is variable, and different data structures can be arranged arbitrarily while ensuring the correct position of the pointer, and can be compactly filled in the independent storage space by word alignment or by byte.

[0039] The method proposed in the present invention will be described below with a specific usage example.

[0040] During Bluetooth communication, frames are used as the basic unit.

[0041] A BR frame includes PREAMBLE, ACCESS CODE, HEADER, and PAYLOAD.

[0042] An EDR frame includes PREAMBLE, ACCESS CODE, HEADER, GUARD, SYNC, ENHANCED DATARATE PAYLOAD, and TRAILER.

[0043] A BLE frame includes PREAMBLE, ACCESS CODE, PDU, CRC, and CONSTANT TONE EXTENSION.

[0044] When forming frame data, specific control information such as Bluetooth address, Bluetooth clock, encryption and decryption key, frequency hopping data, target Bluetooth address, local clock, etc. is required. The data sent by Bluetooth can be divided into different Bluetooth packet types according to the specific length. The overall data can be divided into multiple frames for data transmission or reception.

[0045] Take sending 3000 bytes of data via Bluetooth as an example.

[0046] The Bluetooth data packet uses the 3DH5 packet type. The 3DH5 data packet can send 1021 bytes of data, so the 3000 bytes of data are divided into 3 parts, and the data volume of each part is 1000 bytes.

[0047] Step (1). Fill the Bluetooth control information of the first frame into an independent storage space, including but not limited to Bluetooth address, Bluetooth clock, encryption and decryption KEY, frequency hopping data, target Bluetooth address, etc.

[0048] Step (2). Fill the data pointer of the transmitted data into the independent storage space, followed by the control information content.

[0049] Step (3). Fill the control information pointer of the second frame into the independent storage space, followed by the send data pointer of the first frame.

[0050] Step (4). Fill the second frame of Bluetooth control information into an independent storage space, including but not limited to Bluetooth address, Bluetooth clock, encryption and decryption KEY, frequency hopping data, target Bluetooth address, etc.

[0051] Step (5). Fill the data pointer of the second frame of transmitted data into the independent storage space, followed by the control information content.

[0052] Step (6). Fill the control information pointer of the third frame into the independent storage space, followed by the send data pointer of the second frame.

[0053] Step (7). Fill the Bluetooth control information of the third frame into an independent storage space, including but not limited to Bluetooth address, Bluetooth clock, encryption and decryption KEY, frequency hopping data, target Bluetooth address, etc.

[0054] Step (8). Fill the data pointer of the third frame of transmitted data into the independent storage space, followed by the control information content.

[0055] Step (9). Put the 3000 bytes of data processed by the upper layer into the shared storage space, and ensure that the starting positions of the three copies of data correspond one-to-one with the data pointers filled in the independent storage space.

[0056] Step (10). Fill the start pointer of the first frame into the register of the Bluetooth baseband and start the Bluetooth baseband module. The data reading and writing module will read the data from the starting position of the first frame and transmit it to the Bluetooth baseband module. The order of reading data is: first frame Bluetooth control signal → 1000 bytes of data sent in the first frame → second frame Bluetooth control signal → 1000 bytes of data sent in the second frame → third frame Bluetooth control signal → 1000 bytes of data sent in the third frame.

[0057] Step (11). After receiving the reporting signal indicating that the third frame of data has been sent, the control system terminates the data transmission task.

[0058] Take BLE sending connectionless advertisement as an example.

[0059] BLE sends connectionless advertisements based on the three frequencies 37, 38, and 39. One frame contains three advertisement packets.

[0060] Step (1). Fill the BLE control information of the first frame into an independent storage space, including but not limited to Bluetooth address, local clock, encryption and decryption KEY, frequency hopping data, etc.

[0061] Step (2). Fill the data pointer of the transmitted data into the independent storage space, followed by the control information content.

[0062] Step (3). Fill the control information pointer of the second frame into the independent storage space, followed by the send data pointer of the first frame.

[0063] Step (4). Fill the BLE control information of the second frame into an independent storage space, including but not limited to Bluetooth address, local clock, encryption and decryption KEY, frequency hopping data, etc.

[0064] Step (5). Fill the data pointer of the second frame of transmitted data into the independent storage space, followed by the control information content.

[0065] Step (6). Fill the control information pointer of the third frame into the independent storage space, followed by the send data pointer of the second frame.

[0066] Step (7). Fill the BLE control information of the third frame into an independent storage space, including but not limited to Bluetooth address, local clock, encryption and decryption KEY, frequency hopping data, etc.

[0067] Step (8). Fill the data pointer of the third frame of transmitted data into the independent storage space, followed by the control information content.

[0068] Step (9). Fill the control information pointer of the fourth frame into the independent storage space, followed by the send data pointer of the third frame.

[0069] Step (10). Point the control information pointer of the fourth frame of the connectionless advertisement to the BLE control information of the first frame, thereby completing the closed-loop operation.

[0070] Step (11). Fill the start pointer of the first frame into the register of the Bluetooth baseband, and start the Bluetooth baseband module. The data reading and writing module will read the data from the starting position of the first frame and transmit it to the Bluetooth baseband module. The order of reading data is the first frame Bluetooth control signal → the first frame no connection advertisement is sent → the second frame Bluetooth control signal → the second frame no connection advertisement is sent → the third frame Bluetooth control signal → the third frame no connection advertisement is sent → the fourth frame Bluetooth control signal (original first frame Bluetooth control signal) → the fourth frame no connection advertisement is sent → the fifth frame Bluetooth control signal (original second frame Bluetooth control signal) → the fifth frame no connection advertisement is sent → the sixth frame Bluetooth control signal (original third frame Bluetooth control signal) → the sixth frame no connection advertisement is sent.

[0071] Step (12). By judging the control data of the current transaction, the system is controlled to terminate the data transmission task or continue the current data transmission task under appropriate conditions.

Claims

1. A method for implementing a linked list data structure, wherein the hardware structure includes a data read / write module, an independent storage space, and a shared storage space; characterized in that: The data reading and writing module completes the data reading and writing operations according to the configured pointer. The data reading and writing module will not access the independent storage space and the shared storage space at the same time. The data reading and writing module completes different data reading and writing operations according to the transaction control information. The independent storage space is used to store control data, send data pointer, receive data pointer and linked list jump pointer in the data structure; The shared storage space is used to store sent and received data, facilitating rapid data processing by the upper layer; The linked list data structure includes a plurality of serially connected data structures, each of which includes control data, a send data pointer, a receive data pointer and a linked list jump pointer; The control data includes transaction control information, basic information, encryption and decryption information, time information, read and write instructions and transaction operation status information; The sending data pointer is used by the execution program to jump to the sending data content through the sending data pointer. The sending data content includes a description of the type of the sending data, a description of the length of the sending data, a description of the characteristics of the sending data, and specific data information; The received data pointer is used by the execution program to jump to the received data content, and the received data content includes a description of the type of received data, a description of the length of received data, a description of the characteristics of received data, and specific data information; The linked list jump pointer is used to jump the program to the next data structure. The execution program first configures the transaction data structure and the data to be sent, and then starts the data read and write module to perform actual data read and write operations. After completing a send or receive operation, the data read and write module reports the transaction status. The control system reads the transaction status through an independent storage space to decide whether to continue the corresponding transaction operation; based on the transaction status reported by the data read and write module, the execution program continues to fill in the transaction information and data, or terminates all operations.

2. A method for implementing a linked list data structure according to claim 1, characterized in that: The specific sending and receiving process of the data structure is as follows: Step (1) executing the program to fill the control data in the data structure into the independent storage space; Step (2) If the control data is send control data, the execution program fills the send data into the shared storage space and fills the send data pointer into the independent storage space; if the control data is receive control data, the execution program fills the receive data pointer into the independent storage space; If the program read / write behavior is executed multiple times in step (3), that is, multiple data structures are sent or received, the linked list jump pointer is filled into the independent storage space and step (4) is executed; if the program read / write behavior is executed once, that is, only one data structure is sent or received, the linked list jump pointer is empty and step (5) is executed; Step (4) executing the program to determine whether the multiple data structures are all filled into the independent storage space and / or the shared storage space, if they are all filled, executing step (5), otherwise returning to step (1); Step (5) starts the data reading and writing module to read and write data. The first data read is the control data. If the control data is the sending control data, the data reading and writing module jumps to the sending data space through the sending data pointer to read one by one. If the control data is the receiving control data, the data reading and writing module jumps to the receiving data space through the receiving data pointer and waits for data reception. Step (6) If a stop message of the execution program is received during the operation of the data reading and writing module, the data reading and writing module terminates the operation, returns to the idle state, and executes step (8); otherwise, executes step (7); After the data is sent in step (7), the data reading and writing module generates an interrupt signal to inform the execution program that the operation is completed; after the data is received, the data reading and writing module generates an interrupt signal to inform the execution program that the operation is completed; and step (8) is executed; Step (8) updates the control data in the independent storage space, such as the transaction operation status information. If the execution program read and write behavior is one time, the read and write operation is completed, otherwise, step (9) is executed; Step (9) jumps to the next data structure through the linked list jump pointer, continues to read new control data, and performs a new round of read and write operations based on the new control data until all data structure read and write operations are completed.

3. A method for implementing a linked list data structure according to claim 1 or 2, characterized in that: The multiple data structures in the linked list data structure are closed-loop structures, which can recycle memory space.

4. A method for implementing a linked list data structure according to claim 1 or 2, characterized in that: The data structure pointed to by the linked list jump pointer is the same data structure or a different data structure; the next operation pointed to by the linked list jump pointer is sending or receiving; multiple operations of the data reading and writing module are in the form of arbitrary switching between sending and receiving.

5. A method for implementing a linked list data structure according to claim 1 or 2, characterized in that: Data structures are stored in independent storage spaces, and sent / received data are stored in shared storage spaces.

6. A method for implementing a linked list data structure according to claim 1 or 2, characterized in that: The length of the data structure in the independent storage space is variable, and different data structures can be arranged arbitrarily while ensuring the correct position of the pointer, and can be compactly filled in the independent storage space by word alignment or by byte.

7. A method for implementing a linked list data structure according to claim 2, characterized in that: The data read / write module generates an interrupt each time it completes an operation, notifying the executing program that the operation is complete.

Citation Information

Patent Citations

  • 1394 bus transaction layer-data link layer data packet receiving circuit and method

    CN108011792A

  • Implementing FIFOs in shared memory using linked lists and interleaved linked lists

    US20060031643A1