[go: up one dir, main page]

CN118568310B - Data access method, system, equipment and medium based on linear space linked list - Google Patents

Data access method, system, equipment and medium based on linear space linked list Download PDF

Info

Publication number
CN118568310B
CN118568310B CN202411045149.1A CN202411045149A CN118568310B CN 118568310 B CN118568310 B CN 118568310B CN 202411045149 A CN202411045149 A CN 202411045149A CN 118568310 B CN118568310 B CN 118568310B
Authority
CN
China
Prior art keywords
linked list
data
node
hash table
compressed data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202411045149.1A
Other languages
Chinese (zh)
Other versions
CN118568310A (en
Inventor
黎悠扬
王熙
乔越
王欢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Seres Technology Co Ltd
Original Assignee
Chengdu Seres Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Seres Technology Co Ltd filed Critical Chengdu Seres Technology Co Ltd
Priority to CN202411045149.1A priority Critical patent/CN118568310B/en
Publication of CN118568310A publication Critical patent/CN118568310A/en
Application granted granted Critical
Publication of CN118568310B publication Critical patent/CN118568310B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9014Indexing; Data structures therefor; Storage structures hash tables
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the technical field of computer networks, and discloses a data access method, a system, equipment and a medium based on a linear space linked list, wherein the method comprises the following steps: constructing a doubly linked list based on the linear space; the bidirectional linked list comprises a plurality of linked list nodes, each linked list node comprises a data field and a pointer field, the pointer field comprises a precursor node pointer, a subsequent node pointer and a data length variable, the precursor node pointer points to the previous linked list node of the current linked list node, the subsequent node pointer points to the subsequent linked list node of the current linked list node, the value of the data length variable is the data length of data to be stored, and the memory space size of the data field is consistent with the value of the data length variable; setting key value pairs of a hash table based on a bidirectional linked list, and establishing the hash table; based on the hash table and the doubly linked list, data storage and data reading are performed. The invention can avoid the generation of memory fragments, fully utilize the memory space, improve the system performance, save the memory space and improve the system operation efficiency.

Description

基于线性空间链表的数据存取方法、系统、设备及介质Data access method, system, device and medium based on linear space linked list

技术领域Technical Field

本发明涉及计算机网络技术领域,尤其涉及一种基于线性空间链表的数据存取方法、系统、设备及介质。The present invention relates to the field of computer network technology, and in particular to a data access method, system, device and medium based on a linear space linked list.

背景技术Background Art

入侵检测系统(IDPS)是一种重要的网络安全手段,用于监视网络活动,识别并防止潜在的恶意攻击。其中,基于主机的入侵检测系统(HIDS)通过分析主机的系统日志、审计记录等信息,实现对内部威胁的检测。然而,随着网络攻击技术的不断发展,HIDS的检测能力受到了挑战。因此,研究人员开始探索新的检测方法,如基于网络的入侵检测系统(NIDS),通过分析网络流量,实现对网络攻击的实时检测。在数据存储技术领域,为了实现对网络流量的有效分析,NIDS需要对大量的网络数据进行存储和处理。Intrusion Detection System (IDPS) is an important network security means used to monitor network activities, identify and prevent potential malicious attacks. Among them, the host-based intrusion detection system (HIDS) detects internal threats by analyzing the host's system logs, audit records and other information. However, with the continuous development of network attack technology, the detection capability of HIDS has been challenged. Therefore, researchers began to explore new detection methods, such as network-based intrusion detection system (NIDS), which can realize real-time detection of network attacks by analyzing network traffic. In the field of data storage technology, in order to achieve effective analysis of network traffic, NIDS needs to store and process a large amount of network data.

现有的解决方案主要是通过操作系统的内存管理机制,如malloc等函数,来实现数据的动态分配和释放。此外,还有一些解决方案尝试通过优化内存管理策略,如分页管理、虚拟内存管理等,来提高内存的使用效率。然而,现有的技术在处理大量数据时,可能会导致内存碎片的问题,从而影响系统的性能。此外,现有的内存管理机制在实现对链表的有效管理时,往往需要依赖于malloc等函数,这在某些情况下,可能会增加系统的开销。因此,如何在不使用malloc等函数的情况下,实现对链表的有效管理,仍然是一个值得研究的问题。Existing solutions mainly use the operating system's memory management mechanism, such as malloc and other functions, to achieve dynamic allocation and release of data. In addition, some solutions try to improve memory usage efficiency by optimizing memory management strategies, such as paging management, virtual memory management, etc. However, when processing large amounts of data, existing technologies may cause memory fragmentation problems, thereby affecting system performance. In addition, when implementing effective management of linked lists, existing memory management mechanisms often need to rely on functions such as malloc, which may increase system overhead in some cases. Therefore, how to achieve effective management of linked lists without using functions such as malloc is still a problem worth studying.

因此,亟需一种基于线性空间链表的数据存取方法、系统、设备及介质,能够避免产生内存碎片,充分利用内存空间,提高系统性能,同时节约存储空间,提高系统运行效率。Therefore, there is an urgent need for a data access method, system, device and medium based on a linear space linked list that can avoid memory fragmentation, make full use of memory space, improve system performance, save storage space and improve system operation efficiency.

发明内容Summary of the invention

为了解决上述技术问题,本发明提供了一种基于线性空间链表的数据存取方法、系统、设备及介质,能够避免产生内存碎片,充分利用内存空间,提高系统性能,同时节约存储空间,提高系统运行效率。In order to solve the above technical problems, the present invention provides a data access method, system, device and medium based on a linear space linked list, which can avoid memory fragmentation, make full use of memory space, improve system performance, save storage space and improve system operation efficiency.

本发明提供了基于线性空间链表的数据存取方法,包括如下步骤:The present invention provides a data access method based on a linear space linked list, comprising the following steps:

基于线性空间构建双向链表;其中,双向链表包括若干链表节点,每个链表节点包括数据域和指针域,指针域包括前驱节点指针、后继节点指针、以及数据长度变量,前驱节点指针指向当前链表节点的前一链表节点,后继节点指针指向当前链表节点的后一链表节点,数据长度变量的值为需要存储的数据的数据长度,数据域的内存空间大小与数据长度变量的值一致;A bidirectional linked list is constructed based on a linear space; wherein the bidirectional linked list includes a plurality of linked list nodes, each of which includes a data field and a pointer field, the pointer field includes a predecessor node pointer, a successor node pointer, and a data length variable, the predecessor node pointer points to a previous linked list node of a current linked list node, the successor node pointer points to a subsequent linked list node of the current linked list node, the value of the data length variable is the data length of the data to be stored, and the memory space size of the data field is consistent with the value of the data length variable;

基于双向链表设定哈希表的键值对,建立哈希表;Set the key-value pairs of the hash table based on the doubly linked list to establish a hash table;

基于哈希表和双向链表,进行数据储存和数据读取;其中,储存的数据是经压缩处理后的数据。Data storage and data reading are performed based on a hash table and a bidirectional linked list; wherein the stored data is compressed data.

本发明还提供了基于线性空间链表的数据存取系统,用于执行上述任一项所述的基于线性空间链表的数据存取方法,系统包括以下模块:The present invention also provides a data access system based on a linear space linked list, which is used to execute any of the above-mentioned data access methods based on a linear space linked list, and the system includes the following modules:

链表构建单元,用于基于线性空间构建双向链表;其中,双向链表包括若干链表节点,每个链表节点包括数据域和指针域,指针域包括前驱节点指针、后继节点指针、以及数据长度变量,前驱节点指针指向当前链表节点的前一链表节点,后继节点指针指向当前链表节点的后一链表节点,数据长度变量的值为数据域中存储的变长数据的数据长度,数据域的内存空间大小与数据长度变量的值一致;A linked list construction unit is used to construct a bidirectional linked list based on a linear space; wherein the bidirectional linked list includes a plurality of linked list nodes, each of which includes a data field and a pointer field, the pointer field includes a predecessor node pointer, a successor node pointer, and a data length variable, the predecessor node pointer points to the previous linked list node of the current linked list node, the successor node pointer points to the next linked list node of the current linked list node, the value of the data length variable is the data length of the variable-length data stored in the data field, and the memory space size of the data field is consistent with the value of the data length variable;

哈希表构建单元,与链表构建单元相连,用于基于双向链表设定哈希表的键值对,建立哈希表;A hash table construction unit, connected to the linked list construction unit, is used to set the key-value pairs of the hash table based on the bidirectional linked list to establish the hash table;

处理单元,与链表构建单元和哈希表构建单元相连,用于基于哈希表和双向链表,进行数据储存和数据读取;其中,储存的数据是经压缩处理后的数据。The processing unit is connected to the linked list construction unit and the hash table construction unit, and is used for storing and reading data based on the hash table and the bidirectional linked list; wherein the stored data is compressed data.

本发明实施例具有以下技术效果:The embodiments of the present invention have the following technical effects:

本发明通过改进链表结构,以及根据数据长度变量分配相应的内存空间大小,使链表能够不依赖其他函数实现内存空间的动态分配,优化内存管理,避免产生内存碎片,充分利用内存空间,提高系统性能;基于链表构建哈希表,并根据数据的关键字通过哈希表直接定位对应的链表节点的位置,实现数据的快速存取,无需遍历链表每个节点,一一比较查找,提高了系统运行效率,通过哈希表从双向链表中读取数据或向双向链表中写入数据的设计考虑了数据的安全性和可靠性,能够有效地防止数据的丢失或被篡改;同时,本方案通过对数据进行压缩处理再存储的方式,节约了存储空间,提高内存利用率;通过设置阈值,对数据进行批量处理,一次性存储批量数据,避免了频繁的内存申请与释放导致的占用大量的系统资源的问题,降低了系统开销,进一步提高系统运行效率,从而为IDPS功能提供有力支持,应对复杂网络攻击。The present invention improves the linked list structure and allocates the corresponding memory space size according to the data length variable, so that the linked list can realize dynamic allocation of memory space without relying on other functions, optimizes memory management, avoids memory fragmentation, makes full use of memory space, and improves system performance; constructs a hash table based on the linked list, and directly locates the position of the corresponding linked list node through the hash table according to the data keyword, so as to realize fast access to data, without traversing each node of the linked list and comparing and searching one by one, thereby improving the operation efficiency of the system; the design of reading data from a bidirectional linked list or writing data to a bidirectional linked list through a hash table takes into account the security and reliability of the data, and can effectively prevent the loss or tampering of the data; at the same time, the scheme saves storage space and improves memory utilization by compressing and storing the data; by setting a threshold, batch processing is performed on the data, and batch data is stored at one time, thereby avoiding the problem of occupying a large amount of system resources caused by frequent memory application and release, reducing system overhead, and further improving the operation efficiency of the system, thereby providing strong support for the IDPS function and coping with complex network attacks.

本技术方案可以广泛应用于各种需要对网络数据进行存储和处理的场景,如网络监控、网络攻击检测、数据分析等,满足了市场对于高效、安全、低成本的数据存储和处理的需求,在计算机网络安全、数据存储、高效内存管理等应用领域可以有广泛的应用。This technical solution can be widely used in various scenarios that require storage and processing of network data, such as network monitoring, network attack detection, data analysis, etc., meeting the market demand for efficient, secure, and low-cost data storage and processing, and can be widely used in application fields such as computer network security, data storage, and efficient memory management.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

图1是本发明实施例提供的一种基于线性空间链表的数据存取方法的流程图;FIG1 is a flow chart of a data access method based on a linear space linked list provided by an embodiment of the present invention;

图2是本发明实施例提供的一种双向链表的结构示意图;FIG2 is a schematic diagram of the structure of a bidirectional linked list provided in an embodiment of the present invention;

图3是本发明实施例提供的一种基于哈希表和双向链表进行数据的储存的方法的逻辑图;3 is a logic diagram of a method for storing data based on a hash table and a bidirectional linked list provided in an embodiment of the present invention;

图4是本发明实施例提供的一种根据哈希表查找压缩数据在双向链表中对应的链表节点的位置的示意图;4 is a schematic diagram of searching for the position of a linked list node corresponding to compressed data in a bidirectional linked list according to a hash table provided by an embodiment of the present invention;

图5是本发明实施例提供的一种基于哈希表和双向链表进行数据的获取的方法的逻辑图;5 is a logic diagram of a method for acquiring data based on a hash table and a bidirectional linked list provided in an embodiment of the present invention;

图6是本发明实施例提供的一种基于线性空间链表的数据存取系统的结构示意图;6 is a schematic diagram of the structure of a data access system based on a linear space linked list provided by an embodiment of the present invention;

图7是本发明实施例提供的一种电子设备的结构示意图。FIG. 7 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.

具体实施方式DETAILED DESCRIPTION

为使本发明的目的、技术方案和优点更加清楚,下面将对本发明的技术方案进行清楚、完整的描述。显然,所描述的实施例仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所得到的所有其它实施例,都属于本发明所保护的范围。In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.

现有技术中通常采用malloc等函数,来实现数据的动态分配和释放,然而,malloc等函数通常基于系统内存分配器的粒度来分配内存块。如果分配的内存块大小不是请求大小的整数倍,可能会在内存块中留下未使用的空间,形成内部碎片,且malloc等函数为非连续分配,操作系统可能不会总是从连续的内存区域分配内存,随着时间的推移,不同的内存块可能会在内存中分散,导致外部碎片。频繁的内存分配和释放可能导致内存碎片逐渐积累,使得大块的连续内存变得难以找到,影响程序性能。此外, 现有的链表节点查找方法,普遍为遍历寻找,需要一个一个比较查找,导致系统运行效率低下。In the prior art, functions such as malloc are usually used to realize dynamic allocation and release of data. However, functions such as malloc usually allocate memory blocks based on the granularity of the system memory allocator. If the size of the allocated memory block is not an integer multiple of the requested size, unused space may be left in the memory block, forming internal fragmentation. Moreover, functions such as malloc are non-continuous allocations, and the operating system may not always allocate memory from continuous memory areas. As time goes by, different memory blocks may be scattered in the memory, resulting in external fragmentation. Frequent memory allocation and release may cause memory fragments to gradually accumulate, making large blocks of continuous memory difficult to find, affecting program performance. In addition, the existing linked list node search method is generally a traversal search, which requires one-by-one comparison and search, resulting in low system operation efficiency.

针对上述问题,本发明提出了一种基于线性空间链表的数据存取方法,图1是本发明实施例提供的一种基于线性空间链表的数据存取方法的流程图,参见图1,具体包括:In view of the above problems, the present invention proposes a data access method based on a linear space linked list. FIG1 is a flow chart of a data access method based on a linear space linked list provided by an embodiment of the present invention. Referring to FIG1 , the method specifically includes:

S1、基于线性空间构建双向链表。S1. Construct a doubly linked list based on linear space.

具体的,图2是本发明实施例提供的一种双向链表的结构示意图,参见图2,双向链表包括若干链表节点,每个链表节点包括数据域和指针域,指针域包括前驱节点指针、后继节点指针、以及数据长度变量,前驱节点指针指向当前链表节点的前一链表节点,后继节点指针指向当前链表节点的后一链表节点,数据长度变量的值为需要存储的数据的数据长度,数据域的内存空间大小与数据长度变量的值一致。其中,线性空间即连续内存空间,在计算机内存中,预先分配一个连续的地址空间,用于存储数据结构,即本方案的双向链表,这种连续性结构可以提高数据访问的效率,双向链表的长度可以根据实际需要进行动态调整。其中,所述需要存储的数据可以为变长的以太网(ETH)的原始数据(RAW数据),也可以为其他格式的任意数据,在此不做限定。该链表结构的设计考虑了数据的随机访问和高效存储,能够有效地避免内存碎片的问题,提高系统的性能。Specifically, FIG. 2 is a schematic diagram of the structure of a bidirectional linked list provided by an embodiment of the present invention. Referring to FIG. 2, the bidirectional linked list includes several linked list nodes, each linked list node includes a data field and a pointer field, the pointer field includes a predecessor node pointer, a successor node pointer, and a data length variable, the predecessor node pointer points to the previous linked list node of the current linked list node, the successor node pointer points to the next linked list node of the current linked list node, the value of the data length variable is the data length of the data to be stored, and the memory space size of the data field is consistent with the value of the data length variable. Among them, the linear space is a continuous memory space. In the computer memory, a continuous address space is pre-allocated for storing data structures, that is, the bidirectional linked list of this scheme. This continuous structure can improve the efficiency of data access, and the length of the bidirectional linked list can be dynamically adjusted according to actual needs. Among them, the data to be stored can be the raw data (RAW data) of variable-length Ethernet (ETH), or any data in other formats, which is not limited here. The design of the linked list structure takes into account random access and efficient storage of data, which can effectively avoid the problem of memory fragmentation and improve the performance of the system.

S2、基于双向链表设定哈希表的键值对,建立哈希表。S2. Set the key-value pairs of the hash table based on the bidirectional linked list to establish a hash table.

S21、将双向链表中每个链表节点的前n个字节作为关键字,通过哈希函数进行计算,得到链表节点的哈希码,将哈希码作为链表节点在哈希表中对应的键。S21. Use the first n bytes of each linked list node in the bidirectional linked list as keywords, calculate through a hash function, obtain a hash code of the linked list node, and use the hash code as the key corresponding to the linked list node in the hash table.

具体的,n可以根据需要进行设置,示例性地,可以将双向链表中每个链表节点的前4个字节通过哈希函数进行计算,得到链表节点的哈希码,将哈希码作为链表节点在哈希表中对应的键。Specifically, n can be set as needed. For example, the first 4 bytes of each linked list node in the bidirectional linked list can be calculated through a hash function to obtain a hash code of the linked list node, and the hash code is used as the corresponding key of the linked list node in the hash table.

在一些实施例中,还可以选择任意指定位置的若干字节作为关键字,在此不做限定。In some embodiments, several bytes at any specified position may be selected as keywords, which is not limited here.

S22、将链表节点的地址作为链表节点在哈希表中对应的值。S22. Use the address of the linked list node as the corresponding value of the linked list node in the hash table.

S23、根据每个链表节点在哈希表中对应的键和值确定链表节点的键值对,建立哈希表。S23. Determine the key-value pair of each linked list node according to the key and value corresponding to each linked list node in the hash table, and establish a hash table.

进一步的,若两个不同的链表节点产生相同的哈希码(称为冲突),可以采用链地址法或开放寻址法解决哈希码冲突问题。Furthermore, if two different linked list nodes produce the same hash code (called a conflict), the hash code conflict problem can be solved by using the chain address method or the open addressing method.

S3、基于哈希表和双向链表,进行数据储存和数据读取。S3, based on hash table and bidirectional linked list, data storage and data reading.

其中,储存的数据是经压缩处理后的数据。The stored data is compressed data.

具体的,图3是本发明实施例提供的一种基于哈希表和双向链表进行数据的储存的方法的逻辑图,参见图3,基于哈希表和双向链表,进行数据储存,具体包括:Specifically, FIG. 3 is a logic diagram of a method for storing data based on a hash table and a bidirectional linked list provided in an embodiment of the present invention. Referring to FIG. 3 , data storage is performed based on a hash table and a bidirectional linked list, specifically including:

S31a、初始化双向链表。S31a. Initialize a bidirectional linked list.

S32a、将接收的数据存储到缓存空间。S32a, storing the received data into the cache space.

S33a、对缓存中的数据添加包头,并进行封装,得到封装后的数据。S33a, adding a header to the data in the cache and encapsulating it to obtain encapsulated data.

具体的,以RAW格式的ETH数据为例,针对ETH数据的完整存取,因为在ETH层无法捕获完整封装好的数据,需要在系统调用网络设备驱动程序(driver)完成收发之前,存下最后一次封装的包头,其中,包头可以包括目的媒体访问控制地址、源媒体访问控制地址、类型等字段,需要将TCPIP到ETH这一层级的数据进行一次处理封装,得到完整的RAW格式数据,基于封装后得到的完整的RAW格式的ETH数据进行数据存取和后续的使用。Specifically, taking RAW format ETH data as an example, for the complete access of ETH data, since the completely encapsulated data cannot be captured at the ETH layer, it is necessary to save the last encapsulated packet header before the system calls the network device driver to complete the transmission and reception. The packet header may include fields such as the destination media access control address, the source media access control address, and the type. The data at the TCPIP to ETH level needs to be processed and encapsulated once to obtain complete RAW format data, and data access and subsequent use are performed based on the complete RAW format ETH data obtained after encapsulation.

在一些实施例中,需要进行存取的数据不需要添加包头进行封装,或需要进行存取的就是获取的数据本身,则不需要执行S33a步骤。In some embodiments, the data to be accessed does not need to be encapsulated by adding a header, or the data to be accessed is the acquired data itself, and then step S33a does not need to be executed.

S34a、对封装后的数据进行压缩处理,得到压缩数据。S34a, compressing the encapsulated data to obtain compressed data.

具体的,采用GZip压缩算法对缓存空间中的数据进行压缩处理,包括:Specifically, the GZip compression algorithm is used to compress the data in the cache space, including:

数据预处理:将接收的数据转换为字节流,添加GZip文件头信息。Data preprocessing: Convert the received data into a byte stream and add GZip file header information.

其中,GZip文件头信息包括魔数、压缩方法等。Among them, the GZip file header information includes magic number, compression method, etc.

压缩处理:使用DEFLATE压缩算法对预处理后的数据进行压缩处理。Compression processing: Use the DEFLATE compression algorithm to compress the preprocessed data.

添加校验和:计算原始接收的数据和压缩后的数据的CRC32校验和,并将校验和添加到GZip文件末尾;计算原始接收的数据的长度,并将原始接收的数据的长度添加到GZip文件末尾。Add checksum: Calculate the CRC32 checksum of the original received data and the compressed data, and add the checksum to the end of the GZip file; calculate the length of the original received data, and add the length of the original received data to the end of the GZip file.

输出结果:输出最终的压缩数据。Output result: Output the final compressed data.

其中,Gzip压缩算法是一种无损压缩算法,其基础为DEFLATE压缩算法,Gzip压缩算法即对DEFLATE压缩算法进行封装,通过DEFLATE压缩算法得到Gzip格式的压缩数据。Among them, the Gzip compression algorithm is a lossless compression algorithm, which is based on the DEFLATE compression algorithm. The Gzip compression algorithm encapsulates the DEFLATE compression algorithm and obtains compressed data in the Gzip format through the DEFLATE compression algorithm.

S35a、判断缓存空间中的压缩数据的数量是否达到预设阈值。S35a: Determine whether the amount of compressed data in the cache space reaches a preset threshold.

其中,预设阈值可以根据实际情况进行设置。因为IO操作和处理数据的过程对资源的消耗很大,通过批量处理的方法,可以减少频繁的输入和输出操作,提高整体的处理效率,同时也更适合处理大量数据的场景。The preset threshold can be set according to the actual situation. Because IO operations and data processing consume a lot of resources, batch processing can reduce frequent input and output operations, improve overall processing efficiency, and is more suitable for processing large amounts of data.

S36a、若缓存空间中的压缩数据的数量达到预设阈值,则基于哈希函数及哈希表对压缩数据批量进行处理,并将压缩数据存储至双向链表中。S36a. If the amount of compressed data in the cache space reaches a preset threshold, the compressed data is processed in batches based on the hash function and the hash table, and the compressed data is stored in a bidirectional linked list.

其中,所述双向链表中的每个链表节点存储一条所述压缩数据。Wherein, each linked list node in the bidirectional linked list stores one piece of the compressed data.

具体的,图4是本发明实施例提供的一种根据哈希表查找压缩数据在双向链表中对应的链表节点的位置的示意图,参见图4,基于哈希函数及哈希表对压缩数据批量进行处理,并将压缩数据存储至双向链表具体包括:Specifically, FIG. 4 is a schematic diagram of a method for finding a position of a linked list node corresponding to compressed data in a bidirectional linked list according to a hash table provided by an embodiment of the present invention. Referring to FIG. 4 , batch processing of compressed data based on a hash function and a hash table and storing the compressed data in a bidirectional linked list specifically includes:

基于哈希函数,分别根据每条压缩数据的关键字计算压缩数据的哈希码。Based on the hash function, the hash code of the compressed data is calculated according to the keyword of each compressed data.

其中,当两个不同的压缩数据的关键字产生相同的哈希码,同样可以采用链地址法或开放寻址法解决哈希码冲突问题。Among them, when the keywords of two different compressed data generate the same hash code, the chain address method or open addressing method can also be used to solve the hash code conflict problem.

根据压缩数据的哈希码以及哈希表,查找压缩数据在双向链表中对应的链表节点的位置。According to the hash code of the compressed data and the hash table, find the position of the linked list node corresponding to the compressed data in the doubly linked list.

若哈希表中存在与压缩数据对应的链表节点,则将压缩数据存储至对应的链表节点。If there is a linked list node corresponding to the compressed data in the hash table, the compressed data is stored in the corresponding linked list node.

若哈希表中不存在与压缩数据对应的链表节点,则创建一个新的链表节点,将新的链表节点的键值对储存至哈希表,并根据哈希表将压缩数据存储至新的链表节点中。If there is no linked list node corresponding to the compressed data in the hash table, a new linked list node is created, the key-value pair of the new linked list node is stored in the hash table, and the compressed data is stored in the new linked list node according to the hash table.

进一步的,获取压缩数据的数据长度,并根据数据长度确定新的链表节点中的数据长度变量的值。Furthermore, the data length of the compressed data is obtained, and the value of the data length variable in the new linked list node is determined according to the data length.

根据数据长度变量的值为新的链表节点中的数据域分配内存空间。Allocate memory space for the data field in the new linked list node according to the value of the data length variable.

将压缩数据存储至新的链表节点的数据域中。Store the compressed data in the data field of the new linked list node.

S37a、若缓存空间中的压缩数据的数量未达到预设阈值,则继续接收下一组数据。S37a: If the amount of compressed data in the cache space does not reach the preset threshold, continue to receive the next set of data.

具体的,图5是本发明实施例提供的一种基于哈希表和双向链表进行数据的获取的方法的逻辑图,参见图5,基于哈希表和双向链表,进行数据读取,具体包括:Specifically, FIG. 5 is a logic diagram of a method for acquiring data based on a hash table and a bidirectional linked list provided in an embodiment of the present invention. Referring to FIG. 5 , data reading is performed based on a hash table and a bidirectional linked list, specifically including:

S31b、向哈希表中输入所需数据的关键字。S31b. Input the keyword of the required data into the hash table.

S32b、基于哈希函数,对所需数据的关键字进行计算得到所需数据的哈希码。S32b. Based on the hash function, the keyword of the required data is calculated to obtain a hash code of the required data.

S33b、根据所需数据的哈希码及哈希表定位对应的链表节点在双向链表中的位置。S33b, locating the position of the corresponding linked list node in the bidirectional linked list according to the hash code of the required data and the hash table.

S34b、若双向链表中存在对应的链表节点,则读取对应的链表节点中的数据。S34b. If there is a corresponding linked list node in the bidirectional linked list, read the data in the corresponding linked list node.

S35b、若双向链表中不存在对应的链表节点,则返回空值。S35b. If there is no corresponding linked list node in the bidirectional linked list, a null value is returned.

本发明通过改进链表结构,以及根据数据长度变量分配相应的内存空间大小,使链表能够不依赖其他函数实现内存空间的动态分配,优化内存管理,避免产生内存碎片,充分利用内存空间,提高系统性能;基于链表构建哈希表,并根据数据的关键字通过哈希表直接定位对应的链表节点的位置,实现数据的快速存取,无需遍历链表每个节点,一一比较查找,提高了系统运行效率,通过哈希表从双向链表中读取数据或向双向链表中写入数据的设计考虑了数据的安全性和可靠性,能够有效地防止数据的丢失或被篡改;同时,本方案通过对数据进行压缩处理再存储的方式,节约了存储空间,提高内存利用率;通过设置阈值,对数据进行批量处理,一次性存储批量数据,避免了频繁的内存申请与释放导致的占用大量的系统资源的问题,降低了系统开销,进一步提高系统运行效率,从而为IDPS功能提供有力支持,应对复杂网络攻击。The present invention improves the linked list structure and allocates the corresponding memory space size according to the data length variable, so that the linked list can realize dynamic allocation of memory space without relying on other functions, optimizes memory management, avoids memory fragmentation, makes full use of memory space, and improves system performance; constructs a hash table based on the linked list, and directly locates the position of the corresponding linked list node through the hash table according to the data keyword, so as to realize fast access to data, without traversing each node of the linked list and comparing and searching one by one, thereby improving the operation efficiency of the system; the design of reading data from the bidirectional linked list or writing data to the bidirectional linked list through the hash table takes into account the security and reliability of the data, and can effectively prevent the loss or tampering of the data; at the same time, the scheme saves storage space and improves memory utilization by compressing and storing the data; by setting a threshold, batch processing is performed on the data, and batch data is stored at one time, so as to avoid the problem of occupying a large amount of system resources caused by frequent memory application and release, reduce system overhead, and further improve the operation efficiency of the system, thereby providing strong support for the IDPS function and coping with complex network attacks.

本技术方案可以广泛应用于各种需要对网络数据进行存储和处理的场景,如网络监控、网络攻击检测、数据分析等,满足了市场对于高效、安全、低成本的数据存储和处理的需求,在计算机网络安全、数据存储、高效内存管理等应用领域可以有广泛的应用。This technical solution can be widely used in various scenarios that require storage and processing of network data, such as network monitoring, network attack detection, data analysis, etc., meeting the market demand for efficient, secure, and low-cost data storage and processing, and can be widely used in application fields such as computer network security, data storage, and efficient memory management.

图6是本发明实施例提供的一种基于线性空间链表的数据存取系统的结构示意图,该系统用于执行上述实施例所述的一种基于线性空间链表的数据存取方法,如图6所示,系统包括以下模块:FIG6 is a schematic diagram of the structure of a data access system based on a linear space linked list provided by an embodiment of the present invention. The system is used to execute a data access method based on a linear space linked list described in the above embodiment. As shown in FIG6 , the system includes the following modules:

链表构建单元,用于基于线性空间构建双向链表;其中,双向链表包括若干链表节点,每个链表节点包括数据域和指针域,指针域包括前驱节点指针、后继节点指针、以及数据长度变量,前驱节点指针指向当前链表节点的前一链表节点,后继节点指针指向当前链表节点的后一链表节点,数据长度变量的值为数据域中存储的变长数据的数据长度,数据域的内存空间大小与数据长度变量的值一致。A linked list construction unit is used to construct a bidirectional linked list based on a linear space; wherein the bidirectional linked list includes a number of linked list nodes, each of which includes a data field and a pointer field, the pointer field includes a predecessor node pointer, a successor node pointer, and a data length variable, the predecessor node pointer points to the previous linked list node of the current linked list node, the successor node pointer points to the next linked list node of the current linked list node, the value of the data length variable is the data length of the variable-length data stored in the data field, and the memory space size of the data field is consistent with the value of the data length variable.

哈希表构建单元,与链表构建单元相连,用于基于双向链表设定哈希表的键值对,建立哈希表。The hash table construction unit is connected to the linked list construction unit and is used to set the key-value pairs of the hash table based on the bidirectional linked list to establish the hash table.

处理单元,与链表构建单元和哈希表构建单元相连,用于基于哈希表和双向链表,进行数据储存和数据读取;其中,储存的数据是经压缩处理后的数据。The processing unit is connected to the linked list construction unit and the hash table construction unit, and is used for storing and reading data based on the hash table and the bidirectional linked list; wherein the stored data is compressed data.

图7是本申请实施例提供的一种电子设备的结构示意图。如图7所示,电子设备500包括一个或多个处理器501和存储器502。FIG7 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. As shown in FIG7 , the electronic device 500 includes one or more processors 501 and a memory 502 .

处理器501可以是中央处理单元(CPU)或者具有数据处理能力和/或指令执行能力的其他形式的处理单元,并且可以控制电子设备500中的其他组件以执行期望的功能。The processor 501 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 500 to perform desired functions.

存储器502可以包括一个或多个计算机程序产品,所述计算机程序产品可以包括各种形式的计算机可读存储介质,例如易失性存储器和/或非易失性存储器。所述易失性存储器例如可以包括随机存取存储器(RAM)和/或高速缓冲存储器(cache)等。所述非易失性存储器例如可以包括只读存储器(ROM)、硬盘、闪存等。在所述计算机可读存储介质上可以存储一个或多个计算机程序指令,处理器501可以运行所述程序指令,以实现上文所说明的本申请任意实施例的一种基于线性空间链表的数据存取方法以及/或者其他期望的功能。在所述计算机可读存储介质中还可以存储诸如初始外参、阈值等各种内容。The memory 502 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and/or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 501 may run the program instructions to implement a data access method based on a linear space linked list and/or other desired functions of any embodiment of the present application described above. Various contents such as initial external parameters, thresholds, etc. may also be stored in the computer-readable storage medium.

在一个示例中,电子设备500还可以包括:输入装置503和输出装置504,这些组件通过总线系统和/或其他形式的连接机构(未示出)互连。该输入装置503可以包括例如键盘、鼠标等等。该输出装置504可以向外部输出各种信息,包括预警提示信息、制动力度等。该输出装置504可以包括例如显示器、扬声器、打印机、以及通信网络及其所连接的远程输出设备等等。In one example, the electronic device 500 may further include: an input device 503 and an output device 504, which are interconnected via a bus system and/or other forms of connection mechanisms (not shown). The input device 503 may include, for example, a keyboard, a mouse, etc. The output device 504 may output various information to the outside, including early warning prompt information, braking force, etc. The output device 504 may include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, etc.

当然,为了简化,图7中仅示出了该电子设备500中与本申请有关的组件中的一些,省略了诸如总线、输入/输出接口等等的组件。除此之外,根据具体应用情况,电子设备500还可以包括任何其他适当的组件。Of course, for simplicity, FIG7 only shows some of the components related to the present application in the electronic device 500, omitting components such as a bus, an input/output interface, etc. In addition, the electronic device 500 may also include any other appropriate components according to specific application scenarios.

除了上述方法和设备以外,本申请的实施例还可以是计算机程序产品,其包括计算机程序指令,所述计算机程序指令在被处理器运行时使得所述处理器执行本申请任意实施例所提供的一种基于线性空间链表的数据存取方法。In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute a data access method based on a linear space linked list provided in any embodiment of the present application.

所述计算机程序产品可以以一种或多种程序设计语言的任意组合来编写用于执行本申请实施例操作的程序代码,所述程序设计语言包括面向对象的程序设计语言,诸如Java、C++等,还包括常规的过程式程序设计语言,诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

此外,本申请的实施例还可以是计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令在被处理器运行时使得所述处理器执行本申请任意实施例所提供的一种基于线性空间链表的数据存取方法。In addition, an embodiment of the present application may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes a data access method based on a linear space linked list provided in any embodiment of the present application.

所述计算机可读存储介质可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以包括但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

需要说明的是,本发明所用术语仅为了描述特定实施例,而非限制本申请范围。如本发明说明书中所示,除非上下文明确提示例外情形,“一”、“一个”、“一种”和/或“该”等词并非特指单数,也可包括复数。术语“包括”、“包含”或者其任何其它变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法或者设备不仅包括那些要素,而且还包括没有明确列出的其它要素,或者是还包括为这种过程、方法或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法或者设备中还存在另外的相同要素。It should be noted that the terms used in the present invention are only for describing specific embodiments, rather than limiting the scope of the present application. As shown in the present specification, unless the context clearly indicates an exception, the words "one", "a", "a kind of" and/or "the" do not specifically refer to the singular, but may also include the plural. The terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method or device. In the absence of more restrictions, the elements defined by the sentence "include one..." do not exclude the presence of other identical elements in the process, method or device including the elements.

还需说明的是,术语“中心”、“上”、“下”、“左”、“右”、“竖直”、“水平”、“内”、“外”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。除非另有明确的规定和限定,术语“安装”、“相连”、“连接”等应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明中的具体含义。It should also be noted that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. Unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", etc. should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the technical solutions of the embodiments of the present invention.

Claims (10)

1. The data access method based on the linear space linked list is characterized by comprising the following steps:
Constructing a doubly linked list based on the linear space; wherein the linear space is a continuous address space which is allocated in advance and is used for storing a data structure; the bidirectional linked list comprises a plurality of linked list nodes, each linked list node comprises a data field and a pointer field, the pointer field comprises a precursor node pointer, a subsequent node pointer and a data length variable, the precursor node pointer points to a previous linked list node of the current linked list node, the subsequent node pointer points to a subsequent linked list node of the current linked list node, the value of the data length variable is the data length of data to be stored, and the memory space size of the data field is consistent with the value of the data length variable;
Setting key value pairs of a hash table based on the doubly linked list, and establishing the hash table;
Based on the hash table and the doubly linked list, data storage and data reading are carried out; wherein the stored data is the data after compression processing.
2. The method for accessing data based on linear spatial linked list according to claim 1, wherein said setting up hash table based on key value pairs of said doubly linked list comprises:
Calculating by using the first n bytes of each linked list node in the bidirectional linked list as keywords through a hash function to obtain hash codes of the linked list nodes, and using the hash codes as keys corresponding to the linked list nodes in a hash table;
Taking the address of the linked list node as a value corresponding to the linked list node in a hash table;
And determining key value pairs of the linked list nodes according to keys and values corresponding to each linked list node in the hash table, and establishing the hash table.
3. The data access method based on the linear space linked list according to claim 2, wherein the data storage based on the hash table and the doubly linked list specifically comprises:
Initializing the bidirectional linked list;
Storing the received data into a cache space;
Adding a packet header to the data in the cache space, and packaging to obtain packaged data;
Compressing the packaged data to obtain compressed data;
Judging whether the quantity of the compressed data in the cache space reaches a preset threshold value or not;
If the quantity of the compressed data in the cache space reaches a preset threshold value, processing the compressed data in batches based on the hash function and the hash table, and storing the compressed data into the doubly linked list; wherein each linked list node in the doubly linked list stores one piece of compressed data;
And if the quantity of the compressed data in the cache space does not reach a preset threshold value, continuing to receive the next group of data.
4. The method for accessing data based on a linear space linked list according to claim 3, wherein if the number of compressed data in the buffer space reaches a preset threshold, processing the compressed data in batches based on the hash function and the hash table, and storing the compressed data in the doubly linked list, specifically comprising:
Based on the hash function, calculating hash codes of the compressed data according to the keywords of each compressed data respectively;
Searching the position of a linked list node corresponding to the compressed data in the doubly linked list according to the hash code of the compressed data and the hash table;
if the linked list node corresponding to the compressed data exists in the hash table, storing the compressed data to the corresponding linked list node;
If the linked list node corresponding to the compressed data does not exist in the hash table, a new linked list node is created, key value pairs of the new linked list node are stored in the hash table, and the compressed data is stored in the new linked list node according to the hash table.
5. The method of claim 4, wherein if there is no linked list node corresponding to the compressed data in the hash table, creating a new linked list node, storing key pairs of the new linked list node in the hash table, and storing the compressed data in the new linked list node according to the hash table comprises:
Acquiring the data length of the compressed data, and determining the value of the data length variable in a new linked list node according to the data length;
Memory space is allocated for the data fields in the new linked list nodes according to the values of the data length variables;
storing the compressed data into the data field of the new linked list node.
6. The method for accessing data based on linear space linked list according to claim 3, wherein compressing data in the cache space to obtain compressed data comprises:
the data in the cache space is compressed by adopting a GZip compression algorithm, which comprises the following steps:
data preprocessing: converting the received data into a byte stream, and adding the GZip file header information;
compression treatment: compressing the preprocessed data by using a DEFLATE compression algorithm;
Adding a checksum: calculating CRC32 checksum of the original received data and the compressed data, and adding the checksum to the end of the GZip file; calculating the length of the original received data, and adding the length of the original received data to the tail of the GZip file;
outputting a result: and outputting the final compressed data.
7. The data access method based on the linear space linked list according to claim 2, wherein the data reading is performed based on the hash table and the doubly linked list, specifically comprising:
Inputting a keyword of required data into the hash table;
based on the hash function, calculating the key words of the required data to obtain the hash codes of the required data;
positioning the position of the corresponding linked list node in the double linked list according to the hash code of the required data and the hash table;
If the corresponding linked list node exists in the bidirectional linked list, reading data in the corresponding linked list node;
And if the corresponding linked list node does not exist in the bidirectional linked list, returning a null value.
8. A data access system based on a linear spatial linked list, the system comprising the following modules:
The linked list construction unit is used for constructing a bidirectional linked list based on the linear space; wherein the linear space is a continuous address space which is allocated in advance and is used for storing a data structure; the bidirectional linked list comprises a plurality of linked list nodes, each linked list node comprises a data field and a pointer field, the pointer field comprises a precursor node pointer, a subsequent node pointer and a data length variable, the precursor node pointer points to a previous linked list node of the current linked list node, the subsequent node pointer points to a subsequent linked list node of the current linked list node, the value of the data length variable is the data length of variable-length data stored in the data field, and the memory space size of the data field is consistent with the value of the data length variable;
the hash table construction unit is connected with the linked list construction unit and is used for setting key value pairs of the hash table based on the bidirectional linked list to establish the hash table;
the processing unit is connected with the linked list construction unit and the hash table construction unit and is used for storing and reading data based on the hash table and the bidirectional linked list; wherein the stored data is the data after compression processing.
9. An electronic device, the electronic device comprising:
a processor and a memory;
the processor is configured to execute the linear space linked list based data access method according to any one of claims 1 to 7 by calling a program or instructions stored in the memory.
10. A computer-readable storage medium storing a program or instructions that cause a computer to perform the linear space linked list based data access method of any one of claims 1 to 7.
CN202411045149.1A 2024-08-01 2024-08-01 Data access method, system, equipment and medium based on linear space linked list Active CN118568310B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411045149.1A CN118568310B (en) 2024-08-01 2024-08-01 Data access method, system, equipment and medium based on linear space linked list

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411045149.1A CN118568310B (en) 2024-08-01 2024-08-01 Data access method, system, equipment and medium based on linear space linked list

Publications (2)

Publication Number Publication Date
CN118568310A CN118568310A (en) 2024-08-30
CN118568310B true CN118568310B (en) 2024-11-05

Family

ID=92473265

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411045149.1A Active CN118568310B (en) 2024-08-01 2024-08-01 Data access method, system, equipment and medium based on linear space linked list

Country Status (1)

Country Link
CN (1) CN118568310B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103384884A (en) * 2012-12-11 2013-11-06 华为技术有限公司 A file compression method, file decompression method, device and server
CN111061434A (en) * 2019-12-17 2020-04-24 人和未来生物科技(长沙)有限公司 Gene compression multi-stream data parallel writing and reading method, system and medium
CN117215497A (en) * 2023-10-18 2023-12-12 深圳市斯康达电子有限公司 Data storage method, system, equipment and medium based on two-dimensional ID addressing

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AUPR464601A0 (en) * 2001-04-30 2001-05-24 Commonwealth Of Australia, The Shapes vector
CN101826054B (en) * 2009-03-04 2011-12-07 安凯(广州)微电子技术有限公司 Memory management method of micromemory system
CN101968795B (en) * 2010-09-03 2012-05-09 清华大学 Cache method for file system with changeable data block length

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103384884A (en) * 2012-12-11 2013-11-06 华为技术有限公司 A file compression method, file decompression method, device and server
CN111061434A (en) * 2019-12-17 2020-04-24 人和未来生物科技(长沙)有限公司 Gene compression multi-stream data parallel writing and reading method, system and medium
CN117215497A (en) * 2023-10-18 2023-12-12 深圳市斯康达电子有限公司 Data storage method, system, equipment and medium based on two-dimensional ID addressing

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于双表结构的网络抽样数据流存储方案;陈朝晖;左进;;信息与电脑(理论版);20160308(第05期);162-164 *

Also Published As

Publication number Publication date
CN118568310A (en) 2024-08-30

Similar Documents

Publication Publication Date Title
US11175945B2 (en) System and method for distributed security forensics using process path encoding
WO2022143540A1 (en) Block chain index storage method and apparatus, computer device and medium
US9300578B2 (en) Large receive offload functionality for a system on chip
CN114928562B (en) A traffic processing method and system for a graph computing platform
CN115964319A (en) Data processing method for remote direct memory access and related products
CN106095698A (en) OO caching write, read method and device
CN113806443A (en) A data trusted storage method, system, medium, device and terminal
WO2023193528A1 (en) File decompression method and apparatus, and electronic device and computer-readable storage medium
CN114296646B (en) Caching method, device, server and storage medium based on IO service
WO2021098393A1 (en) Method and apparatus for intelligent system resource monitoring, electronic device, and storage medium
CN118568310B (en) Data access method, system, equipment and medium based on linear space linked list
CN114205115B (en) A data packet processing optimization method, device, equipment and medium
CN115941310A (en) Abnormal network traffic detection method, device, computer equipment and storage medium
CN102779110B (en) Multi-core system and its control method based on remote code call and data access
CN114553469A (en) Message processing method, device, equipment and storage medium
CN118860992A (en) Data and container file reading method, device, system, medium and program product
WO2024174550A1 (en) Data processing method, processor, storage device, interface card, and storage medium
CN116501710A (en) A non-intrusion log compression method, system, device and storage medium
CN115495406A (en) A PCIe-based message transmission method, device, equipment and storage medium
CN118827808A (en) Method, electronic device and computer program product for compressing a data block
CN120524529B (en) Data security processing method, device, computer equipment and storage medium
CN119766564B (en) Trust chain safe and reliable computing and data transmission method, equipment and storage medium based on intelligent computing platform
US11188339B2 (en) System and method for an external processor to access internal registers
CN114817688A (en) User information loading method and device, electronic equipment and storage medium
JP6163678B2 (en) General unpacking of program binaries

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant