Batch data processing method and device, computer device and storage medium

CN122994259APending Publication Date: 2026-10-27CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611061211.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-16
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0003]相关技术中,基于epoll的Redis网络I/O方案受限于事件处理粒度单一、数据冗余拷贝、用户态模块协议解析、缓冲区管理低效以及硬件资源未能充分利用等问题,在高并发、高速网络场景下难以满足日益严苛的低延迟和高吞吐需求

Benefits of technology

[0010]本公开实施例采用的上述至少一个技术方案能够达到以下有益效果:通过预设网络接口获取多个数据,并将多个数据写入预设的环形存储区内;分别对环形存储区内的多个数据进行解析,以生成每个数据的数据描述信息,其中,数据描述信息包括存储位置信息;通过单次系统调用批量获取来自多个客户端的多个就绪事件,每个就绪事件对应一个数据请求,每个就绪事件中携带有根据数据描述信息确定的数据请求的存储位置信息和执行优先级;按照执行优先级从高到低的顺序,依次针对每个执行优先级级别中的多个数据请求,分别根据每个数据请求的存储位置信息,从环形存储区读取对应的数据,并将读取的数据反馈至该数据请求对应的客户端。基于此,本公开实施例通过上述手段,在数据获取、存储、解析、匹配、读取和反馈的每一个环节上均实现了对传统方案的实质性改进,系统调用频率、内存拷贝开销、协议解析冗余等多维度性能瓶颈得到同步缓解,最终实现了数据处理全链路性能的系统性提升。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122994259A_ABST
    Figure CN122994259A_ABST
Patent Text Reader

Abstract

The present disclosure relates to a batch data processing method and device, computer equipment and storage medium. Including through the preset network interface obtains a plurality of data, and write a plurality of data in the preset annular storage area;Respectively, the plurality of data in the annular storage area is parsed to generate the data description information of each data;Through single system call batch acquisition from a plurality of clients a plurality of ready events, each ready event corresponds to a data request, each ready event carries the storage location information and execution priority of the data request determined according to the data description information;According to the order from high to low of execution priority, in turn, for a plurality of data requests in each execution priority level, respectively according to the storage location information of each data request, read the corresponding data from the annular storage area, and feed back the read data to the client corresponding to the data request. Thus, the memory bandwidth occupied by a large number of data handling is released.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, and in particular to a method, apparatus, computer equipment, and storage medium for processing batch data. Background Technology

[0002] In traditional Redis network architecture, a single-threaded event-driven model is typically used, which relies on the epoll mechanism provided by the Linux kernel to achieve efficient management of multiple client connections.

[0003] Among related technologies, Redis network I / O solutions based on epoll are limited by issues such as single event processing granularity, redundant data copying, user-space module protocol parsing, inefficient buffer management, and underutilization of hardware resources. They are unable to meet the increasingly stringent requirements for low latency and high throughput in high-concurrency and high-speed network scenarios. Summary of the Invention

[0004] In view of the above, this disclosure provides a method, apparatus, computer device, and storage medium for processing batch data to solve the problems existing in the related art.

[0005] A first aspect of this disclosure provides a method for processing batch data. The method includes: acquiring multiple data sets through a preset network interface and writing the multiple data sets into a preset circular storage area; parsing the multiple data sets in the circular storage area to generate data description information for each data set, wherein the data description information includes storage location information; acquiring multiple ready events from multiple clients in a single system call, each ready event corresponding to a data request, each ready event carrying storage location information and execution priority of the data request determined according to the data description information; and sequentially reading the corresponding data from the circular storage area according to the storage location information of each data request for each data request in descending order of execution priority, and feeding back the read data to the client corresponding to the data request.

[0006] A second aspect of this disclosure provides a batch data processing apparatus, applied to the batch data processing selection method of the first aspect. The apparatus includes: a writing module, configured to acquire multiple data points through a preset network interface and write the multiple data points into a preset circular storage area; a parsing module, configured to parse the multiple data points in the circular storage area to generate data description information for each data point, wherein the data description information includes storage location information; an acquisition module, configured to acquire multiple ready events from multiple clients in a single system call, each ready event corresponding to a data request, each ready event carrying storage location information and execution priority of the data request determined according to the data description information; and a reading and feedback module, configured to sequentially read the corresponding data from the circular storage area according to the storage location information of each data request for each execution priority level, in descending order of execution priority, and feed the read data back to the client corresponding to the data request.

[0007] A third aspect of this disclosure provides a computer device including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above-described batch data processing method.

[0008] A fourth aspect of this disclosure provides a computer-readable storage medium having a computer program / operation instructions stored thereon, which, when executed by a processor, implement the steps of the above-described batch data processing method.

[0009] According to a fifth aspect of this disclosure, a computer program product is provided that, when executed by a processor, implements the steps of the above-described batch data processing method.

[0010] The at least one technical solution adopted in this disclosure can achieve the following beneficial effects: Multiple data points are acquired through a preset network interface and written into a preset ring storage area; the multiple data points in the ring storage area are parsed to generate data description information for each data point, wherein the data description information includes storage location information; multiple ready events from multiple clients are acquired in batches through a single system call, each ready event corresponding to a data request, and each ready event carries the storage location information and execution priority of the data request determined according to the data description information; according to the execution priority from high to low, multiple data requests at each execution priority level are sequentially processed, and the corresponding data is read from the ring storage area according to the storage location information of each data request, and the read data is fed back to the client corresponding to the data request. Based on this, this disclosure, through the above means, achieves substantial improvements over traditional solutions in every stage of data acquisition, storage, parsing, matching, reading, and feedback, simultaneously alleviating performance bottlenecks in multiple dimensions such as system call frequency, memory copy overhead, and protocol parsing redundancy, ultimately achieving a systematic improvement in the performance of the entire data processing chain. Attached Figure Description

[0011] The above and other objects, features, and advantages of this disclosure will become more apparent from the more detailed description of the embodiments thereof in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this disclosure and form part of the specification. They are used together with the embodiments of this disclosure to explain the disclosure and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.

[0012] Figure 1 A flowchart illustrating a batch data processing method according to an embodiment of this disclosure; Figure 2 This is a schematic diagram of a ring-shaped storage area provided in an embodiment of the present disclosure; Figure 3 This is a schematic diagram of the structure of a raw data area provided in an embodiment of the present disclosure; Figure 4 A schematic diagram of a batch data processing apparatus provided in an embodiment of this disclosure; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure; Figure 6 This is a schematic diagram of the structure of a computer system provided in an embodiment of the present disclosure; Figure 7 A schematic diagram of a computer program product provided according to an embodiment of this disclosure. Detailed Implementation

[0013] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0014] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0015] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc., used in this disclosure are only used to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.

[0016] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0017] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0018] Redis, a remote dictionary server, is widely used in caching acceleration, real-time computing, and distributed locks due to its low latency and high throughput. Traditional Redis network architectures typically employ a single-threaded event-driven model, leveraging the epoll mechanism provided by the Linux kernel for efficient management of multiple client connections. It's worth noting that epoll is a scalable input / output (I / O) event notification mechanism provided by the Linux kernel. By maintaining a list of ready events in the kernel and using callback notifications, it achieves efficient event distribution that only active connections are traversed in high-concurrency scenarios. Redis is an open-source, in-memory key-value store database, widely used as middleware for caching, message queuing, and real-time data processing due to its extremely high read / write performance and rich data structure support.

[0019] Specifically, Redis listens for network events in its main event loop using the `epoll_wait` call. Once the kernel detects a file descriptor is ready, `epoll_wait` returns a single ready event, and Redis immediately calls the corresponding processing function to perform data read / write operations. To shield against differences across operating systems, Redis encapsulates a unified event-driven library that dynamically selects the most efficient I / O multiplexing mechanism based on the underlying system environment during actual compilation. For example, it prioritizes `epoll` in Linux environments, while falling back to `select` or `poll` in older kernel versions or systems that do not support `epoll`. Compared to `select` (which monitors multiple file descriptors using a set of bitmasks) and `poll` (which monitors multiple file descriptors using a linked list array), `epoll` decouples event registration from event dispatch using a red-black tree and a ready linked list data structure. Unlike `select` and `poll`, it does not linearly scan all file descriptors with each call, enabling it to support tens of thousands of concurrent connections and effectively reducing CPU resource consumption and improving network throughput in high-concurrency scenarios. Among them, epoll_wait is an I / O event waiting system call provided by the Linux kernel. It is the core interface of the epoll multiplexing mechanism and is used to wait for and obtain ready file descriptor events.

[0020] However, with the continuous expansion of business scale and the rapid development of network hardware, the traditional Redis network architecture has gradually exposed multi-layered performance bottlenecks, making it difficult to fully meet the stringent business requirements of millisecond or even microsecond latency. Specifically, these bottlenecks manifest in the following three aspects: At the event handling mechanism level, traditional epoll only returns one ready event at a time. Redis needs to repeatedly call epoll_wait to obtain events in the event loop, and then call read or write separately for each event to read or write data, resulting in a system call frequency of hundreds of thousands of times per second. Furthermore, each system call involves a context switch between the user-space module and the kernel-space module, causing a significant amount of CPU time to be consumed by mode switching rather than actual data processing. In addition, each read call requires additional copying of data from the kernel socket buffer to the user-space module. This copying process is entirely CPU-dependent, and in high-speed network environments, memory bandwidth consumption can reach 30% to 40%. Moreover, RESP protocol parsing is entirely performed in the user-space module. For pipeline batch request scenarios, each data request needs to repeatedly parse the protocol header, and the parsing overhead can account for more than 20% of the total request latency. The combination of single-granularity event handling, redundant data copying, and user-space module protocol parsing leads to a severe waste of CPU resources. It's important to note that NUMA is a multiprocessor architecture where processors experience varying latency and bandwidth when accessing different physical memory locations. Accessing local memory (on the same node as the processor) is significantly faster than accessing remote memory (on other nodes). Pipeline, on the other hand, is a technology that packages multiple independent commands or operations into a single network request, sends it to the server, and then receives all execution results at once.

[0021] At the system scaling level, in multi-threaded scaling mode, global lock or connection pool contention leads to throughput fluctuations, making it difficult to achieve linear scaling with the increase in the number of CPU cores. Meanwhile, regarding buffer management, dynamic allocation strategies allocate read buffers independently for each connection, and frequent allocation and release operations cause memory fragmentation. While pre-allocating fixed memory pools can alleviate fragmentation, they struggle to handle sudden traffic surges, potentially leading to buffer overflows causing data loss or even connection termination, severely compromising service availability.

[0022] At the hardware resource utilization level, firstly, computationally intensive tasks such as Transport Layer Security (TLS) encryption / decryption and RESP parsing are entirely handled by the CPU, severely crowding out the processing capacity of core business logic. For example, the TLS handshake latency can be as high as 1200 microseconds. Secondly, conventional network interface cards (NICs) are limited to data link layer transmission and reception and do not participate in the hardware offloading of the aforementioned protocol processing or encryption calculations, resulting in the idle computing power of smart NICs and an inability to alleviate CPU load at the source. Furthermore, the Non-Uniform Memory Access (NUMA) problem in multi-server architectures also creates a bottleneck. The bandwidth limitations and increased latency caused by cross-node memory access result in severely insufficient overall performance scalability. It should be noted that RESP is a text-based protocol for communication between Redis clients and servers, encoding data transmission formats through specific prefix characters. It is simple and efficient but requires parsing line by line. TLS is an encryption protocol used to provide data encryption, authentication, and integrity protection in network communication, ensuring security during data transmission. Its handshake process requires multiple calculations and interactions, resulting in high latency.

[0023] It is evident that Redis network I / O solutions based on epoll in related technologies are limited by issues such as single event processing granularity, redundant data copying, user-space module protocol parsing, inefficient buffer management, and underutilization of hardware resources. As a result, they are unable to meet the increasingly stringent requirements for low latency and high throughput in high-concurrency and high-speed network scenarios.

[0024] To address the aforementioned issues, this disclosure provides a batch data processing method. It acquires multiple data points through a preset network interface and writes them to a ring-shaped storage area, achieving batch aggregation and unified storage of data. This avoids the frequent memory allocation and release overhead caused by each connection independently requesting buffers, fundamentally reducing memory fragmentation. Furthermore, the multiple data points within the ring-shaped storage area are centrally parsed to obtain data description information. This ensures that protocol parsing only needs to be performed once when each data point enters the ring-shaped storage area. Subsequent processing by the user-space module does not require repeated scanning and parsing of the original protocol header, effectively reducing CPU instruction redundancy in the protocol parsing stage.

[0025] Meanwhile, by acquiring multiple data requests from multiple clients through a single system call, the event acquisition operation, which would require hundreds of thousands of system calls in the traditional one-event-per-time model, can be completed in a single call. This greatly reduces the number of context switches between user-mode and kernel-mode modules, freeing up CPU resources from frequent mode switching and allowing them to be devoted more to actual data processing logic. Furthermore, by matching the data identification information carried by each data request with the parsed data description information in the ring memory area, the storage location of the data required by each request in the ring memory area can be directly located. The user-mode module processing logic no longer needs to copy data from the kernel buffer through read calls, but can directly access the data in the ring memory area, eliminating the redundant copy path between the kernel-mode and user-mode modules in the traditional solution and freeing up the memory bandwidth that is occupied by data movement.

[0026] Finally, data requests at each priority level are processed sequentially according to their execution priority from highest to lowest. This ensures that high-priority business data requests always receive processing resources first, guaranteeing that the real-time response of critical business operations is not affected by sudden traffic spikes from low-priority requests. This approach ensures overall system throughput while also addressing differentiated service quality requirements. Therefore, this embodiment of the present disclosure achieves substantial improvements over traditional solutions at every stage of data acquisition, storage, parsing, matching, reading, and feedback. This simultaneously alleviates performance bottlenecks across multiple dimensions, such as system call frequency, memory copy overhead, and protocol parsing redundancy, ultimately achieving a systematic improvement in the overall performance of the data processing chain.

[0027] The batch data processing method provided in this disclosure can be executed by a terminal or by a chip applied to the terminal.

[0028] For example, the aforementioned terminals may include one or more of the following: mobile phones, tablets, wearable devices, in-vehicle devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, handheld computers (PDAs), and wearable devices based on augmented reality (AR) and / or virtual reality (VR) technologies. They may also include, but are not limited to, remote control devices, wearable devices, streetlights, home appliances, and other smart terminals. This disclosure does not impose specific limitations on these aspects.

[0029] Figure 1 This is a flowchart illustrating a batch data processing method according to an embodiment of this disclosure. Figure 1As shown, the batch data processing method is applied to computing devices that host Redis services. The operating system of the computing device can typically divide memory access permissions into kernel-mode modules and user-mode modules. Kernel-mode modules are the privileged mode in which the operating system kernel runs, and can access all hardware resources and the kernel address space; user-mode modules are the non-privileged mode in which user processes run, and can only access their own user-mode module address space, and cannot directly access the kernel-mode module address space.

[0030] In this embodiment, steps S101 and S102 are executed by the kernel-mode module, and steps S103 and S104 are executed by the user-mode module. The kernel-mode module is responsible for data reception, storage, and protocol pre-parsing, while the user-mode module is responsible for batch event acquisition, data reading, and result feedback. The batch data processing method provided in this embodiment is described in detail below with reference to the accompanying drawings. Based on this, the batch data processing method of this embodiment includes: S101 acquires multiple data points through a preset network interface and writes the multiple data points into a preset ring-shaped storage area.

[0031] In some embodiments, the preset network interface can be a network interface card (NIC), such as a smart NIC or a data processing unit (DPU), or other forms of network interface devices. Taking a NIC as an example, multiple received network data packets can be directly written to the original data area of ​​a preset ring memory area through the Direct Memory Access (DMA) controller built into the NIC. This writing process does not require CPU involvement in data transfer; the data transfer between the NIC and the ring memory is entirely completed independently by the DMA controller, thereby achieving zero-copy data transfer between the NIC and the ring memory. Here, the NIC can support the RoCEv2 protocol or the RDMA protocol to achieve high-throughput, low-latency network data transmission.

[0032] In some embodiments, the ring-shaped memory area can be a shared memory buffer pre-allocated in physical memory. The `mmap` system call maps the physical address of this ring-shaped memory area to the address spaces of both the kernel-mode module and the user-mode module, allowing both modules to access the same physical memory through their respective virtual addresses, thus enabling data sharing between them. Therefore, in this ring-shaped memory area, data only needs to be stored once in physical memory, and both the kernel-mode and user-mode modules can access the same data through their respective address space mappings, avoiding the data copying overhead from the kernel-mode module to the user-mode module in related technologies. Simultaneously, since both kernel-mode and user-mode modules can directly access the data, the CPU no longer needs to execute data copy instructions, freeing up CPU computing power for business logic processing. `mmap` is a memory mapping system call that directly maps a memory region of a file or device to the virtual address space of a user process, allowing the process to directly read and write to that memory region without needing to copy data through the `read / write` system calls.

[0033] Figure 2 This is a schematic diagram of a ring-shaped storage area provided in one embodiment of the present disclosure. Figure 2 As shown, the circular storage area includes a raw data area 202 and a metadata area 201. The raw data area 202 stores multiple data items, while the metadata area 201 stores the data description information for each data item. The circular storage area also includes a pointer area 203, which stores read and write pointer values. The read pointer value indicates the offset of the currently read position within the circular storage area, and the write pointer value indicates the offset of the currently written position within the circular storage area. By storing the raw data area 202 and the metadata area 201 separately, user-space modules can directly access the metadata area 201 for fast matching upon receiving a data request, without scanning the entire raw data area 202. This effectively reduces the memory access scope and lowers the cache miss rate. Furthermore, the pointer area 203 is independently configured and its read / write progress is maintained by atomic operations, enabling lock-free concurrent access for producers and consumers without the need for locks, eliminating lock contention overhead. The three areas work together to provide the structural foundation for batch data storage, fast parsing, lock-free read / write, and dynamic expansion.

[0034] Figure 3 This is a schematic diagram of the structure of a raw data area provided in one embodiment of this disclosure. Figure 3As shown, a read pointer and a write pointer are set in the circular storage area. The read pointer and the write pointer move along the preset direction of the circular storage area. The read pointer is used to indicate the storage location information of the read data in the circular storage area, and the write pointer is used to indicate the storage location information of the data to be written in the circular storage area. After the data is written to the circular storage area, the position of the write pointer is updated along the preset direction. After the data is read from the circular storage area, the position of the read pointer is updated along the preset direction.

[0035] In some embodiments, both the read pointer and the write pointer can point to the original data area of ​​the circular memory area. Initially, both the read and write pointers point to the beginning of the original data area, i.e., both are 0, indicating that the circular memory area is empty. When data is written to the original data area, the write pointer increments by the length of data written in a preset direction; when data is read from the original data area, the read pointer increments by the length of data read in a preset direction. For example, initially, both the write and read pointers are 0. After writing 100 bytes of data, the write pointer increments by 100 to 100; after reading 30 bytes of data, the read pointer increments by 30 to 30. At this point, the difference between the write and read pointers is 70, indicating that there are still 70 bytes of valid data waiting to be processed. It should be noted that when the read or write pointer reaches the end of the original data area, it can automatically wrap back to the starting address using modulo operations to continue reading and writing, thus achieving a circular loop.

[0036] In some embodiments, during data flow in the circular memory area, the read pointer is moved in a preset direction by the user-space module after reading data, and the write pointer is moved in a preset direction by the DMA controller after writing data. Each modifies different variables, preventing simultaneous modification of the same pointer by both modules; therefore, no locking is required for mutual exclusion protection. It should be noted that the preset direction in the circular memory area refers to the movement direction of the read and write pointers within the buffer, typically a unidirectional increment from the start address to the end address. When the pointer reaches the end, it loops back to the beginning using modulo operations, achieving a circular loop.

[0037] Specifically, after data writing is complete, the write pointer is incremented by the length of the written data using an atomic operation; similarly, after the user-space module finishes reading data, the read pointer is incremented by the length of the read data using an atomic operation. Here, atomic operations ensure that the process from reading to computation to writing back is uninterrupted at the underlying level, preventing other modules from intervening and ensuring pointer consistency. Since only one side modifies the read and write pointers, and the modification process itself is guaranteed to be complete by atomic operations, producers and consumers can concurrently access the circular storage area without locking, thus eliminating the performance overhead caused by lock contention in traditional solutions. Furthermore, since both read and write pointer values ​​are atomic variables, updated through atomic operations, data consistency is further ensured during concurrent access by multiple threads or processes.

[0038] In some embodiments, memory barrier instructions can be used to ensure that pointer values ​​are updated only after data write operations are completed, preventing data inconsistency caused by out-of-order execution. Since only one party modifies the read and write pointers, and the modification process itself is guaranteed to be intact by atomic operations and memory barriers, producers and consumers can concurrently access the circular storage area without locking, thus eliminating the performance overhead caused by lock contention in traditional schemes. Furthermore, since both read and write pointer values ​​are atomic variables, updated through atomic operations, data consistency is further ensured during concurrent access by multiple threads or processes.

[0039] In some embodiments, the raw data area of ​​the circular memory region can be aligned to 64 bytes to match the CPU cache line size, thereby reducing cache misses; the metadata area can be aligned to 8 bytes to improve the execution efficiency of atomic operations. Through these memory alignment optimizations, the hardware performance of the CPU cache and atomic operation instructions can be fully utilized.

[0040] In some embodiments, to improve memory access performance in a multi-processor server architecture, a ring storage instance can be independently deployed on each Non-Uniform Memory Access (NUMA) node, allowing data writing and consumption to be completed on the local node, thereby avoiding the latency overhead of cross-node memory access. Simultaneously, network interface card (NIC) queue interrupts can be bound to the local CPU core to reduce cross-node interrupt handling overhead. These NUMA affinity optimization measures effectively improve the overall performance scalability in multi-processor server scenarios. NUMA is a multi-processor architecture where CPU access to local memory is much faster than access to remote memory; that is, access latency and bandwidth differ across memory locations.

[0041] S102, parse multiple data in the ring storage area to obtain data description information for each data, including storage location information.

[0042] In some embodiments, after the network interface card (NIC) writes data to the original data area of ​​the ring memory via the DMA controller, the protocol parsing module in the kernel mode can parse the multiple data items stored in the original data area separately to extract the data description information for each data item, and store the extracted data description information in the metadata area. The data description information stores location information. This location information indicates the storage location of the data in the original data area, such as the starting offset and length of the data within the original data area.

[0043] In some embodiments, parsing involves parsing the protocol header of the data to extract the metadata carried in the header. Taking Redis as an example, the Redis client and server communicate via RESP (Redis Serialization Protocol), and each data request uses RESP. The character indicates the beginning of the array, followed by the array length, for example... This indicates a SET command with three parameters. Therefore, the kernel-mode module can perform RESP header parsing on the data in the raw data area, extract key metadata such as command type (e.g., SET) and key length, and fill the metadata area as data description information. The starting offset and length of the data in the raw data area are also stored as storage location information.

[0044] Specifically, a state machine approach can be used to parse the RESP protocol data. First, it enters the initial state, waiting for the protocol header identifier (…). (Indicates the start of the array), received Then it enters the array length parsing state and reads the number of parameters (e.g.) (This indicates 3 parameters); then it enters the batch string parsing state, reading the parameter type and length (e.g., $3 indicates a 3-byte string following); finally, it enters the data extraction state, recording key metadata such as command type (e.g., SET) and key length, completing the parsing. Here, if the protocol header data is incomplete (e.g., only part of the data packet is received), the current parsing state is saved to the connection context, waiting for subsequent data to arrive before continuing parsing, avoiding blocking processing due to incomplete data.

[0045] In some embodiments, the data description information stored in the metadata area adopts a compact format (e.g., the command type occupies 1 byte and the key length occupies 4 bytes) to reduce memory usage and improve cache hit rate.

[0046] In this way, after the network card DMA write is completed, the protocol parsing module of the kernel-mode module centrally parses the data in the original data area, extracts metadata such as command type and key length, and stores it in a separate metadata area. This allows the user-mode module to directly access the metadata area for fast matching and routing after obtaining a data request, without having to scan the entire original data area, effectively reducing the memory access scope and lowering the cache miss rate. At the same time, the use of an RESP state machine for streaming parsing of the protocol header can save the parsing state when the data packet is incomplete, waiting for subsequent data, avoiding blocking the processing flow due to the arrival of partial data, and improving the robustness and real-time performance of protocol parsing in high-concurrency scenarios. The metadata area uses a compact format for storage, further reducing memory usage and improving the cache hit rate, thereby achieving an overall improvement in system performance in high-throughput, low-latency network data processing.

[0047] S103 retrieves multiple ready events from multiple clients in a single system call. Each ready event corresponds to a data request, and each ready event carries the storage location information and execution priority of the data request determined based on the data description information.

[0048] In some embodiments, the epoll_event structure can be extended. For example, the following fields can be added while retaining the original event type and user data fields: buffer_offset: The offset of the data in the circular storage area, used to indicate the specific storage location of the data corresponding to the data request in the original data area; cmd_type: The pre-parsed command type (such as SET, GET, DEL), which is used by user-space modules to quickly route to the corresponding command handler; data_len: The current readable data length, used to indicate the full length of the data corresponding to this data request.

[0049] With the above extensions, a single `epoll_wait` call can return multiple extended `epoll` events in batches. Each event structure directly carries the storage location information of the data request in the circular memory area (`buffer_offset` and `data_len`) as well as the pre-parsed command type (`cmd_type`). This allows user-space modules to directly locate the data and route it to the corresponding command handler based on the information in the structure after receiving batch data requests, without needing to obtain the above information through additional system calls or data copying. Here, the event is the carrier of the data request, and the data request is the specific content carried by the event.

[0050] With the above extensions, a single `epoll_wait` call can return multiple extended `epoll` events in batches. Each event structure directly carries the storage location information of the data request in the circular memory area (`buffer_offset` and `data_len`) as well as the pre-parsed command type (`cmd_type`). This allows the user-space module processing logic to directly locate the data and route it to the corresponding command handler based on the information in the structure after receiving a batch of data requests, without needing to obtain the above information through additional system calls or data copying. Here, the event is the carrier of the data request, and the data request is the specific content carried by the event.

[0051] In some embodiments of this disclosure, execution priority is used to indicate the scheduling priority of the data request. When parsing the protocol header of the data request, the kernel-mode module determines the execution priority of the data request based on the command type. For example, transaction commands (such as MULTI / EXEC) or online transaction requests can be classified as high priority, regular read / write commands (such as GET / SET) as medium priority, and background tasks as low priority. The kernel-mode module fills the determined execution priority into the extended epoll event structure and saves it along with the storage location information.

[0052] In some embodiments, when adding ready events to the ready queue, the kernel-mode module can arrange them in descending order of execution priority, placing high-priority events at the front of the queue and low-priority events at the back. Thus, when the user-mode module calls `epoll_wait`, the kernel retrieves multiple ready events (e.g., 1024) in batches from the front of the ready queue. These retrieved events are then sorted by priority from highest to lowest and returned to the user-mode module all at once.

[0053] In some embodiments, after receiving batch data requests, the user-space module processing logic can directly process them in the order they were received, that is, process all requests in the high-priority queue first, then process the medium-priority queue, and finally process the low-priority queue, thereby ensuring the real-time response of high-priority services.

[0054] By extending the standard `epoll_event` structure with the addition of `buffer_offset`, `cmd_type`, and `data_len` fields, a single `epoll_wait` call can return multiple ready events in batches. Each event directly carries information about the data's storage location in the circular memory area and the pre-parsed command type. Therefore, upon receiving a batch data request, the user-space module's processing logic can directly locate the data and route it to the corresponding command processor based on the information carried in the event structure. This eliminates the need for additional `read` system calls to copy data from the kernel buffer or for re-scanning and parsing the protocol header, reducing the system call frequency from multiple calls to once. This significantly reduces the number of context switches between the user-space and kernel-space modules, eliminates redundant data copy paths between them, and frees up memory bandwidth and CPU resources previously consumed by data handling.

[0055] S104: In order of execution priority from high to low, for each data request in each execution priority level, read the corresponding data from the circular storage area according to the storage location information of each data request, and feed back the read data to the client corresponding to the data request.

[0056] In some embodiments, after a user-space module obtains multiple ready events through a single system call, it can process multiple data requests at each priority level in descending order of execution priority.

[0057] In some embodiments, the execution priority may include a first execution priority and a second execution priority. Following the order of execution priority from high to low, multiple data items are read from the circular storage area according to the storage location information of multiple data requests at each level, including: Multiple data requests with a first execution priority are classified as the first type of data requests, and multiple data requests with a second execution priority are classified as the second type of data requests. Based on the storage location information of each data request in the first type of data requests, the corresponding data is read from the circular storage area and fed back to the corresponding client. After all the data corresponding to the first type of data requests has been read and fed back, based on the storage location information of each data request in the second type of data requests, the corresponding data is read from the circular storage area and fed back to the corresponding client.

[0058] Specifically, the user-space module can classify multiple data requests with a first execution priority as first-class data requests and multiple data requests with a second execution priority as second-class data requests. Taking Redis as an example, transaction commands (such as MULTI / EXEC) or online transaction requests can be classified as first-class execution priority (high priority), while regular read / write commands (such as GET / SET) can be classified as second-class execution priority (medium or low priority).

[0059] Based on this, the system first locates and reads the corresponding data from the original data area of ​​the circular storage area according to the storage location information of each data request in the first type of data request (i.e., the `buffer_offset` and `data_len` fields in the extended `epoll` event structure), and then sends the read data back to the corresponding client. After all the data corresponding to the first type of data request has been read and sent back, the user-space module processing logic then locates and reads the corresponding data from the original data area of ​​the circular storage area according to the storage location information of each data request in the second type of data request, and sends the read data back to the corresponding client. If a third execution priority exists, the user-space module processing logic processes the data requests of the third execution priority after completing the processing of all data requests of the second execution priority, and so on.

[0060] Here, when the user-mode module processing logic reads data from the original data area of ​​the ring memory, it directly locates and reads the corresponding data from the original data area based on the starting offset and data length in the storage location information, without having to copy data from the kernel buffer through the read system call, thus achieving zero-copy data reading.

[0061] As can be seen, by prioritizing execution based on command type and arranging ready events in order of priority in the kernel-mode module, and processing data requests of each priority level in batches sequentially in the user-mode module, it is ensured that critical business operations such as transaction commands can obtain processing resources first in high-concurrency scenarios. This ensures the overall throughput capacity of the operating system while also taking into account the differentiated service quality requirements. The extended event structure decouples metadata from data payload, allowing the user-mode module to directly access the metadata area for fast matching, reducing the scope of memory access and cache miss rate, and further improving the event processing efficiency and overall system performance in high-concurrency scenarios.

[0062] In some embodiments, the user-space module can employ a preemptive scheduling strategy. This means that when a high-priority data request arrives, the currently processing low-to-medium priority tasks can be paused, and the high-priority data request can be processed first, ensuring the real-time response of critical business operations. For example, when the user-space module is processing a GET request with a second execution priority, if a new SET request with a first execution priority arrives, the processing of the current GET request is paused, and the SET request is processed first. The processing of the GET request resumes only after all first-priority requests have been processed.

[0063] In some embodiments, to prevent low-priority data requests from remaining unprocessed for extended periods due to a continuous influx of high-priority requests, processing quotas can be configured for each priority category. For example, after processing a certain number of high-priority requests, a low-priority request can be forced to be processed; or within each scheduling cycle, time slices (e.g., 60%, 30%, 10%) can be allocated to high, medium, and low priority queues respectively to ensure that low-priority requests still receive some processing resources under high load.

[0064] In some embodiments, after completing data reading, the user-space module can also update the read pointer value of the circular memory pointer area through atomic operations, incrementing the read pointer by the length of the read data and releasing the circular memory space occupied by the processed data. Simultaneously, the user-space module routes the data request to the corresponding command handler (e.g., SET commands are routed to the SET command handler function, GET commands to the GET command handler function) based on the command type (cmd_type) carried in each event structure, and returns the response result after processing. The user-space module can use a thread pool to process multiple data requests in parallel, with each worker thread bound to an independent CPU core, avoiding cross-core scheduling overhead.

[0065] In other embodiments, the preset network interface may also be a smart network interface card or a data processing unit with protocol offloading capability. Before or simultaneously with writing data to the ring memory via the DMA controller, the network interface device is also used to perform at least one of the following operations: hardware-level decryption of data encrypted using the Transport Layer Security (TLS) protocol in network transmission, and directly writing the decrypted plaintext data to the original data area of ​​the ring memory; and / or, hardware-level parsing of the Redis Serialization Protocol (RESP) followed by the data, extracting the command type and parameter length information from the protocol header, and filling the extracted information into the metadata area of ​​the ring memory.

[0066] In this way, computationally intensive tasks such as TLS encryption / decryption and RESP protocol parsing are offloaded to the network interface device hardware. The CPU no longer needs to execute the above-mentioned computational instructions, further freeing up CPU computing power, reducing the latency overhead caused by TLS handshake, and also reducing the load of kernel-mode modules for protocol pre-parsing, thereby further reducing the CPU utilization rate of the overall data processing path.

[0067] In other embodiments, a monitoring module located in the kernel-mode module can periodically collect the historical data write rate and fill rate changes of the ring memory area, and use a traffic prediction model based on the collected historical data to predict the data arrival trend in the next time window; and dynamically adjust the pre-read window size or DMA write strategy of the ring memory area according to the prediction results.

[0068] The traffic prediction model includes a time-series prediction model built on a Long Short-Term Memory (LSTM) network. Its input is a sequence of write rates over multiple consecutive historical periods, and its output is the predicted write rate for the next period. This allows for proactive expansion of the available capacity of the ring storage area or an increase in the amount of data to be pre-read when the predicted write rate exceeds the current processing capacity threshold, thus smoothing the impact of sudden traffic surges on processing latency. By predicting data arrival trends in advance through the traffic prediction model and dynamically adjusting the pre-read window and write strategy of the ring storage area accordingly, the system can prepare in advance before traffic surges occur. This avoids processing latency jitter caused by frequent buffer expansions or data backlogs during sudden traffic surges, further improving the system's stability and real-time response in complex business scenarios.

[0069] In some embodiments, the method of this disclosure can also determine the remaining storage space in the circular storage area based on the difference between the write pointer and the read pointer; when the remaining storage space is less than a preset threshold, replace the circular storage area; migrate multiple data in the circular storage area to the replaced circular storage area and synchronously update the storage location information of each data; and update the write pointer and the read pointer based on the storage location information of the migrated multiple data.

[0070] Specifically, the dynamic expansion module deployed in the kernel-mode module can monitor the fill rate of the ring storage area in real time. This is achieved by calculating the difference between the write pointer value and the read pointer value to determine the current amount of valid data, and then dividing this difference by the total capacity of the ring storage area to obtain the fill rate. When the fill rate exceeds a preset threshold (e.g., 90%), it indicates insufficient remaining storage space, triggering an expansion operation. In some embodiments, to avoid frequent expansions due to instantaneous traffic fluctuations, the expansion operation can be triggered only when the fill rate exceeds the preset threshold for multiple consecutive monitoring periods (e.g., three consecutive periods, each period being 1 second). After the expansion operation is completed, the dynamic expansion module can update the capacity records and monitoring thresholds, reset the traffic statistics window, and begin a new round of monitoring.

[0071] Specifically, during expansion, the dynamic expansion module first allocates a new circular storage area. The capacity of the new circular storage area is larger than that of the current circular storage area; for example, if the current capacity is 1GB, the new capacity expands to 2GB. After allocation, the dynamic expansion module starts a background thread to migrate all valid data (i.e., data between the write pointer and read pointer) from the original data area of ​​the current circular storage area to the new circular storage area. Based on the actual storage location of the data in the new circular storage area, the module synchronously updates the storage location information of each piece of data (i.e., the starting offset and data length in the original data area). During the migration, the original circular storage area can still receive new data writes normally. After the migration is complete, an atomic operation switches the global pointer from the original circular storage area to the new circular storage area, and updates the positions of the write and read pointers. After the switch is complete, the memory space of the original circular storage area is released.

[0072] As described above, the dynamic expansion module monitors the fill rate of the ring storage area in real time and triggers expansion when the fill rate exceeds a preset threshold. This allows for dynamic adjustment of the buffer capacity based on actual load, avoiding memory resource waste caused by pre-allocated fixed memory pools or buffer overflows due to sudden traffic surges, effectively improving memory utilization. Furthermore, by setting a condition that expansion is only triggered when the threshold is exceeded for multiple consecutive monitoring periods, frequent expansion operations caused by instantaneous traffic fluctuations are avoided, reducing operating system overhead and performance volatility. In addition, the expansion process employs asynchronous data migration via a background thread. During migration, the original ring storage area can still receive new data writes normally, and seamless switching between the old and new buffers is achieved through atomic operations, ensuring uninterrupted data flow processing and guaranteeing high service availability. After migration, the write and read pointer positions are updated synchronously, and the old buffer memory space is released after the switch, making the expansion process transparent to upper-layer business logic. This further reduces memory fragmentation and improves system stability and reliability under traffic surge scenarios.

[0073] In some embodiments, the migration process can employ an asynchronous copy method, where a background thread copies data block by block, and the original circular storage area can still handle read and write requests during the copying process. Once the migration is complete, an atomic comparison-swapping strategy is used to atomically switch the global pointer to the new circular storage area, avoiding data inconsistency during the switching process.

[0074] In some embodiments, updating the write pointer and read pointer based on the storage location information of multiple data after migration includes: updating the write pointer based on the storage location information of the data pointed to by the write pointer in the replaced circular storage area; and updating the read pointer based on the storage location information of the data pointed to by the read pointer in the replaced circular storage area.

[0075] For example, suppose the original circular buffer has a capacity of 1GB, the write pointer `write_pos` points to the offset of the last data item in the circular buffer, and the read pointer `read_pos` points to the offset of the first data item. Based on this, when a resizing is triggered, the operating system can allocate a new circular buffer with a capacity of 2GB, and a background migration thread will copy the data from the original buffer sequentially to the new circular buffer, re-recording the starting offset of each data item according to its actual storage location in the new circular buffer. After the migration is complete, the system performs pointer updates: Write pointer update: Obtain the storage location information of the data pointed to by the original write_pos in the new buffer, and use this location as the new write_pos value. For example, if the starting offset of the data in the new buffer is X, and the data length is L, then the new write_pos = X + L.

[0076] Read pointer update: Get the storage location information of the data pointed to by the original read_pos in the new buffer, and use the starting offset of the position as the new read_pos value, that is, read_pos = the starting offset of the data in the new buffer.

[0077] In this way, the read pointer and write pointer are re-established in the new buffer, ensuring that subsequent read and write operations can continue from the correct position.

[0078] By employing an asynchronous copying method using a background thread for data migration, the original circular storage area can still handle read and write requests normally during the copying process. This ensures that the expansion operation does not block or interrupt ongoing business processing, guaranteeing high service availability and data flow continuity. After the migration is complete, an atomic comparison and swap strategy is used to atomically switch the global pointer to the new circular storage area, avoiding data inconsistency or read / write conflicts during the switch, thus ensuring data consistency and system stability. Simultaneously, by recalculating and updating the pointer values ​​based on the actual storage location of the data pointed to by the original write and read pointers in the new buffer, the correspondence between the read and write pointers can be accurately reconstructed in the new buffer. This ensures that subsequent read and write operations can continue from the correct offset position after the migration, without requiring upper-layer business processes to be aware of the expansion process. This further reduces the system's operational complexity and the risk of business interruption due to expansion, improving the system's reliability and scalability under traffic surge scenarios.

[0079] The foregoing primarily describes the solutions provided by the embodiments of this disclosure from the perspective of the server. It is understood that, in order to implement the above functions, the server includes the corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.

[0080] This disclosure embodiment can divide the server into functional units according to the above method example. For example, it can divide each function into separate functional modules, or it can integrate two or more functions into one management module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this disclosure embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0081] By dividing each functional module according to its corresponding function, an exemplary embodiment of this disclosure provides a batch data processing apparatus, which can be a server or a chip applied to a server. Figure 4 This is a schematic diagram of a batch data processing apparatus provided in one embodiment of the present disclosure. Figure 4 As shown, the batch data processing device 400 includes: The writing module 401 is used to acquire multiple data through a preset network interface and write the multiple data into a preset ring storage area; The parsing module 402 is used to parse the multiple data in the ring storage area respectively to generate data description information for each data, wherein the data description information includes storage location information; The acquisition module 403 is used to acquire multiple ready events from multiple clients in a single system call. Each ready event corresponds to a data request, and each ready event carries the storage location information and execution priority of the data request determined according to the data description information. The read and feedback module 404 is used to read the corresponding data from the circular storage area according to the storage location information of each data request for multiple data requests in each execution priority level in descending order of execution priority, and to feed back the read data to the client corresponding to the data request.

[0082] In an optional embodiment, the batch data processing device 400 further includes a pointer update module 405, which is used to set a read pointer and a write pointer in the circular storage area. The read pointer and the write pointer move along a preset direction of the circular storage area. The read pointer is used to indicate the storage location information of the read data in the circular storage area, and the write pointer is used to indicate the storage location information of the data to be written in the circular storage area. After writing data to the circular storage area, the position of the write pointer is updated along the preset direction. After reading data from the circular storage area, the position of the read pointer is updated along the preset direction.

[0083] In an optional manner, the pointer update module 405 is further configured to determine the remaining storage space in the circular storage area based on the difference between the write pointer and the read pointer; when the remaining storage space is less than a preset threshold, replace the circular storage area; migrate multiple data in the circular storage area to the replaced circular storage area and synchronously update the storage location information of each data; and update the write pointer and the read pointer based on the storage location information of the migrated multiple data.

[0084] In an alternative embodiment, the pointer update module 405 is further configured to update the write pointer according to the storage location information of the data pointed to by the write pointer in the replaced circular storage area; and to update the read pointer according to the storage location information of the data pointed to by the read pointer in the replaced circular storage area.

[0085] In one alternative approach, the ring-shaped storage area includes a raw data area and a metadata area, wherein the raw data area is used to store multiple data items, and the metadata area is used to store data description information for each data item.

[0086] In one optional manner, the execution priority includes a first execution priority and a second execution priority. The read and feedback module 404 is further configured to classify multiple data requests with the first execution priority as a first type of data request and multiple data requests with the second execution priority as a second type of data request; read the corresponding data from the circular storage area according to the storage location information of each data request in the first type of data request and feed it back to the corresponding client; after all the data corresponding to the first type of data request has been read and fed back, read the corresponding data from the circular storage area according to the storage location information of each data request in the second type of data request and feed it back to the corresponding client.

[0087] This disclosure also provides an electronic device, including: at least one processor; a memory for storing at least one processor-executable instruction; wherein the at least one processor is used to execute the instruction to implement the steps of the method disclosed in this disclosure.

[0088] Figure 5 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present disclosure. Figure 5 As shown, the electronic device 500 includes at least one processor 501 and a memory 502 coupled to the processor 501, which can perform the corresponding steps in the methods disclosed in the embodiments of this disclosure.

[0089] The processor 501 described above can also be called a Central Processing Unit (CPU), which can be an integrated circuit chip with signal processing capabilities. Each step in the method disclosed in this embodiment can be implemented by the integrated logic circuitry in the processor 501 or by software instructions. The processor 501 can be a general-purpose processor, a digital signal processor (DSP), an ASIC, a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this embodiment can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules can be located in the memory 502, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The processor 501 reads information from the memory 502 and, in conjunction with its hardware, completes the steps of the method described above.

[0090] Furthermore, various operations / processes according to this disclosure, implemented via software and / or firmware, can be transmitted from a storage medium or network to a computer system with a dedicated hardware architecture, for example, Figure 6 The computer system 600 shown is equipped with the programs that constitute the software. When various programs are installed, the computer system is able to perform various functions, including those described above. Figure 6 This is a schematic diagram of the structure of a computer system provided in an embodiment of the present disclosure.

[0091] Computer system 600 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0092] like Figure 6 As shown, the computer system 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. The RAM 603 may also store various programs and data required for the operation of the computer system 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0093] Multiple components in the computer system 600 are connected to the I / O interface 605, including: an input unit 606, an output unit 607, a storage unit 608, and a communication unit 609. The input unit 606 can be any type of device capable of inputting information into the computer system 600. The input unit 606 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of the electronic device. The output unit 607 can be any type of device capable of presenting information and may include, but is not limited to, a monitor, speaker, video / audio output terminal, vibrator, and / or printer. The storage unit 608 may include, but is not limited to, a hard disk and an optical disk. The communication unit 609 allows the computer system 600 to exchange information / data with other devices via a network such as the Internet, and may include, but is not limited to, a modem, network card, infrared communication device, wireless communication transceiver, and / or chipset, such as Bluetooth™ devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.

[0094] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above. For example, in some embodiments, the methods disclosed in this disclosure can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on an electronic device via ROM 602 and / or communication unit 609. In some embodiments, the computing unit 601 can be configured to perform the methods disclosed in this disclosure by any other suitable means (e.g., by means of firmware).

[0095] This disclosure also provides a computer-readable storage medium, wherein when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is able to perform the methods disclosed in this disclosure.

[0096] The computer-readable storage medium in this disclosure can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. The aforementioned computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specifically, the aforementioned computer-readable storage medium may include electrical connections based on one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0097] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0098] Figure 7 This is a schematic diagram of a computer program product provided according to an embodiment of the present disclosure. Figure 7 As shown, the computer program product 700 includes a computer program 701, which, when executed by a processor, implements the methods disclosed in the embodiments of this disclosure.

[0099] In embodiments of this disclosure, computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof. These programming languages ​​include, but are not limited to, object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network (including a local area network (LAN) or a wide area network (WAN)), or it can be connected to an external computer.

[0100] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0101] The modules, components, or units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the modules, components, or units do not necessarily constitute a limitation on the module, component, or unit itself.

[0102] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary hardware logic components that can be used include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.

[0103] The above description is merely an illustration of some embodiments of this disclosure and the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0104] While specific embodiments of this disclosure have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of this disclosure. Those skilled in the art should understand that modifications can be made to the above embodiments without departing from the scope and spirit of this disclosure. The scope of this disclosure is defined by the appended claims.

Claims

1. A method for processing batch data, characterized in that, include: Multiple data points are acquired through a preset network interface and written into a preset ring-shaped storage area; The multiple data items within the ring-shaped storage area are parsed to generate data description information for each data item, wherein the data description information includes storage location information; Multiple ready events from multiple clients are obtained in batches through a single system call. Each ready event corresponds to a data request, and each ready event carries the storage location information and execution priority of the data request determined according to the data description information. In accordance with the execution priority from high to low, for each of the multiple data requests in each execution priority level, the corresponding data is read from the circular storage area according to the storage location information of each data request, and the read data is fed back to the client corresponding to the data request.

2. The method according to claim 1, characterized in that, The method further includes: A read pointer and a write pointer are set in the circular storage area. The read pointer and the write pointer move along a preset direction of the circular storage area. The read pointer is used to indicate the storage location information of the read data in the circular storage area. The write pointer is used to indicate the storage location information of the data to be written in the circular storage area. After writing data to the circular storage area, the position of the write pointer is updated along the preset direction; After reading data from the circular storage area, the position of the read pointer is updated along the preset direction.

3. The method according to claim 2, characterized in that, The method further includes: The remaining storage space within the circular storage area is determined based on the difference between the write pointer and the read pointer. When the remaining storage space is less than a preset threshold, the annular storage area is replaced; The data in the ring storage area is migrated to the new ring storage area, and the storage location information of each data is updated synchronously. The write pointer and the read pointer are updated based on the storage location information of the multiple data after migration.

4. The method according to claim 3, characterized in that, The step of updating the write pointer and the read pointer based on the storage location information of the multiple data after migration includes: The write pointer is updated based on the storage location information of the data pointed to by the write pointer in the replaced circular memory area; The read pointer is updated based on the storage location information of the data pointed to by the read pointer in the replaced circular storage area.

5. The method according to claim 1, characterized in that, The ring-shaped storage area includes a raw data area and a metadata area. The raw data area is used to store multiple data items, and the metadata area is used to store data description information for each data item.

6. The method according to claim 1, characterized in that, The execution priority includes a first execution priority and a second execution priority. The step of sequentially reading data from the circular storage area for multiple data requests within each execution priority level, based on the storage location information of each data request, includes: The plurality of data requests having the first execution priority are classified as a first type of data request, and the plurality of data requests having the second execution priority are classified as a second type of data request; Based on the storage location information of each data request in the first type of data request, the corresponding data is read from the circular storage area and fed back to the corresponding client; After all the data corresponding to the first type of data request has been read and fed back, the corresponding data is read from the circular storage area according to the storage location information of each data request in the second type of data request, and fed back to the corresponding client.

7. A batch data processing apparatus, characterized in that, include: The writing module is used to acquire multiple data through a preset network interface and write the multiple data into a preset ring storage area; The parsing module is used to parse the multiple data in the ring storage area respectively to generate data description information for each data, wherein the data description information includes storage location information; The acquisition module is used to acquire multiple ready events from multiple clients in a single system call. Each ready event corresponds to a data request, and each ready event carries the storage location information and execution priority of the data request determined according to the data description information. The read and feedback module is used to read data from the circular storage area according to the storage location information of each data request for multiple data requests in each execution priority level in descending order of execution priority, and to feed back the read data to the client corresponding to the data request.

8. A computer device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 6.